X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fuisupport%2Ficon.cpp;h=2a9174390066d270618aed4d128de3a2607faa5a;hb=c0d6dc0dec628f2e143e37ecc95cec45e636f8a5;hp=9a6a52887b6a66f3404fac7bee9f812bc4525450;hpb=b7447afe8e836376776dac26704e227a678d2913;p=quassel.git diff --git a/src/uisupport/icon.cpp b/src/uisupport/icon.cpp index 9a6a5288..2a917439 100644 --- a/src/uisupport/icon.cpp +++ b/src/uisupport/icon.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -28,7 +28,7 @@ namespace icon { namespace { -void printWarning(const QString &iconName, const QString &extra = {}) +void printWarning(const QString& iconName, const QString& extra = {}) { static std::set warnedAbout; if (warnedAbout.insert(iconName).second) { @@ -36,25 +36,23 @@ void printWarning(const QString &iconName, const QString &extra = {}) } } -} - +} // namespace -QIcon get(const QString &iconName, const QString &fallbackPath) +QIcon get(const QString& iconName, const QString& fallbackPath) { return get(std::vector{iconName}, fallbackPath); } - -QIcon get(const std::vector &iconNames, const QString &fallbackPath) +QIcon get(const std::vector& iconNames, const QString& fallbackPath) { - for (auto &&iconName : iconNames) { + for (auto&& iconName : iconNames) { // Exact match if (QIcon::hasThemeIcon(iconName)) { return QIcon::fromTheme(iconName); } } - for (auto &&iconName : iconNames) { + for (auto&& iconName : iconNames) { // Try to get something from the theme anyway (i.e. a more generic fallback) QIcon fallback = QIcon::fromTheme(iconName); if (!fallback.availableSizes().isEmpty()) { @@ -65,7 +63,7 @@ QIcon get(const std::vector &iconNames, const QString &fallbackPath) // Build error string QStringList requested; - for (auto &&iconName : iconNames) { + for (auto&& iconName : iconNames) { requested << iconName; } QString missing = "{" + requested.join(", ") + "}"; @@ -84,4 +82,4 @@ QIcon get(const std::vector &iconNames, const QString &fallbackPath) return {}; } -} +} // namespace icon