aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LuminaXDG.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-04-13 12:17:02 +0000
committerWeblate <noreply@weblate.org>2017-04-13 12:17:02 +0000
commit724c696b78bace3d5538ebc1b69d9b683fda4b3e (patch)
treeabd5ddb07c292ed2e2ed0393d690c4a49becbce6 /src-qt5/core/libLumina/LuminaXDG.cpp
parentTranslated using Weblate (lumina_CONFIG@sv (generated)) (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-724c696b78bace3d5538ebc1b69d9b683fda4b3e.tar.gz
lumina-724c696b78bace3d5538ebc1b69d9b683fda4b3e.tar.bz2
lumina-724c696b78bace3d5538ebc1b69d9b683fda4b3e.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/libLumina/LuminaXDG.cpp')
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp
index 3694916b..db1f5a97 100644
--- a/src-qt5/core/libLumina/LuminaXDG.cpp
+++ b/src-qt5/core/libLumina/LuminaXDG.cpp
@@ -780,11 +780,15 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){
}
//Now load all the dirs into the search paths
QStringList theme, oxy, fall;
+ QStringList themedeps = getIconThemeDepChain(cTheme, paths);
for(int i=0; i<paths.length(); i++){
theme << getChildIconDirs( paths[i]+cTheme);
+ for(int j=0; j<themedeps.length(); j++){ theme << getChildIconDirs(paths[i]+themedeps[j]); }
oxy << getChildIconDirs(paths[i]+"material-design-light"); //Lumina base icon set
fall << getChildIconDirs(paths[i]+"hicolor"); //XDG fallback (apps add to this)
}
+ //Now load all the icon theme dependencies in order (Theme1 -> Theme2 -> Theme3 -> Fallback)
+
//fall << LOS::AppPrefix()+"share/pixmaps"; //always use this as well as a final fallback
QDir::setSearchPaths("icontheme", theme);
QDir::setSearchPaths("material-design-light", oxy);
@@ -884,6 +888,23 @@ QStringList LXDG::getChildIconDirs(QString parent){
return out;
}
+QStringList LXDG::getIconThemeDepChain(QString theme, QStringList paths){
+ QStringList results;
+ for(int i=0; i<paths.length(); i++){
+ if( QFile::exists(paths[i]+theme+"/index.theme") ){
+ QStringList deps = LUtils::readFile(paths[i]+theme+"/index.theme").filter("Inherits=");
+ if(!deps.isEmpty()){
+ deps = deps.first().section("=",1,-1).split(";",QString::SkipEmptyParts);
+ for(int j=0; j<deps.length(); j++){
+ results << deps[j] << getIconThemeDepChain(deps[j],paths);
+ }
+ }
+ break; //found primary theme index file - stop here
+ }
+ }
+ return results;;
+}
+
QStringList LXDG::systemMimeDirs(){
//Returns a list of all the directories where *.xml MIME files can be found
QStringList appDirs = QString(getenv("XDG_DATA_HOME")).split(":");
bgstack15