Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/core/iconimageprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ IconImageProvider::requestPixmap(const QString& id, QSize* size, const QSize& re
QString iconName;
QString fallbackName;
QString path;
auto fallbackPaths = QIcon::fallbackSearchPaths();

auto splitIdx = id.indexOf("?path=");
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;
fallbackPaths.prepend(path);
QIcon::setFallbackSearchPaths(fallbackPaths);
} else {
splitIdx = id.indexOf("?fallback=");
if (splitIdx != -1) {
Expand All @@ -43,6 +44,11 @@ IconImageProvider::requestPixmap(const QString& id, QSize* size, const QSize& re
pixmap = IconImageProvider::missingPixmap(targetSize);
}

if (!path.isEmpty()) {
fallbackPaths.removeFirst();
QIcon::setFallbackSearchPaths(fallbackPaths);
}

if (size != nullptr) *size = pixmap.size();
return pixmap;
}
Expand Down