aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/lumina-open/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp
index 7011b2e1..7a7fef19 100644
--- a/src-qt5/core/lumina-open/main.cpp
+++ b/src-qt5/core/lumina-open/main.cpp
@@ -227,6 +227,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
//Now check what type of file this is
if(QFile::exists(inFile)){ isFile=true; }
else if(QFile::exists(QDir::currentPath()+"/"+inFile)){isFile=true; inFile = QDir::currentPath()+"/"+inFile;} //account for relative paths
+ else if(inFile.startsWith("mailto:")){ isUrl= true; }
else if(QUrl(inFile).isValid() && !inFile.startsWith("/") ){ isUrl=true; }
if( !isFile && !isUrl ){ ShowErrorDialog( argc, argv, QString(QObject::tr("Invalid file or URL: %1")).arg(inFile) ); }
//Determing the type of file (extension)
@@ -240,7 +241,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
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 && inFile.startsWith("mailto:")){ extension = "application/email"; }
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;
@@ -315,7 +316,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
cmd.replace("%F","\""+inFile+"\"");
}else if( (cmd.contains("%U") || cmd.contains("%u")) ){
//Apply any special field replacements for the desired format
- if(!inFile.contains("://")){ inFile.prepend("file://"); } //local file - add the extra flag
+ if(!inFile.contains("://") && !isUrl){ inFile.prepend("file://"); } //local file - add the extra flag
inFile.replace(" ", "%20");
//Now replace the field codes
cmd.replace("%u","\""+inFile+"\"");
bgstack15