aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2016-12-16 13:25:35 -0500
committerKen Moore <ken@ixsystems.com>2016-12-16 13:25:35 -0500
commit1608c2880af681b9f4df9681c4482324a62c8e4b (patch)
treedc3a57a3da021cbede4dcf71f3fe09651e4096bb /src-qt5/core
parentIf xinput is not available, do not show the input device configuration page. (diff)
parentHide the small menu popup during the lumina-fm init routine. (diff)
downloadlumina-1608c2880af681b9f4df9681c4482324a62c8e4b.tar.gz
lumina-1608c2880af681b9f4df9681c4482324a62c8e4b.tar.bz2
lumina-1608c2880af681b9f4df9681c4482324a62c8e4b.zip
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp15
-rw-r--r--src-qt5/core/lumina-open/main.cpp1
2 files changed, 12 insertions, 4 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp
index d6342269..b01eaccb 100644
--- a/src-qt5/core/libLumina/LuminaXDG.cpp
+++ b/src-qt5/core/libLumina/LuminaXDG.cpp
@@ -868,16 +868,18 @@ QIcon LXDG::findMimeIcon(QString extension){
QString LXDG::findAppMimeForFile(QString filename, bool multiple){
QString out;
- QString extension = filename.section(".",-1);
+ QString extension = filename.section(".",1,-1);
if("."+extension == filename){ extension.clear(); } //hidden file without extension
//qDebug() << "MIME SEARCH:" << filename << extension;
QStringList mimefull = LXDG::loadMimeFileGlobs2();
QStringList mimes;
- //Just in case the extension/filename is a mimetype itself
+ //Just in case the filename is a mimetype itself
if( mimefull.filter(":"+filename+":").length() == 1){
return filename;
}
- else if(mimefull.filter(":"+extension+":").length() == 1){
+while(mimes.isEmpty()){
+ //Check for an exact mimetype match
+ if(mimefull.filter(":"+extension+":").length() == 1){
return extension;
}
//Look for globs at the end of the filename
@@ -898,7 +900,12 @@ QString LXDG::findAppMimeForFile(QString filename, bool multiple){
for(int i=0; i<mimes.length(); i++){
if(!filename.startsWith( mimes[i].section(":",3,50,QString::SectionSkipEmpty).section("*",0,0), Qt::CaseInsensitive )){ mimes.removeAt(i); i--; }
}
- }
+ }
+ if(mimes.isEmpty()){
+ if(extension.contains(".")){ extension = extension.section(".",1,-1); }
+ else{ break; }
+ }
+ } //end of mimes while loop
mimes.sort(); //this automatically puts them in weight order (100 on down)
QStringList matches;
//qDebug() << "Mimes:" << mimes;
diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp
index 279f7c1b..d0bf79c0 100644
--- a/src-qt5/core/lumina-open/main.cpp
+++ b/src-qt5/core/lumina-open/main.cpp
@@ -333,6 +333,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
}else{
//No field codes (or improper field codes given in the file - which is quite common)
// - Just tack the input file on the end and let the app handle it as necessary
+ inFile.replace("%20"," "); //assume a local-file format rather than URL format
cmd.append(" \""+inFile+"\"");
}
}
bgstack15