From 462795dbaa135f92c72bb7a37e7a4f9f4f1e1b94 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 19 Aug 2015 09:24:50 -0400 Subject: Add the XDG_DATA_* path support for relative application paths given in the mime database. --- libLumina/LuminaXDG.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libLumina/LuminaXDG.cpp') 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