Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/icons/icons.cpp
Show First 20 Lines • Show All 298 Lines • ▼ Show 20 Line(s) | 285 | return { | |||
---|---|---|---|---|---|
299 | {Icon::SystemRun, QStringLiteral("media-playback-start")}, | 299 | {Icon::SystemRun, QStringLiteral("media-playback-start")}, | ||
300 | {Icon::TaskAttention, QStringLiteral("dialog-warning")} | 300 | {Icon::TaskAttention, QStringLiteral("dialog-warning")} | ||
301 | }; | 301 | }; | ||
302 | } | 302 | } | ||
303 | 303 | | |||
304 | KMM_ICONS_EXPORT void setIconThemeNames(const QString &_themeName) | 304 | KMM_ICONS_EXPORT void setIconThemeNames(const QString &_themeName) | ||
305 | { | 305 | { | ||
306 | sStandardIcons = getCommonNames(); | 306 | sStandardIcons = getCommonNames(); | ||
307 | auto isWindows = false; | ||||
308 | | ||||
309 | #ifdef Q_OS_WIN | ||||
habacker: QT apps provides Q_OS_WIN for that | |||||
I would use Q_OS_WIN, but I see no advantage in doing that now, because it gives me nothing and requires testing on my part. Anyhow, it's good to know for future. wojnilowicz: I would use Q_OS_WIN, but I see no advantage in doing that now, because it gives me nothing and… | |||||
310 | isWindows = true; | ||||
311 | #endif | ||||
307 | 312 | | |||
308 | QStringList kdeThemes {QStringLiteral("oxygen"), QStringLiteral("breeze"), QStringLiteral("breeze-dark")}; | 313 | QStringList kdeThemes {QStringLiteral("oxygen"), QStringLiteral("breeze"), QStringLiteral("breeze-dark")}; | ||
309 | QHash<Icon, QString> iconNames; | 314 | QHash<Icon, QString> iconNames; | ||
310 | 315 | | |||
311 | if (kdeThemes.contains(_themeName)) { | 316 | if (kdeThemes.contains(_themeName) || isWindows) { // on Craft build system there is breeze icon theme, but it's in no way discoverable | ||
312 | iconNames = getKDENames(); | 317 | iconNames = getKDENames(); | ||
313 | for (auto it = iconNames.cbegin(); it != iconNames.cend(); ++it) | 318 | for (auto it = iconNames.cbegin(); it != iconNames.cend(); ++it) | ||
314 | sStandardIcons.insert(it.key(), it.value()); | 319 | sStandardIcons.insert(it.key(), it.value()); | ||
315 | } | 320 | } | ||
316 | 321 | | |||
317 | // get icon replacements for specific theme | 322 | // get icon replacements for specific theme | ||
318 | if (_themeName == kdeThemes.at(0)) | 323 | if (_themeName == kdeThemes.at(0)) | ||
319 | iconNames = getOxygenNames(); | 324 | iconNames = getOxygenNames(); | ||
320 | else if (_themeName == kdeThemes.at(1) || _themeName == kdeThemes.at(2)) | 325 | else if (_themeName == kdeThemes.at(1) || _themeName == kdeThemes.at(2) || isWindows) | ||
321 | iconNames = getBreezeNames(); | 326 | iconNames = getBreezeNames(); | ||
322 | else if (_themeName == QLatin1String("Tango")) | 327 | else if (_themeName == QLatin1String("Tango")) | ||
323 | iconNames = getTangoNames(); | 328 | iconNames = getTangoNames(); | ||
324 | else | 329 | else | ||
325 | return; | 330 | return; | ||
326 | 331 | | |||
327 | for (auto it = iconNames.cbegin(); it != iconNames.cend(); ++it) | 332 | for (auto it = iconNames.cbegin(); it != iconNames.cend(); ++it) | ||
328 | sStandardIcons.insert(it.key(), it.value()); | 333 | sStandardIcons.insert(it.key(), it.value()); | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |
QT apps provides Q_OS_WIN for that