Changeset View
Changeset View
Standalone View
Standalone View
autotests/kiconloader_benchmark.cpp
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 92 | QBENCHMARK { | |||
---|---|---|---|---|---|
99 | } | 99 | } | ||
100 | } | 100 | } | ||
101 | } | 101 | } | ||
102 | 102 | | |||
103 | void benchmarkNonExistingIcon_notCached() | 103 | void benchmarkNonExistingIcon_notCached() | ||
104 | { | 104 | { | ||
105 | QBENCHMARK { | 105 | QBENCHMARK { | ||
106 | // Remove icon cache | 106 | // Remove icon cache | ||
107 | const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/icon-cache.kcache"; | 107 | const QString cacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/icon-cache.kcache"); | ||
108 | QFile::remove(cacheFile); | 108 | QFile::remove(cacheFile); | ||
109 | // Clear SHM cache | 109 | // Clear SHM cache | ||
110 | KIconLoader::global()->reconfigure(QString()); | 110 | KIconLoader::global()->reconfigure(QString()); | ||
111 | 111 | | |||
112 | QIcon icon(new KIconEngine(QStringLiteral("invalid-icon-name"), KIconLoader::global())); | 112 | QIcon icon(new KIconEngine(QStringLiteral("invalid-icon-name"), KIconLoader::global())); | ||
113 | QVERIFY(icon.isNull()); | 113 | QVERIFY(icon.isNull()); | ||
114 | QVERIFY2(icon.name().isEmpty(), qPrintable(icon.name())); | 114 | QVERIFY2(icon.name().isEmpty(), qPrintable(icon.name())); | ||
115 | QVERIFY(!icon.pixmap(QSize(16, 16), QIcon::Normal).isNull()); | 115 | QVERIFY(!icon.pixmap(QSize(16, 16), QIcon::Normal).isNull()); | ||
Show All 17 Lines |