aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-open/main.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-08-17 15:01:45 -0400
committerKen Moore <moorekou@gmail.com>2016-08-17 15:01:45 -0400
commitca2af75002ff5e88aebe8026e915e71d6a17c498 (patch)
tree0f88d0ab67bbac1760e8bc3fd79935ca115507be /src-qt5/core/lumina-open/main.cpp
parentMerge pull request #247 from Nanolx/master (diff)
downloadlumina-ca2af75002ff5e88aebe8026e915e71d6a17c498.tar.gz
lumina-ca2af75002ff5e88aebe8026e915e71d6a17c498.tar.bz2
lumina-ca2af75002ff5e88aebe8026e915e71d6a17c498.zip
A couple quick fixes:
1) Ensure that lumina-open is used to open the default terminal app (additional binary verification/checking) 2) Add some additional verification of the binary to run within lumina-open, and warn the user about a missing binary as needed.
Diffstat (limited to 'src-qt5/core/lumina-open/main.cpp')
-rw-r--r--src-qt5/core/lumina-open/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp
index 62a14f4c..b5f0d97f 100644
--- a/src-qt5/core/lumina-open/main.cpp
+++ b/src-qt5/core/lumina-open/main.cpp
@@ -347,6 +347,12 @@ int main(int argc, char **argv){
//qDebug() << "Run CMD:" << cmd << args;
//Now run the command (move to execvp() later?)
if(cmd.isEmpty()){ return 0; } //no command to run (handled internally)
+ QString bin = cmd.section(" ",0,0);
+ if( !LUtils::isValidBinary(bin) ){
+ //invalid binary for some reason - open a dialog to warn the user instead
+ QMessageBox::warning(0, QObject::tr("Binary Missing"), QString(QObject::tr("Could not find \"%1\". Please ensure it is installed first.")).arg(bin)+"\n\n"+cmd);
+ return 1;
+ }
qDebug() << "[lumina-open] Running Cmd:" << cmd;
int retcode = 0;
//Provide an override file for never watching running processes.
bgstack15