From: Peter Penz Date: Sun, 16 Dec 2007 11:28:52 +0000 (+0000) Subject: fixes for the terminal panel: X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/3d2593f4234542c6fdbcdd76199f75aeda908626?ds=inline fixes for the terminal panel: * assure that the correct directory is entered when reopening the terminal * let the terminal be focused also when reopening it BUG: 153785 BUG: 153756 svn path=/trunk/KDE/kdebase/apps/; revision=749039 --- diff --git a/src/terminalsidebarpage.cpp b/src/terminalsidebarpage.cpp index 25a92b380..ced80ab95 100644 --- a/src/terminalsidebarpage.cpp +++ b/src/terminalsidebarpage.cpp @@ -30,7 +30,8 @@ TerminalSidebarPage::TerminalSidebarPage(QWidget* parent) : SidebarPage(parent), m_layout(0), - m_terminal(0) + m_terminal(0), + m_terminalWidget(0) { m_layout = new QVBoxLayout(this); m_layout->setMargin(0); @@ -68,13 +69,16 @@ void TerminalSidebarPage::showEvent(QShowEvent* event) KPluginFactory* factory = KPluginLoader("libkonsolepart").factory(); KParts::ReadOnlyPart* part = factory ? (factory->create(this)) : 0; if (part != 0) { - m_layout->addWidget(part->widget()); + m_terminalWidget = part->widget(); + m_layout->addWidget(m_terminalWidget); m_terminal = qobject_cast(part); + m_terminal->showShellInDir(url().path()); } } if (m_terminal != 0) { - m_terminal->showShellInDir(url().path()); + m_terminal->sendInput("cd " + KShell::quoteArg(url().path()) + '\n'); m_terminal->sendInput("clear\n"); + m_terminalWidget->setFocus(); } SidebarPage::showEvent(event); diff --git a/src/terminalsidebarpage.h b/src/terminalsidebarpage.h index 6cee2392e..5a4d40bdb 100644 --- a/src/terminalsidebarpage.h +++ b/src/terminalsidebarpage.h @@ -24,6 +24,7 @@ class TerminalInterface; class QVBoxLayout; +class QWidget; /** * @brief Shows the terminal which is synchronized with the URL of the @@ -51,6 +52,7 @@ protected: private: QVBoxLayout* m_layout; TerminalInterface* m_terminal; + QWidget* m_terminalWidget; }; #endif // TERMINALSIDEBARPAGE_H