diff options
Diffstat (limited to 'lumina-open')
-rw-r--r-- | lumina-open/LFileDialog.cpp | 1 | ||||
-rw-r--r-- | lumina-open/main.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lumina-open/LFileDialog.cpp b/lumina-open/LFileDialog.cpp index 234a48b7..c0417935 100644 --- a/lumina-open/LFileDialog.cpp +++ b/lumina-open/LFileDialog.cpp @@ -57,6 +57,7 @@ QString LFileDialog::getDefaultApp(QString extension){ void LFileDialog::setDefaultApp(QString extension, QString appFile){ if(extension.contains("/")){ //mime type default: set on the system itself + if(appFile.endsWith(".desktop")){ appFile = appFile.section("/",-1); } //only need the relative path LXDG::setDefaultAppForMime(extension, appFile); }else{ QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina"); diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp index dcec7269..a323e075 100644 --- a/lumina-open/main.cpp +++ b/lumina-open/main.cpp @@ -240,7 +240,8 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat 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 = "x-scheme-handler/"+inFile.section("://",0,0); } //webbrowser"; } + else if(isUrl && inFile.contains("://") ){ extension = "x-scheme-handler/"+inFile.section("://",0,0); } + else if(isUrl && inFile.startsWith("www.")){ extension = "x-scheme-handler/http"; inFile.prepend("http://"); } //this catches partial (but still valid) URL's ("www.<something>" for instance) //qDebug() << "Input:" << inFile << isFile << isUrl << extension; //if not an application - find the right application to open the file QString cmd; |