From d8ead9573b6fd45e386d54b9aaec4e1c335b10ec Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 29 Dec 2021 04:28:08 +0100 Subject: Reduce allocations using QStringLiteral --- src/ui/UserProfile.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ui/UserProfile.cpp') diff --git a/src/ui/UserProfile.cpp b/src/ui/UserProfile.cpp index 6179ba01..cd9e170d 100644 --- a/src/ui/UserProfile.cpp +++ b/src/ui/UserProfile.cpp @@ -28,7 +28,7 @@ UserProfile::UserProfile(QString roomid, , manager(manager_) , model(parent) { - globalAvatarUrl = ""; + globalAvatarUrl = QLatin1String(""); connect(this, &UserProfile::globalUsernameRetrieved, @@ -124,7 +124,7 @@ UserProfile::avatarUrl() bool UserProfile::isGlobalUserProfile() const { - return roomid_ == ""; + return roomid_ == QLatin1String(""); } crypto::Trust @@ -297,7 +297,7 @@ UserProfile::updateVerificationStatus() void UserProfile::banUser() { - ChatPage::instance()->banUser(this->userid_, ""); + ChatPage::instance()->banUser(this->userid_, QLatin1String("")); } // void ignoreUser(){ @@ -307,7 +307,7 @@ UserProfile::banUser() void UserProfile::kickUser() { - ChatPage::instance()->kickUser(this->userid_, ""); + ChatPage::instance()->kickUser(this->userid_, QLatin1String("")); } void @@ -390,10 +390,10 @@ UserProfile::changeAvatar() QMimeDatabase db; QMimeType mime = db.mimeTypeForFile(fileName, QMimeDatabase::MatchContent); - const auto format = mime.name().split("/")[0]; + const auto format = mime.name().split(QStringLiteral("/"))[0]; QFile file{fileName, this}; - if (format != "image") { + if (format != QLatin1String("image")) { emit displayError(tr("The selected file is not an image")); return; } -- cgit 1.5.1