summary refs log tree commit diff
path: root/src/ui/UserProfile.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/UserProfile.cpp
parentuse more literals (diff)
downloadnheko-d8ead9573b6fd45e386d54b9aaec4e1c335b10ec.tar.xz
Reduce allocations using QStringLiteral
Diffstat (limited to 'src/ui/UserProfile.cpp')
-rw-r--r--src/ui/UserProfile.cpp12
1 files changed, 6 insertions, 6 deletions
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; }