aboutsummaryrefslogtreecommitdiff
path: root/lumina-fm/MainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-05-01 14:20:39 -0400
committerKen Moore <ken@pcbsd.org>2015-05-01 14:20:39 -0400
commitfe772f81fd3990c395dc48f23e7e1d700890b281 (patch)
treec2e603b0c470c6363ca5d0c163982581f8f4c18c /lumina-fm/MainUI.cpp
parentMerge pull request #104 from william-os4y/fileinfo (diff)
downloadlumina-fe772f81fd3990c395dc48f23e7e1d700890b281.tar.gz
lumina-fe772f81fd3990c395dc48f23e7e1d700890b281.tar.bz2
lumina-fe772f81fd3990c395dc48f23e7e1d700890b281.zip
Add some additional error checking to the new "Open Terminal Here" functionality in lumina-fm.
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r--lumina-fm/MainUI.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index 3cc66d97..68764997 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -1438,6 +1438,17 @@ void MainUI::openTerminal(){
QSettings *sessionsettings = new QSettings( QSettings::UserScope, "LuminaDE","sessionsettings", this);
//xterm remains the default
QString defTerminal = sessionsettings->value("default-terminal", "xterm").toString();
+ if(defTerminal.endsWith(".desktop")){
+ //Pull the binary name out of the shortcut
+ bool ok = false;
+ XDGDesktop DF = LXDG::loadDesktopFile(defTerminal,ok);
+ if(!ok){ defTerminal = "xterm"; }
+ else{ defTerminal = DF.exec.section(" ",0,0); } //only take the binary name - not any other flags
+ }
+ if( !LUtils::isValidBinary(defTerminal) ){
+ //The binary does not exist or is invalid
+ defTerminal = "xterm";
+ }
if(sel.isEmpty()){
//-e is the parameter for most of the terminal appliction to execute an external command.
//In your case we start a shell in the selected directory
bgstack15