diff options
author | Ken Moore <moorekou@gmail.com> | 2015-08-19 09:24:50 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-08-19 09:24:50 -0400 |
commit | 462795dbaa135f92c72bb7a37e7a4f9f4f1e1b94 (patch) | |
tree | 2be7c708565b51987762d31d74a2ce044d7a80cc | |
parent | Update the overall lumina project file to support multi-thread builds properly (diff) | |
download | lumina-462795dbaa135f92c72bb7a37e7a4f9f4f1e1b94.tar.gz lumina-462795dbaa135f92c72bb7a37e7a4f9f4f1e1b94.tar.bz2 lumina-462795dbaa135f92c72bb7a37e7a4f9f4f1e1b94.zip |
Add the XDG_DATA_* path support for relative application paths given in the mime database.
-rw-r--r-- | libLumina/LuminaXDG.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp index d71edf60..473d8620 100644 --- a/libLumina/LuminaXDG.cpp +++ b/libLumina/LuminaXDG.cpp @@ -709,6 +709,19 @@ QString LXDG::findDefaultAppForMime(QString mime){ } //Now check for relative paths to file (in current priority-ordered work dir) else if( QFile::exists(workdir+"/"+white[w]) ){ cdefault=workdir+"/"+white[w]; break; } + //Now go through the XDG DATA dirs and see if the file is in there + else{ + QStringList xdirs; + xdirs << QString(getenv("XDG_DATA_HOME"))+"/applications/"; + tmp = QString(getenv("XDG_DATA_DIRS")).split(":"); + for(int t=0; t<tmp.length(); t++){ dirs << tmp[t]+"/applications/"; } + //Now scan these dirs + bool found = false; + for(int x=0; x<xdirs.length() && !found; x++){ + if(QFile::exists(xdirs[x]+white[w])){cdefault=xdirs[x]+white[w]; found = true; } + } + if(found){ break; } + } } /* WRITTEN BUT UNUSED CODE FOR MIMETYPE ASSOCIATIONS //Skip using this because it is simply an alternate/unsupported standard that conflicts with |