From 496cf68b3c894d596c29ced3350763e66477d835 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 17 Sep 2015 08:55:09 -0400 Subject: Update lumina-fm to use the new LUtils::GenerateOpenTerminalExec() function for opening a terminal in a directory. --- lumina-fm/MainUI.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lumina-fm') diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index 6a7f9b74..bdcbd75b 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -610,16 +610,14 @@ void MainUI::OpenImages(LFileInfoList list){ } void MainUI::OpenTerminal(QString dirpath){ - //QFileInfoList sel = getSelectedItems(); - QString shell; - //we get the shell has defined in the environment - if (getenv("SHELL")) shell = QString(getenv("SHELL")); - else shell = QString("/bin/sh"); - //we use the application defined as thate default terminal - QSettings *sessionsettings = new QSettings( QSettings::UserScope, "LuminaDE","sessionsettings", this); + //we use the application defined as the default terminal + QSettings sessionsettings( QSettings::UserScope, "LuminaDE","sessionsettings", this); //xterm remains the default - QString defTerminal = sessionsettings->value("default-terminal", "xterm").toString(); - if(defTerminal.endsWith(".desktop")){ + QString defTerminal = sessionsettings.value("default-terminal", "xterm").toString(); + qDebug() << "Found default terminal:" << defTerminal; + //Now get the exec string and run it + QString cmd = LUtils::GenerateOpenTerminalExec(defTerminal, dirpath); + /*if(defTerminal.endsWith(".desktop")){ //Pull the binary name out of the shortcut bool ok = false; XDGDesktop DF = LXDG::loadDesktopFile(defTerminal,ok); @@ -633,7 +631,9 @@ void MainUI::OpenTerminal(QString dirpath){ //-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 - QProcess::startDetached(defTerminal + " -e \"cd " + dirpath + " && " + shell + " \" "); + QProcess::startDetached(defTerminal + " -e \"cd " + dirpath + " && " + shell + " \" ");*/ + qDebug() << "Starting Terminal with command:" << cmd; + QProcess::startDetached(cmd); } -- cgit