2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Replaced some qstr with u""_q literal.

This commit is contained in:
23rd
2022-11-27 00:20:17 +03:00
parent 22dc7023fc
commit 2acedca6b7
99 changed files with 477 additions and 480 deletions

View File

@@ -55,19 +55,19 @@ struct LangPackData {
const QString &word) {
if ((word.size() == 1) && !word[0].isLetter()) {
return true;
} else if (word == qstr("10")) {
} else if (word == u"10"_q) {
return true;
} else if (language != qstr("en")) {
} else if (language != u"en"_q) {
return false;
} else if ((word.size() == 1)
&& (word[0] != '$')
&& (word[0].unicode() != 8364)) { // Euro.
return true;
} else if ((word.size() == 2)
&& (word != qstr("us"))
&& (word != qstr("uk"))
&& (word != qstr("hi"))
&& (word != qstr("ok"))) {
&& (word != u"us"_q)
&& (word != u"uk"_q)
&& (word != u"hi"_q)
&& (word != u"ok"_q)) {
return true;
}
return false;
@@ -80,7 +80,7 @@ struct LangPackData {
}
void CreateCacheFilePath() {
QDir().mkpath(internal::CacheFileFolder() + qstr("/keywords"));
QDir().mkpath(internal::CacheFileFolder() + u"/keywords"_q);
}
[[nodiscard]] QString CacheFilePath(QString id) {
@@ -89,7 +89,7 @@ void CreateCacheFilePath() {
if (id.isEmpty()) {
return QString();
}
return internal::CacheFileFolder() + qstr("/keywords/") + id;
return internal::CacheFileFolder() + u"/keywords/"_q + id;
}
[[nodiscard]] LangPackData ReadLocalCache(const QString &id) {

View File

@@ -153,9 +153,8 @@ QString StateDescription(const SetState &state) {
}
bool GoodSetPartName(const QString &name) {
return (name == qstr("config.json"))
|| (name.startsWith(qstr("emoji_"))
&& name.endsWith(qstr(".webp")));
return (name == u"config.json"_q)
|| (name.startsWith(u"emoji_"_q) && name.endsWith(u".webp"_q));
}
bool UnpackSet(const QString &path, const QString &folder) {

View File

@@ -435,7 +435,7 @@ InlineBotQuery ParseInlineBotQuery(
auto inlineUsernameEqualsText = (inlineUsernameEnd == textLength);
auto validInlineUsername = false;
if (inlineUsernameEqualsText) {
validInlineUsername = text.endsWith(qstr("bot"));
validInlineUsername = text.endsWith(u"bot"_q);
} else if (inlineUsernameEnd < textLength && inlineUsernameLength) {
validInlineUsername = text[inlineUsernameEnd].isSpace();
}