From c8423a40ef7a92eaa95c3e1674a24f16edf4bdf0 Mon Sep 17 00:00:00 2001 From: cameron Date: Mon, 18 Aug 2025 16:19:51 +1000 Subject: [PATCH] core: add searching custom file paths core: remove filetype checking as qt will do this for us --- src/core/iconimageprovider.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/iconimageprovider.cpp b/src/core/iconimageprovider.cpp index 43e00fd8..1dbe3e76 100644 --- a/src/core/iconimageprovider.cpp +++ b/src/core/iconimageprovider.cpp @@ -19,8 +19,7 @@ IconImageProvider::requestPixmap(const QString& id, QSize* size, const QSize& re if (splitIdx != -1) { iconName = id.sliced(0, splitIdx); path = id.sliced(splitIdx + 6); - qWarning() << "Searching custom icon paths is not yet supported. Icon path will be ignored for" - << id; + path = QString("/%1/%2").arg(path, iconName.sliced(iconName.lastIndexOf('/') + 1)); } else { splitIdx = id.indexOf("?fallback="); if (splitIdx != -1) { @@ -32,7 +31,8 @@ IconImageProvider::requestPixmap(const QString& id, QSize* size, const QSize& re } auto icon = QIcon::fromTheme(iconName); - if (icon.isNull()) icon = QIcon::fromTheme(fallbackName); + if (icon.isNull() && !fallbackName.isEmpty()) icon = QIcon::fromTheme(fallbackName); + if (icon.isNull() && !path.isEmpty()) icon = QPixmap(path); auto targetSize = requestedSize.isValid() ? requestedSize : QSize(100, 100); if (targetSize.width() == 0 || targetSize.height() == 0) targetSize = QSize(2, 2);