diff options
author | Ken Moore <ken@ixsystems.com> | 2017-08-03 14:03:29 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-08-03 14:04:05 -0400 |
commit | 4530400268bf9a8749513e69a7bfb574fca20f09 (patch) | |
tree | 7e0e4cd58253f896d6371d7adad04c5a5809deb8 /src-qt5/core/libLumina/LIconCache.cpp | |
parent | Get the icon loading routines all switched over to the old QIcon::fromTheme()... (diff) | |
download | lumina-4530400268bf9a8749513e69a7bfb574fca20f09.tar.gz lumina-4530400268bf9a8749513e69a7bfb574fca20f09.tar.bz2 lumina-4530400268bf9a8749513e69a7bfb574fca20f09.zip |
Cleanup some fallback routines for loading icons from the Qt theme methods.
Diffstat (limited to 'src-qt5/core/libLumina/LIconCache.cpp')
-rw-r--r-- | src-qt5/core/libLumina/LIconCache.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src-qt5/core/libLumina/LIconCache.cpp b/src-qt5/core/libLumina/LIconCache.cpp index 9d122df7..bb81bc47 100644 --- a/src-qt5/core/libLumina/LIconCache.cpp +++ b/src-qt5/core/libLumina/LIconCache.cpp @@ -55,9 +55,9 @@ QString LIconCache::findFile(QString icon){ if(icon.isEmpty()){ return ""; } //Get the currently-set theme QString cTheme = QIcon::themeName(); - if(cTheme.isEmpty()){ - QIcon::setThemeName("material-design-light"); - cTheme = "material-design-light"; + if(cTheme.isEmpty()){ + QIcon::setThemeName("material-design-light"); + cTheme = "material-design-light"; } //Make sure the current search paths correspond to this theme if( QDir::searchPaths("icontheme").filter("/"+cTheme+"/").isEmpty() ){ @@ -309,7 +309,12 @@ bool LIconCache::isThemeIcon(QString id){ } QIcon LIconCache::iconFromTheme(QString id){ - return QIcon::fromTheme(id); + QIcon ico = QIcon::fromTheme(id); + if(ico.isNull()){ + //icon missing in theme? run the old icon-finder system + ico = QIcon(findFile(id)); + } + return ico; } // === PRIVATE SLOTS === |