Port to QStringLiteral operator

This commit is contained in:
Jonas Kvinge
2024-10-20 06:38:55 +02:00
parent 722035913e
commit ef9ef63f02
202 changed files with 2036 additions and 1889 deletions

View File

@@ -36,6 +36,8 @@
#include "settings/appearancesettingspage.h"
#include "iconloader.h"
using namespace Qt::Literals::StringLiterals;
bool IconLoader::system_icons_ = false;
bool IconLoader::custom_icons_ = false;
@@ -49,7 +51,7 @@ void IconLoader::Init() {
#endif
QDir dir;
if (dir.exists(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/icons"))) {
if (dir.exists(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/icons"_s)) {
custom_icons_ = true;
}
@@ -123,7 +125,7 @@ QIcon IconLoader::Load(const QString &name, const bool system_icon, const int fi
}
if (custom_icons_) {
QString custom_icon_path = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/icons/%1x%2/%3.png");
QString custom_icon_path = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + u"/icons/%1x%2/%3.png"_s;
for (int s : std::as_const(sizes)) {
QString filename(custom_icon_path.arg(s).arg(s).arg(name));
if (QFile::exists(filename)) ret.addFile(filename, QSize(s, s));
@@ -132,7 +134,7 @@ QIcon IconLoader::Load(const QString &name, const bool system_icon, const int fi
qLog(Warning) << "Couldn't load icon" << name << "from custom icons.";
}
const QString path(QStringLiteral(":/icons/%1x%2/%3.png"));
const QString path(u":/icons/%1x%2/%3.png"_s);
for (int s : std::as_const(sizes)) {
QString filename(path.arg(s).arg(s).arg(name));
if (QFile::exists(filename)) ret.addFile(filename, QSize(s, s));