diff options
-rw-r--r-- | libLumina/LuminaXDG.cpp | 7 | ||||
-rw-r--r-- | lumina-open/LFileDialog.cpp | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp index 9fa69cef..e4839480 100644 --- a/libLumina/LuminaXDG.cpp +++ b/libLumina/LuminaXDG.cpp @@ -255,10 +255,11 @@ QString LXDG::getDesktopExec(XDGDesktop app){ out = app.exec; } //Now perform any of the XDG flag substitutions as appropriate (9/2014 standards) - if(out.contains("%i")){ out.replace("%i", "--icon \'"+app.icon+"\'"); } + if(out.contains("%i") && !app.icon.isEmpty() ){ out.replace("%i", "--icon \'"+app.icon+"\'"); } if(out.contains("%c")){ - if(!app.name.isEmpty()){ out.replace("%c", ""+app.name+""); } - else if(!app.genericName.isEmpty()){ out.replace("%c", ""+app.genericName+""); } + if(!app.name.isEmpty()){ out.replace("%c", "\'"+app.name+"\'"); } + else if(!app.genericName.isEmpty()){ out.replace("%c", "\'"+app.genericName+"\'"); } + else{ out.replace("%c", "\'"+app.filePath.section("/",-1).section(".desktop",0,0)+"\'"); } } if(out.contains("%k")){ out.replace("%k", "\'"+app.filePath+"\'"); } return out; diff --git a/lumina-open/LFileDialog.cpp b/lumina-open/LFileDialog.cpp index d648925b..361cd99f 100644 --- a/lumina-open/LFileDialog.cpp +++ b/lumina-open/LFileDialog.cpp @@ -239,7 +239,7 @@ void LFileDialog::on_tool_ok_clicked(){ bool ok = false; XDGDesktop app = LXDG::loadDesktopFile(PREFAPPS[ui->combo_rec->currentIndex()], ok); //Set the output variables - appExec = app.exec; + appExec = LXDG::getDesktopExec(app); appPath = app.path; appFile = app.filePath; setPreferredApplication(app.filePath); //bump this to the top of the preferred list for next time @@ -248,7 +248,7 @@ void LFileDialog::on_tool_ok_clicked(){ bool ok = false; XDGDesktop app = LXDG::loadDesktopFile(ui->tree_apps->currentItem()->whatsThis(0), ok); //Set the output variables - appExec = app.exec; + appExec = LXDG::getDesktopExec(app); appPath = app.path; appFile = app.filePath; setPreferredApplication(app.filePath); //save this app to this extension as a recommendation |