diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,6 @@ find_package(KF5WidgetsAddons ${KF5_DEP_VERSION} REQUIRED) find_package(KF5ItemViews ${KF5_DEP_VERSION} REQUIRED) -remove_definitions(-DQT_NO_CAST_FROM_ASCII) -remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY) - add_definitions(-DTRANSLATION_DOMAIN=\"kiconthemes5\") if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ki18n_install(po) diff --git a/autotests/kiconengine_unittest.cpp b/autotests/kiconengine_unittest.cpp --- a/autotests/kiconengine_unittest.cpp +++ b/autotests/kiconengine_unittest.cpp @@ -37,7 +37,7 @@ QStandardPaths::setTestModeEnabled(true); // Remove icon cache - const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/icon-cache.kcache"; + const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/icon-cache.kcache"); QFile::remove(cacheFile); KConfigGroup cg(KSharedConfig::openConfig(), "Icons"); diff --git a/autotests/kiconloader_benchmark.cpp b/autotests/kiconloader_benchmark.cpp --- a/autotests/kiconloader_benchmark.cpp +++ b/autotests/kiconloader_benchmark.cpp @@ -104,7 +104,7 @@ { QBENCHMARK { // Remove icon cache - const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/icon-cache.kcache"; + const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/icon-cache.kcache"); QFile::remove(cacheFile); // Clear SHM cache KIconLoader::global()->reconfigure(QString()); diff --git a/autotests/kiconloader_rcctest.cpp b/autotests/kiconloader_rcctest.cpp --- a/autotests/kiconloader_rcctest.cpp +++ b/autotests/kiconloader_rcctest.cpp @@ -35,12 +35,12 @@ { QStandardPaths::enableTestMode(true); qputenv("XDG_DATA_DIRS", "/doesnotexist"); // ensure hicolor/oxygen/breeze are not found - QFile rcc("icontheme.rcc"); + QFile rcc(QStringLiteral("icontheme.rcc")); Q_ASSERT(rcc.exists()); - QCoreApplication::setApplicationName("myappname"); // for a fixed location on Unix (appname is empty here otherwise) + QCoreApplication::setApplicationName(QStringLiteral("myappname")); // for a fixed location on Unix (appname is empty here otherwise) const QString destDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); QDir().mkpath(destDir); - const QString dest = destDir + "/icontheme.rcc"; + const QString dest = destDir + QStringLiteral("/icontheme.rcc"); QFile::remove(dest); if (!rcc.copy(dest)) { qWarning() << "Error copying to" << dest; @@ -56,7 +56,7 @@ void initTestCase() { // Remove icon cache - const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/icon-cache.kcache"; + const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/icon-cache.kcache"); QFile::remove(cacheFile); // Clear SHM cache @@ -89,7 +89,7 @@ } private: - const QString m_internalThemeName = "kf5_rcc_theme"; + const QString m_internalThemeName = QStringLiteral("kf5_rcc_theme"); }; QTEST_MAIN(KIconLoader_RCCThemeTest) diff --git a/autotests/kiconloader_resourcethemetest.cpp b/autotests/kiconloader_resourcethemetest.cpp --- a/autotests/kiconloader_resourcethemetest.cpp +++ b/autotests/kiconloader_resourcethemetest.cpp @@ -48,7 +48,7 @@ KIconLoader::global()->loadIcon(QStringLiteral("someiconintheme"), KIconLoader::Desktop, 22, KIconLoader::DefaultState, QStringList(), &path); - QCOMPARE(path, QString(":/icons/themeinresource/22x22/appsNoContext/someiconintheme.png")); + QCOMPARE(path, QStringLiteral(":/icons/themeinresource/22x22/appsNoContext/someiconintheme.png")); } }; diff --git a/autotests/kiconloader_unittest.cpp b/autotests/kiconloader_unittest.cpp --- a/autotests/kiconloader_unittest.cpp +++ b/autotests/kiconloader_unittest.cpp @@ -132,7 +132,7 @@ QPixmap img(i, i); img.fill(Qt::red); - QVERIFY(img.save(dir + "/red.png")); + QVERIFY(img.save(dir + QStringLiteral("/red.png"))); dirs += relDir; KConfigGroup dirGroup = configFile.group(relDir); @@ -157,7 +157,7 @@ void init() { // Remove icon cache - const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/icon-cache.kcache"; + const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/icon-cache.kcache"); QFile::remove(cacheFile); // Clear SHM cache @@ -242,15 +242,15 @@ { KIconLoader appIconLoader(appName); QString iconPath = appIconLoader.iconPath(QStringLiteral("image1"), KIconLoader::User); - QCOMPARE(iconPath, appDataDir.filePath("pics/image1.png")); + QCOMPARE(iconPath, appDataDir.filePath(QStringLiteral("pics/image1.png"))); QVERIFY(QFile::exists(iconPath)); // Load it again, to use the "last loaded" cache QString iconPath2 = appIconLoader.iconPath(QStringLiteral("image1"), KIconLoader::User); QCOMPARE(iconPath, iconPath2); // Load something else, to clear the "last loaded" cache QString iconPathTextEdit = appIconLoader.iconPath(QStringLiteral("image2"), KIconLoader::User); - QCOMPARE(iconPathTextEdit, appDataDir.filePath("pics/image2.png")); + QCOMPARE(iconPathTextEdit, appDataDir.filePath(QStringLiteral("pics/image2.png"))); QVERIFY(QFile::exists(iconPathTextEdit)); // Now load kdialog again, to use the real kiconcache iconPath2 = appIconLoader.iconPath(QStringLiteral("image1"), KIconLoader::User); @@ -309,7 +309,7 @@ KIconLoader::DefaultState, QStringList(), &path); QVERIFY(!pix.isNull()); - QCOMPARE(path.section('/', -1), expectedFileName); + QCOMPARE(path.section(QLatin1Char('/'), -1), expectedFileName); // do the same test using a global iconloader, so that // we get into the final return statement, which can only happen @@ -325,15 +325,15 @@ void testHasIcon() { // Do everything twice to check code paths that might use a cache - QVERIFY(KIconLoader::global()->hasIcon("kde")); - QVERIFY(KIconLoader::global()->hasIcon("kde")); + QVERIFY(KIconLoader::global()->hasIcon(QStringLiteral("kde"))); + QVERIFY(KIconLoader::global()->hasIcon(QStringLiteral("kde"))); KIconLoader iconLoader; - QVERIFY(iconLoader.hasIcon("kde")); + QVERIFY(iconLoader.hasIcon(QStringLiteral("kde"))); - QVERIFY(KIconLoader::global()->hasIcon("process-working")); - QVERIFY(KIconLoader::global()->hasIcon("process-working")); - QVERIFY(!KIconLoader::global()->hasIcon("no-such-icon-exists")); - QVERIFY(!KIconLoader::global()->hasIcon("no-such-icon-exists")); + QVERIFY(KIconLoader::global()->hasIcon(QStringLiteral("process-working"))); + QVERIFY(KIconLoader::global()->hasIcon(QStringLiteral("process-working"))); + QVERIFY(!KIconLoader::global()->hasIcon(QStringLiteral("no-such-icon-exists"))); + QVERIFY(!KIconLoader::global()->hasIcon(QStringLiteral("no-such-icon-exists"))); } void testIconPath() @@ -355,7 +355,7 @@ &path); QVERIFY(!path.isEmpty()); QVERIFY(QFile::exists(path)); - QVERIFY2(path.contains("32x32"), qPrintable(path)); + QVERIFY2(path.contains(QStringLiteral("32x32")), qPrintable(path)); QCOMPARE(pix.size(), QSize(32, 32)); // Compare with iconPath() @@ -368,10 +368,10 @@ &path); QVERIFY(!path.isEmpty()); QVERIFY(QFile::exists(path)); - QVERIFY2(path.contains("22x22"), qPrintable(path)); + QVERIFY2(path.contains(QStringLiteral("22x22")), qPrintable(path)); QCOMPARE(pix.size(), QSize(24, 24)); - QVERIFY(KIconLoader::global()->hasIcon("kde")); + QVERIFY(KIconLoader::global()->hasIcon(QStringLiteral("kde"))); path = QString(); KIconLoader::global()->loadIcon(QStringLiteral("does_not_exist"), KIconLoader::Desktop, 24, @@ -437,21 +437,21 @@ KIconLoader::global()->loadIcon(QStringLiteral("iconindirectorywithoutcontext"), KIconLoader::Desktop, 24, KIconLoader::DefaultState, QStringList(), &path); - QVERIFY(path.endsWith("appsNoContext/iconindirectorywithoutcontext.png")); + QVERIFY(path.endsWith(QLatin1String("appsNoContext/iconindirectorywithoutcontext.png"))); } { QString path; KIconLoader::global()->loadIcon(QStringLiteral("iconindirectorywithouttype"), KIconLoader::Desktop, 24, KIconLoader::DefaultState, QStringList(), &path); - QVERIFY(path.endsWith("appsNoType/iconindirectorywithouttype.png")); + QVERIFY(path.endsWith(QLatin1String("appsNoType/iconindirectorywithouttype.png"))); } { QString path; KIconLoader::global()->loadIcon(QStringLiteral("iconindirectorywithoutcontextortype"), KIconLoader::Desktop, 24, KIconLoader::DefaultState, QStringList(), &path); - QVERIFY(path.endsWith("appsNoContextOrType/iconindirectorywithoutcontextortype.png")); + QVERIFY(path.endsWith(QLatin1String("appsNoContextOrType/iconindirectorywithoutcontextortype.png"))); } } @@ -514,14 +514,14 @@ // Verify the ARGB hex (ff6496c8) uintToHex(testColorNoAlpha.rgba(), argbHex.data()); - QCOMPARE(argbHex, QString("ff6496c8")); + QCOMPARE(argbHex, QStringLiteral("ff6496c8")); // HEX (ARGB format without the #): 7b6496c8 QColor testColorWithAlpha(100, 150, 200, 123); // Test uintToHex to verify its ARGB output. uintToHex(testColorWithAlpha.rgba(), argbHex.data()); - QCOMPARE(argbHex, QString("7b6496c8")); + QCOMPARE(argbHex, QStringLiteral("7b6496c8")); } }; diff --git a/src/kicondialog.cpp b/src/kicondialog.cpp --- a/src/kicondialog.cpp +++ b/src/kicondialog.cpp @@ -415,9 +415,9 @@ static bool sortByFileName(const QString &path1, const QString &path2) { - const QString fileName1 = path1.mid(path1.lastIndexOf('/') + 1); - const QString fileName2 = path2.mid(path1.lastIndexOf('/') + 1); - return QString::compare(fileName1, fileName2, Qt::CaseInsensitive) < 0; + const auto fileName1 = path1.midRef(path1.lastIndexOf(QLatin1Char('/')) + 1); + const auto fileName2 = path2.midRef(path1.lastIndexOf(QLatin1Char('/')) + 1); + return fileName1.compare(fileName2, Qt::CaseInsensitive) < 0; } void KIconDialog::KIconDialogPrivate::showIcons() @@ -437,8 +437,8 @@ Q_FOREACH (const QString &relDir, KIconLoader::global()->searchPaths()) { const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, relDir, QStandardPaths::LocateDirectory); Q_FOREACH (const QString &dir, dirs) { - Q_FOREACH (const QString &fileName, QDir(dir).entryList(QStringList() << "*.png")) { - filelist << dir + '/' + fileName; + Q_FOREACH (const QString &fileName, QDir(dir).entryList(QStringList() << QStringLiteral("*.png"))) { + filelist << dir + QLatin1Char('/') + fileName; } } } diff --git a/src/kiconeffect.cpp b/src/kiconeffect.cpp --- a/src/kiconeffect.cpp +++ b/src/kiconeffect.cpp @@ -106,9 +106,9 @@ d->color2[i][1] = QColor(0, 0, 0); d->color2[i][2] = QColor(0, 0, 0); - KConfigGroup cg(config, *it + "Icons"); + KConfigGroup cg(config, *it + QStringLiteral("Icons")); for (it2 = states.constBegin(), j = 0; it2 != states.constEnd(); ++it2, ++j) { - QString tmp = cg.readEntry(*it2 + "Effect", QString()); + QString tmp = cg.readEntry(*it2 + QStringLiteral("Effect"), QString()); if (tmp == _togray) { effect = ToGray; } else if (tmp == _colorize) { @@ -127,10 +127,10 @@ if (effect != -1) { d->effect[i][j] = effect; } - d->value[i][j] = cg.readEntry(*it2 + "Value", 0.0); - d->color[i][j] = cg.readEntry(*it2 + "Color", QColor()); - d->color2[i][j] = cg.readEntry(*it2 + "Color2", QColor()); - d->trans[i][j] = cg.readEntry(*it2 + "SemiTransparent", false); + d->value[i][j] = cg.readEntry(*it2 + QStringLiteral("Value"), 0.0); + d->color[i][j] = cg.readEntry(*it2 + QStringLiteral("Color"), QColor()); + d->color2[i][j] = cg.readEntry(*it2 + QStringLiteral("Color2"), QColor()); + d->trans[i][j] = cg.readEntry(*it2 + QStringLiteral("SemiTransparent"), false); } } @@ -155,20 +155,15 @@ QString cached = d->key[group][state]; if (cached.isEmpty()) { - QString tmp; - cached = tmp.setNum(d->effect[group][state]); - cached += ':'; - cached += tmp.setNum(d->value[group][state]); - cached += ':'; - cached += d->trans[group][state] ? QLatin1String("trans") - : QLatin1String("notrans"); - if (d->effect[group][state] == Colorize || d->effect[group][state] == ToMonochrome) { - cached += ':'; - cached += d->color[group][state].name(); - } - if (d->effect[group][state] == ToMonochrome) { - cached += ':'; - cached += d->color2[group][state].name(); + const auto effectGroupState = d->effect[group][state]; + cached = QString::number(effectGroupState) + QLatin1Char(':') + + QString::number(d->value[group][state]) + QLatin1Char(':') + + (d->trans[group][state] ? QLatin1String("trans") : QLatin1String("notrans")); + + if (state == Colorize || effectGroupState == ToMonochrome) { + cached += QLatin1Char(':') + d->color[group][state].name(); + } else if (effectGroupState == ToMonochrome) { + cached += QLatin1Char(':') + d->color2[group][state].name(); } d->key[group][state] = cached; diff --git a/src/kiconloader.cpp b/src/kiconloader.cpp --- a/src/kiconloader.cpp +++ b/src/kiconloader.cpp @@ -101,7 +101,7 @@ static bool pathIsRelative(const QString &path) { #ifdef Q_OS_UNIX - return (!path.isEmpty() && path[0] != QChar('/')); + return (!path.isEmpty() && path[0] != QLatin1Char('/')); #else return QDir::isRelativePath(path); #endif @@ -128,8 +128,8 @@ uchar *colorFields = reinterpret_cast(&colorData); for (int i = 0; i < 4; i++) { - *buffer-- = hexLookup[*colorFields & 0xf]; - *buffer-- = hexLookup[*colorFields >> 4]; + *buffer-- = QLatin1Char(hexLookup[*colorFields & 0xf]); + *buffer-- = QLatin1Char(hexLookup[*colorFields >> 4]); colorFields++; } } @@ -448,10 +448,10 @@ stream.setCodec("ISO 8859-1"); while (!stream.atEnd()) { const QString line = stream.readLine(); - if (line.isEmpty() || line[0] == '#') { + if (line.isEmpty() || line[0] == QLatin1Char('#')) { continue; } - const int pos = line.indexOf(':'); + const int pos = line.indexOf(QLatin1Char(':')); if (pos == -1) { // syntax error continue; } @@ -612,7 +612,7 @@ break; } - KConfigGroup cg(config, QLatin1String(groups[i]) + "Icons"); + KConfigGroup cg(config, QLatin1String(groups[i]) + QStringLiteral("Icons")); mpGroups[i].size = cg.readEntry("Size", 0); if (!mpGroups[i].size && defaultSizesTheme) { @@ -649,7 +649,7 @@ addBaseThemes(mpThemeRoot, appname); // Insert application specific themes at the top. - searchPaths.append(appname + "/pics"); + searchPaths.append(appname + QStringLiteral("/pics")); // Add legacy icon dirs. searchPaths.append(QStringLiteral("icons")); // was xdgdata-icon in KStandardDirs @@ -673,7 +673,7 @@ { d->initIconThemes(); - d->searchPaths.append(appname + "/pics"); + d->searchPaths.append(appname + QStringLiteral("/pics")); d->addAppThemes(appname, themeBaseDir); } @@ -769,16 +769,16 @@ const QStringList lst = dir.entryList(QStringList(QStringLiteral("default.*")), QDir::Dirs); QStringList::ConstIterator it2; for (it2 = lst.begin(); it2 != lst.end(); ++it2) { - if (!QFileInfo::exists(*it + *it2 + "/index.desktop") - && !QFileInfo::exists(*it + *it2 + "/index.theme")) { + if (!QFileInfo::exists(*it + *it2 + QStringLiteral("/index.desktop")) + && !QFileInfo::exists(*it + *it2 + QStringLiteral("/index.theme"))) { continue; } //TODO: Is any special handling required for NTFS symlinks? #ifndef Q_OS_WIN - const int r = readlink(QFile::encodeName(*it + *it2), buf, sizeof(buf) - 1); + const int r = readlink(QFile::encodeName(*it + *it2).constData(), buf, sizeof(buf) - 1); if (r > 0) { buf[r] = 0; - const QDir dir2(buf); + const QDir dir2(QFile::decodeName(buf)); QString themeName = dir2.dirName(); if (!list.contains(themeName)) { @@ -1087,7 +1087,7 @@ break; } - int rindex = currentName.lastIndexOf('-'); + int rindex = currentName.lastIndexOf(QLatin1Char('-')); if (rindex > 1) { // > 1 so that we don't split x-content or x-epoc currentName.truncate(rindex); @@ -1139,7 +1139,7 @@ QString KIconLoaderPrivate::locate(const QString &fileName) { Q_FOREACH (const QString &dir, searchPaths) { - const QString path = dir + '/' + fileName; + const QString path = dir + QLatin1Char('/') + fileName; if (QDir(dir).isAbsolute()) { if (QFileInfo::exists(path)) { return path; @@ -1267,7 +1267,7 @@ // Special case for absolute path icons. if (name.startsWith(QLatin1String("favicons/"))) { favIconOverlay = true; - name = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + '/' + name + ".png"; + name = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1Char('/') + name + QStringLiteral(".png"); } bool absolutePath = !pathIsRelative(name); @@ -1393,9 +1393,9 @@ if (file.isEmpty()) { return nullptr; } - int dirLen = file.lastIndexOf('/'); + int dirLen = file.lastIndexOf(QLatin1Char('/')); QString icon = iconPath(name, size ? -size : group, true); - if (!icon.isEmpty() && file.left(dirLen) != icon.left(dirLen)) { + if (!icon.isEmpty() && file.leftRef(dirLen) != icon.leftRef(dirLen)) { return nullptr; } QMovie *movie = new QMovie(file, QByteArray(), parent); @@ -1423,7 +1423,7 @@ group = KIconLoader::Desktop; } - QString file = name + ".mng"; + QString file = name + QStringLiteral(".mng"); if (group == KIconLoader::User) { file = d->locate(file); } else { @@ -1473,9 +1473,9 @@ group = KIconLoader::Desktop; } - QString file = name + "/0001"; + QString file = name + QStringLiteral("/0001"); if (group == KIconLoader::User) { - file = d->locate(file + ".png"); + file = d->locate(file + QStringLiteral(".png")); } else { if (size == 0) { size = d->mpGroups[group].size; @@ -1487,7 +1487,7 @@ } QString path = file.left(file.length() - 8); - QDir dir(QFile::encodeName(path)); + QDir dir(path); if (!dir.exists()) { return lst; } @@ -1533,7 +1533,7 @@ QStringList result; QStringList::ConstIterator it; for (it = lst.begin(); it != lst.end(); ++it) { - result += iconsDir + '/' + *it; + result += iconsDir + QLatin1Char('/') + *it; } return result; } @@ -1564,7 +1564,7 @@ QStringList res2, entries; QStringList::ConstIterator it; for (it = result.constBegin(); it != result.constEnd(); ++it) { - int n = (*it).lastIndexOf('/'); + int n = (*it).lastIndexOf(QLatin1Char('/')); if (n == -1) { name = *it; } else { @@ -1605,7 +1605,7 @@ QStringList res2, entries; QStringList::ConstIterator it; for (it = result.constBegin(); it != result.constEnd(); ++it) { - int n = (*it).lastIndexOf('/'); + int n = (*it).lastIndexOf(QLatin1Char('/')); if (n == -1) { name = *it; } else { diff --git a/src/kicontheme.cpp b/src/kicontheme.cpp --- a/src/kicontheme.cpp +++ b/src/kicontheme.cpp @@ -106,7 +106,7 @@ QStringList iconList() const; QString constructFileName(const QString &file) const { - return mBaseDir + mThemeDir + '/' + file; + return mBaseDir + mThemeDir + QLatin1Char('/') + file; } KIconLoader::Context context() const @@ -163,15 +163,15 @@ (name == defaultThemeName() || name == QLatin1String("hicolor") || name == QLatin1String("locolor"))) { const QStringList icnlibs = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); for (QStringList::ConstIterator it = icnlibs.constBegin(); it != icnlibs.constEnd(); ++it) { - const QString cDir = *it + '/' + appName + "/icons/" + name + '/'; + const QString cDir = *it + QLatin1Char('/') + appName + QStringLiteral("/icons/") + name + QLatin1Char('/'); if (QFileInfo::exists(cDir)) { themeDirs += cDir; } } if (!basePathHint.isEmpty()) { // Checks for dir existing are done below - themeDirs += basePathHint + '/' + name + '/'; + themeDirs += basePathHint + QLatin1Char('/') + name + QLatin1Char('/'); } } @@ -189,17 +189,17 @@ QString fileName, mainSection; for (QStringList::ConstIterator it = icnlibs.constBegin(); it != icnlibs.constEnd(); ++it) { - const QString cDir = *it + '/' + name + '/'; + const QString cDir = *it + QLatin1Char('/') + name + QLatin1Char('/'); if (QDir(cDir).exists()) { themeDirs += cDir; if (d->mDir.isEmpty()) { - if (QFileInfo::exists(cDir + "index.theme")) { + if (QFileInfo::exists(cDir + QStringLiteral("index.theme"))) { d->mDir = cDir; - fileName = d->mDir + "index.theme"; + fileName = d->mDir + QStringLiteral("index.theme"); mainSection = QStringLiteral("Icon Theme"); - } else if (QFileInfo::exists(cDir + "index.desktop")) { + } else if (QFileInfo::exists(cDir + QStringLiteral("index.desktop"))) { d->mDir = cDir; - fileName = d->mDir + "index.desktop"; + fileName = d->mDir + QStringLiteral("index.desktop"); mainSection = QStringLiteral("KDE Icon Theme"); } } @@ -232,13 +232,13 @@ d->followsColorScheme = cfg.readEntry("FollowsColorScheme", false); d->example = cfg.readPathEntry("Example", QString()); d->screenshot = cfg.readPathEntry("ScreenShot", QString()); - d->mExtensions = cfg.readEntry("KDE-Extensions", QStringList{ ".png", ".svgz", ".svg", ".xpm" }); + d->mExtensions = cfg.readEntry("KDE-Extensions", QStringList{ QStringLiteral(".png"), QStringLiteral(".svgz"), QStringLiteral(".svg"), QStringLiteral(".xpm") }); const QStringList dirs = cfg.readPathEntry("Directories", QStringList()); for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) { KConfigGroup cg(d->sharedConfig, *it); for (QStringList::ConstIterator itDir = themeDirs.constBegin(); itDir != themeDirs.constEnd(); ++itDir) { - const QString currentDir(*itDir + *it + '/'); + const QString currentDir(*itDir + *it + QLatin1Char('/')); if (!addedDirs.contains(currentDir) && QDir(currentDir).exists()) { addedDirs.insert(currentDir); KIconThemeDir *dir = new KIconThemeDir(*itDir, *it, cg); @@ -262,8 +262,8 @@ KConfigGroup cg(d->sharedConfig, mainSection); for (int i = 0; i < groups.size(); ++i) { const QString group = groups.at(i); - d->mDefSize[i] = cg.readEntry(group + "Default", defDefSizes[i]); - d->mSizes[i] = cg.readEntry(group + "Sizes", QList()); + d->mDefSize[i] = cg.readEntry(group + QStringLiteral("Default"), defDefSizes[i]); + d->mSizes[i] = cg.readEntry(group + QStringLiteral("Sizes"), QList()); } } diff --git a/src/tools/kiconfinder/kiconfinder.cpp b/src/tools/kiconfinder/kiconfinder.cpp --- a/src/tools/kiconfinder/kiconfinder.cpp +++ b/src/tools/kiconfinder/kiconfinder.cpp @@ -29,7 +29,7 @@ { QGuiApplication app(argc, argv); app.setApplicationName(QStringLiteral("kiconfinder")); - app.setApplicationVersion(KICONTHEMES_VERSION_STRING); + app.setApplicationVersion(QStringLiteral(KICONTHEMES_VERSION_STRING)); QCommandLineParser parser; parser.setApplicationDescription(app.translate("main", "Finds an icon based on its name")); parser.addPositionalArgument(QStringLiteral("iconname"), app.translate("main", "The icon name to look for"));