diff options
author | Weblate <noreply@weblate.org> | 2017-08-07 15:58:22 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-08-07 15:58:22 +0000 |
commit | 1a320d85b86593fb7716eea493df39e339bbae77 (patch) | |
tree | 33a44e00ac33f4c0d558e40e173472cb7ada624f /src-qt5/core/libLumina/LuminaXDG.cpp | |
parent | Translated using Weblate (French) (diff) | |
parent | Translated using Weblate (Catalan) (diff) | |
download | lumina-1a320d85b86593fb7716eea493df39e339bbae77.tar.gz lumina-1a320d85b86593fb7716eea493df39e339bbae77.tar.bz2 lumina-1a320d85b86593fb7716eea493df39e339bbae77.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/libLumina/LuminaXDG.cpp')
-rw-r--r-- | src-qt5/core/libLumina/LuminaXDG.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index 8da39564..01b3305e 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -723,7 +723,7 @@ QList<XDGDesktop*> LXDG::sortDesktopNames(QList<XDGDesktop*> apps){ //Sort the list by name of the application QHash<QString, XDGDesktop*> sorter; for(int i=0; i<apps.length(); i++){ - sorter.insert(apps[i]->name.toLower(), apps[i]); + sorter.insert(apps[i]->name.toLower(), apps[i]); } QStringList keys = sorter.keys(); keys.sort(); @@ -746,16 +746,25 @@ void LXDG::setEnvironmentVars(){ } QIcon LXDG::findIcon(QString iconName, QString fallback){ + //With the addition of the Lumina theme engine (8/3/17), switch back to using the Qt icon from theme method for apps + QIcon tmp; + if(!iconName.contains("libreoffice")){ //libreoffice is stupid - their svg icons are un-renderable with Qt + tmp = QIcon::fromTheme(iconName); + if(tmp.isNull()){ tmp = QIcon::fromTheme(fallback); } + } + if(!tmp.isNull()){ return tmp; } //found one in the theme + + //NOTE: This was re-written on 11/10/15 to avoid using the QIcon::fromTheme() framework // -- Too many issues with SVG files and/or search paths with the built-in system - + //Check if the icon is an absolute path and exists bool DEBUG =false; if(DEBUG){ qDebug() << "[LXDG] Find icon for:" << iconName; } if(QFile::exists(iconName) && iconName.startsWith("/")){ return QIcon(iconName); } else if(iconName.startsWith("/")){ iconName.section("/",-1); } //Invalid absolute path, just look for the icon //Check if the icon is actually given - if(iconName.isEmpty()){ + if(iconName.isEmpty()){ if(fallback.isEmpty()){ return QIcon(); } else{ return LXDG::findIcon(fallback, ""); } } @@ -763,9 +772,9 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){ if(DEBUG){ qDebug() << "[LXDG] Start search for icon"; } //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() ){ |