aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp
index 1991a82d..b4954a26 100644
--- a/src-qt5/core/libLumina/LuminaXDG.cpp
+++ b/src-qt5/core/libLumina/LuminaXDG.cpp
@@ -237,8 +237,9 @@ QString XDGDesktop::generateExec(QStringList inputfiles, QString ActionID){
//Does the app need the input files in URL or File syntax?
bool URLsyntax = (exec.contains("%u") || exec.contains("%U"));
//Adjust the input file formats as needed
+ //qDebug() << "Got inputfiles:" << inputfiles << URLsyntax;
for(int i=0; i<inputfiles.length(); i++){
- bool url = inputfiles[i].contains("://") || inputfiles[i].startsWith("www") || QUrl(inputfiles[i]).isValid();
+ bool url = inputfiles[i].startsWith("www") || inputfiles[i].contains("://");
//Run it through the QUrl class to catch/fix any URL syntax issues
if(URLsyntax){
if(inputfiles[i].startsWith("mailto:") ){} //don't touch this syntax - already formatted
@@ -246,11 +247,14 @@ QString XDGDesktop::generateExec(QStringList inputfiles, QString ActionID){
else{ inputfiles[i] = QUrl::fromLocalFile(inputfiles[i]).url(); }
}else{
//if(inputfiles[i].startsWith("mailto:") ){} //don't touch this syntax - already formatted
+ //qDebug() << "Need local format:" << inputfiles[i] << url;
if(url){ inputfiles[i] = QUrl(inputfiles[i]).toLocalFile(); }
- else{ inputfiles[i] = QUrl::fromLocalFile(inputfiles[i]).toLocalFile(); }
+ else{ inputfiles[i] = inputfiles[i]; } //QUrl::fromLocalFile(inputfiles[i]).toLocalFile(); }
}
}
+ inputfiles.removeAll(""); //just in case any empty ones get through
//Now to the exec replacements as needed
+ //qDebug() << "Generate Exec:" << exec << inputfiles;
if(exec.contains("%f")){
if(inputfiles.isEmpty()){ exec.replace("%f",""); }
else{ exec.replace("%f", "\""+inputfiles.first()+"\""); } //Note: can only take one input
bgstack15