diff options
author | Ken Moore <moorekou@gmail.com> | 2016-03-11 11:09:51 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-03-11 11:09:51 -0500 |
commit | cdc5e2e146ac7bbe68731b3090225fc84e3a1b5d (patch) | |
tree | 6050ba0e59a072216b5177c14d0e51d08e27530c /lumina-open/main.cpp | |
parent | Clean up some random gnome icon paths in the lumina-fileinfo mainUI.ui file. (diff) | |
download | lumina-cdc5e2e146ac7bbe68731b3090225fc84e3a1b5d.tar.gz lumina-cdc5e2e146ac7bbe68731b3090225fc84e3a1b5d.tar.bz2 lumina-cdc5e2e146ac7bbe68731b3090225fc84e3a1b5d.zip |
Significant update to mime-type handling.
1) Register/use the "inode/directory" mimetype for the default file manager.
2) Register/use the "x-scheme-handler/http[s]" mimetypes for the default web browser
Note: Still have not found valid mimetypes for the default terminal/email apps yet - so those still use the alternate lumina settings.
Diffstat (limited to 'lumina-open/main.cpp')
-rw-r--r-- | lumina-open/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp index 8f98e342..dcec7269 100644 --- a/lumina-open/main.cpp +++ b/lumina-open/main.cpp @@ -105,7 +105,7 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS else if(i+1==matches.length()){ extension = matches[0]; } } }else{ defApp = LFileDialog::getDefaultApp(extension); } - + //qDebug() << "extension:" << extension << "defApp:" << defApp; if( !defApp.isEmpty() && !showDLG ){ bool ok = false; if(defApp.endsWith(".desktop")){ @@ -129,7 +129,7 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS LFileDialog::setDefaultApp(extension, ""); } //Final catch: directory given - no valid default found - use lumina-fm - if(extension=="directory" && !showDLG){ return "lumina-fm"; } + if(extension=="inode/directory" && !showDLG){ return "lumina-fm"; } //No default set -- Start up the application selection dialog LTHEME::LoadCustomEnvSettings(); QApplication App(argc, argv); @@ -137,7 +137,7 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS LUtils::LoadTranslation(&App,"lumina-open"); LFileDialog w; - if(extension=="email" || extension=="webbrowser"){ + if(extension=="email" || extension.startsWith("x-scheme-handler/")){ //URL w.setFileInfo(inFile, extension, false); }else{ @@ -235,12 +235,12 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat QFileInfo info(inFile); extension=info.suffix(); //qDebug() << " - Extension:" << extension; - if(info.isDir()){ extension="directory"; } + if(info.isDir()){ extension="inode/directory"; } else if(info.isExecutable() && extension.isEmpty()){ extension="binary"; } else if(extension!="desktop"){ extension="mimetype"; } //flag to check for mimetype default based on file } else if(isUrl && inFile.startsWith("mailto:")){ extension = "email"; } - else if(isUrl){ extension = "webbrowser"; } + else if(isUrl){ extension = "x-scheme-handler/"+inFile.section("://",0,0); } //webbrowser"; } //qDebug() << "Input:" << inFile << isFile << isUrl << extension; //if not an application - find the right application to open the file QString cmd; |