From ca2af75002ff5e88aebe8026e915e71d6a17c498 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 17 Aug 2016 15:01:45 -0400 Subject: 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. --- src-qt5/core/lumina-desktop/LDesktop.cpp | 5 ++--- src-qt5/core/lumina-open/main.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src-qt5/core') diff --git a/src-qt5/core/lumina-desktop/LDesktop.cpp b/src-qt5/core/lumina-desktop/LDesktop.cpp index 0dd28f11..cf1fe25f 100644 --- a/src-qt5/core/lumina-desktop/LDesktop.cpp +++ b/src-qt5/core/lumina-desktop/LDesktop.cpp @@ -102,9 +102,8 @@ void LDesktop::SystemLogout(){ void LDesktop::SystemTerminal(){ LSession::handle()->sessionSettings()->sync(); //make sure it is up to date QString term = LXDG::findDefaultAppForMime("application/terminal"); //LSession::handle()->sessionSettings()->value("default-terminal","xterm").toString(); - if(term.endsWith(".desktop")){ term = "lumina-open \""+term+"\""; } - else if(term.isEmpty() || !LUtils::isValidBinary(term)){ term = "xterm"; } - LSession::LaunchApplication(term); + if(term.isEmpty() || !LUtils::isValidBinary(term)){ term = "xterm"; } + LSession::LaunchApplication("lumina-open \""+term+"\""); } void LDesktop::SystemFileManager(){ 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. -- cgit