diff options
author | Ken Moore <ken@pcbsd.org> | 2015-05-01 14:20:39 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-05-01 14:20:39 -0400 |
commit | fe772f81fd3990c395dc48f23e7e1d700890b281 (patch) | |
tree | c2e603b0c470c6363ca5d0c163982581f8f4c18c /lumina-fm | |
parent | Merge pull request #104 from william-os4y/fileinfo (diff) | |
download | lumina-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')
-rw-r--r-- | lumina-fm/MainUI.cpp | 11 |
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 |