+ 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()) {
+ printWarning(iconName, QString{"(using fallback: \"%1\")"}.arg(fallback.name()));
+ return fallback;
+ }
+ }
+
+ // Build error string
+ QStringList requested;
+ for (auto &&iconName : iconNames) {
+ requested << iconName;
+ }
+ QString missing = "{" + requested.join(", ") + "}";
+
+ // Nothing from the theme, so try to load from path if given
+ if (!fallbackPath.isEmpty()) {
+ QIcon fallback{fallbackPath};
+ if (!fallback.availableSizes().isEmpty()) {
+ printWarning(missing, QString{"(using fallback: \"%1\")"}.arg(fallbackPath));
+ return fallback;
+ }
+ }
+
+ // Meh.
+ printWarning(missing);
+ return {};
+}