diff options
| author | Rafael Fernández López <[email protected]> | 2007-12-19 01:35:09 +0000 |
|---|---|---|
| committer | Rafael Fernández López <[email protected]> | 2007-12-19 01:35:09 +0000 |
| commit | 73fbb1a3d1b32562ac9b217f7bf437b0366c49aa (patch) | |
| tree | e30db51ad20507714b2be7ed4472d72547710bf7 /src/terminalsidebarpage.cpp | |
| parent | 603681ba79d6fc313c8e3152249d63cdcbdb2c89 (diff) | |
Now the konsole part is autodestructed when no tabs do exist. This makes the desired effect on dolphin when typing "exit" on the terminal, the dock will be hidden.
BUG: 153648
svn path=/trunk/KDE/kdebase/apps/; revision=750276
Diffstat (limited to 'src/terminalsidebarpage.cpp')
| -rw-r--r-- | src/terminalsidebarpage.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/terminalsidebarpage.cpp b/src/terminalsidebarpage.cpp index ced80ab95..61cc5aef8 100644 --- a/src/terminalsidebarpage.cpp +++ b/src/terminalsidebarpage.cpp @@ -58,6 +58,26 @@ void TerminalSidebarPage::setUrl(const KUrl& url) } } +void TerminalSidebarPage::terminalExited() +{ + emit hideTerminalSidebarPage(); + + KPluginFactory* factory = KPluginLoader("libkonsolepart").factory(); + KParts::ReadOnlyPart* part = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0; + if (part != 0) { + connect(part, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited())); + m_terminalWidget = part->widget(); + m_layout->addWidget(m_terminalWidget); + m_terminal = qobject_cast<TerminalInterface *>(part); + m_terminal->showShellInDir(url().path()); + } + if (m_terminal != 0) { + m_terminal->sendInput("cd " + KShell::quoteArg(url().path()) + '\n'); + m_terminal->sendInput("clear\n"); + m_terminalWidget->setFocus(); + } +} + void TerminalSidebarPage::showEvent(QShowEvent* event) { if (event->spontaneous()) { @@ -69,6 +89,7 @@ void TerminalSidebarPage::showEvent(QShowEvent* event) KPluginFactory* factory = KPluginLoader("libkonsolepart").factory(); KParts::ReadOnlyPart* part = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0; if (part != 0) { + connect(part, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited())); m_terminalWidget = part->widget(); m_layout->addWidget(m_terminalWidget); m_terminal = qobject_cast<TerminalInterface *>(part); |
