aboutsummaryrefslogtreecommitdiff
path: root/lumina-open/main.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-03-11 11:09:51 -0500
committerKen Moore <moorekou@gmail.com>2016-03-11 11:09:51 -0500
commitcdc5e2e146ac7bbe68731b3090225fc84e3a1b5d (patch)
tree6050ba0e59a072216b5177c14d0e51d08e27530c /lumina-open/main.cpp
parentClean up some random gnome icon paths in the lumina-fileinfo mainUI.ui file. (diff)
downloadlumina-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.cpp10
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;
bgstack15