Update string literals
Since _ls is now deprecated this is removed in favour of L1, I've also taken the oportunity to replace QStringLiteral and QLatin1String with their shortened form while we're at it. There are also a few instances where the string literal type has been switch, the general rule being to use the one that matches the function type or value being compared to avoid conversions.
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
#include "events/pollevent.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
/**
|
||||
* @class DelegateType
|
||||
*
|
||||
@@ -58,7 +60,7 @@ public:
|
||||
return Message;
|
||||
}
|
||||
if (event.isStateEvent()) {
|
||||
if (event.matrixType() == QStringLiteral("org.matrix.msc3672.beacon_info")) {
|
||||
if (event.matrixType() == u"org.matrix.msc3672.beacon_info"_s) {
|
||||
return Message;
|
||||
}
|
||||
return State;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#include "events/pollevent.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
/**
|
||||
* @class MessageComponentType
|
||||
*
|
||||
@@ -92,7 +94,7 @@ public:
|
||||
return MessageComponentType::Image;
|
||||
}
|
||||
if (event.isStateEvent()) {
|
||||
if (event.matrixType() == QStringLiteral("org.matrix.msc3672.beacon_info")) {
|
||||
if (event.matrixType() == u"org.matrix.msc3672.beacon_info"_s) {
|
||||
return MessageComponentType::LiveLocation;
|
||||
}
|
||||
return MessageComponentType::Other;
|
||||
@@ -120,10 +122,10 @@ public:
|
||||
*/
|
||||
static Type typeForTag(const QString &tag)
|
||||
{
|
||||
if (tag == QLatin1String("pre") || tag == QLatin1String("pre")) {
|
||||
if (tag == u"pre"_s || tag == u"pre"_s) {
|
||||
return Code;
|
||||
}
|
||||
if (tag == QLatin1String("blockquote")) {
|
||||
if (tag == u"blockquote"_s) {
|
||||
return Quote;
|
||||
}
|
||||
return Text;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
#include <KLocalizedString>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class NeoChatRoomType : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -75,19 +77,19 @@ public:
|
||||
{
|
||||
switch (category) {
|
||||
case NeoChatRoomType::Invited:
|
||||
return QStringLiteral("user-invisible");
|
||||
return u"user-invisible"_s;
|
||||
case NeoChatRoomType::Favorite:
|
||||
return QStringLiteral("favorite");
|
||||
return u"favorite"_s;
|
||||
case NeoChatRoomType::Direct:
|
||||
return QStringLiteral("dialog-messages");
|
||||
return u"dialog-messages"_s;
|
||||
case NeoChatRoomType::Normal:
|
||||
return QStringLiteral("group");
|
||||
return u"group"_s;
|
||||
case NeoChatRoomType::Deprioritized:
|
||||
return QStringLiteral("object-order-lower");
|
||||
return u"object-order-lower"_s;
|
||||
case NeoChatRoomType::Space:
|
||||
return QStringLiteral("group");
|
||||
return u"group"_s;
|
||||
default:
|
||||
return QStringLiteral("tools-report-bug");
|
||||
return u"tools-report-bug"_s;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <QObject>
|
||||
#include <QQmlEngine>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
/**
|
||||
* @class PushRuleKind
|
||||
*
|
||||
@@ -42,15 +44,15 @@ public:
|
||||
{
|
||||
switch (kind) {
|
||||
case Kind::Override:
|
||||
return QLatin1String("override");
|
||||
return u"override"_s;
|
||||
case Kind::Content:
|
||||
return QLatin1String("content");
|
||||
return u"content"_s;
|
||||
case Kind::Room:
|
||||
return QLatin1String("room");
|
||||
return u"room"_s;
|
||||
case Kind::Sender:
|
||||
return QLatin1String("sender");
|
||||
return u"sender"_s;
|
||||
case Kind::Underride:
|
||||
return QLatin1String("underride");
|
||||
return u"underride"_s;
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
@@ -170,15 +172,15 @@ public:
|
||||
{
|
||||
switch (section) {
|
||||
case Section::Master:
|
||||
return QLatin1String("Master");
|
||||
return u"Master"_s;
|
||||
case Section::Room:
|
||||
return QLatin1String("Room Notifications");
|
||||
return u"Room Notifications"_s;
|
||||
case Section::Mentions:
|
||||
return QLatin1String("@Mentions");
|
||||
return u"@Mentions"_s;
|
||||
case Section::Keywords:
|
||||
return QLatin1String("Keywords");
|
||||
return u"Keywords"_s;
|
||||
case Section::Invites:
|
||||
return QLatin1String("Invites");
|
||||
return u"Invites"_s;
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user