From: Rahman Duran Date: Sun, 29 Mar 2009 11:54:40 +0000 (+0000) Subject: BUG: 164489 X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/53a9373a38e077f644a6a25597200667a805f401 BUG: 164489 Make Dolphin benefit from new TerminalInterfaceV2 functions. svn path=/trunk/KDE/kdebase/apps/; revision=946382 --- diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index 593015147..ae5e45f09 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -20,13 +20,15 @@ #include "terminalpanel.h" #include -#include +#include #include #include #include #include +#include + TerminalPanel::TerminalPanel(QWidget* parent) : Panel(parent), m_layout(0), @@ -55,9 +57,14 @@ void TerminalPanel::setUrl(const KUrl& url) } Panel::setUrl(url); - if ((m_terminal != 0) && isVisible() && url.isLocalFile()) { + const bool sendInput = (m_terminal != 0) + && (m_terminal->foregroundProcessId() == -1) + && isVisible() + && url.isLocalFile(); + if (sendInput) { m_terminal->sendInput("cd " + KShell::quoteArg(url.toLocalFile()) + '\n'); } + } void TerminalPanel::terminalExited() @@ -80,9 +87,10 @@ void TerminalPanel::showEvent(QShowEvent* event) connect(part, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited())); m_terminalWidget = part->widget(); m_layout->addWidget(m_terminalWidget); - m_terminal = qobject_cast(part); + m_terminal = qobject_cast(part); m_terminal->showShellInDir(url().path()); - } + + } } if (m_terminal != 0) { m_terminal->sendInput("cd " + KShell::quoteArg(url().path()) + '\n'); diff --git a/src/panels/terminal/terminalpanel.h b/src/panels/terminal/terminalpanel.h index 672938c32..4e060bbef 100644 --- a/src/panels/terminal/terminalpanel.h +++ b/src/panels/terminal/terminalpanel.h @@ -22,7 +22,7 @@ #include -class TerminalInterface; +class TerminalInterfaceV2; class QVBoxLayout; class QWidget; @@ -55,7 +55,7 @@ protected: private: QVBoxLayout* m_layout; - TerminalInterface* m_terminal; + TerminalInterfaceV2* m_terminal; QWidget* m_terminalWidget; };