summary refs log tree commit diff
path: root/src/ui/TextLabel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 04:28:08 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 04:52:52 +0100
commitd8ead9573b6fd45e386d54b9aaec4e1c335b10ec (patch)
tree514d00ee26e67fc8bfeff403858e7d4ef276e6e3 /src/ui/TextLabel.cpp
parentuse more literals (diff)
downloadnheko-d8ead9573b6fd45e386d54b9aaec4e1c335b10ec.tar.xz
Reduce allocations using QStringLiteral
Diffstat (limited to 'src/ui/TextLabel.cpp')
-rw-r--r--src/ui/TextLabel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/TextLabel.cpp b/src/ui/TextLabel.cpp

index 340d3b8f..30b443c4 100644 --- a/src/ui/TextLabel.cpp +++ b/src/ui/TextLabel.cpp
@@ -29,7 +29,7 @@ TextLabel::TextLabel(QWidget *parent) TextLabel::TextLabel(const QString &text, QWidget *parent) : QTextBrowser(parent) { - document()->setDefaultStyleSheet(QString("a {color: %1; }").arg(utils::linkColor())); + document()->setDefaultStyleSheet(QStringLiteral("a {color: %1; }").arg(utils::linkColor())); setText(text); setOpenExternalLinks(true); @@ -108,7 +108,7 @@ TextLabel::handleLinkActivation(const QUrl &url) auto parts = url.toString().split('/'); auto defaultHandler = [](const QUrl &url) { QDesktopServices::openUrl(url); }; - if (url.host() != "matrix.to" || parts.isEmpty()) + if (url.host() != QLatin1String("matrix.to") || parts.isEmpty()) return defaultHandler(url); try {