Bug 436637 - KIconLoader does not respect QIcon::themeSearchPaths()
Summary: KIconLoader does not respect QIcon::themeSearchPaths()
Status: REPORTED
Alias: None
Product: frameworks-kiconthemes
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Christoph Feck
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-05 15:07 UTC by Nicolas Fella
Modified: 2022-06-12 18:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2021-05-05 15:07:33 UTC
STEPS TO REPRODUCE
1. Install some icons to e.g. /usr/share/foo/icons/hicolor/22x22/actions/bla.png
2. Call QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << "/usr/share/foo/icons/");
2. Use QIcon::fromTheme("bla") on Plasma

OBSERVED RESULT
foo is not found

EXPECTED RESULT
foo is found

Forcing the app to use another icon loader via QT_QPA_PLATFORMTHEME=gtk3 makes the icon work


SOFTWARE/OS VERSIONS
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 5.15-kde
Comment 1 Ahmad Samir 2022-06-12 18:52:51 UTC
Seems to work here; I test with qtcreator:

    QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << "/usr/share/yelp/icons");
    QIcon icon = QIcon::fromTheme("yelp-page-task");
    qDebug() << icon << QIcon::themeSearchPaths();

QIcon("yelp-page-task",availableSizes[normal,Off]=QList(QSize(16, 16)),cacheKey=0x100000000) QList("/home/ahmad/.icons", "/home/ahmad/.local/share/icons", "/usr/local/share/icons", "/usr/share/icons", ":/icons", "/usr/share/yelp/icons")