]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/terminalsidebarpage.cpp
Revert the whole code regarding the discussed issue. Columns view still show the...
[dolphin.git] / src / terminalsidebarpage.cpp
index 25a92b380a050726df7356a4f6e1e46eb40fa3bd..ced80ab9567be712b618c0a04d1c6e859fa347b2 100644 (file)
@@ -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<KParts::ReadOnlyPart>(this)) : 0;
         if (part != 0) {
-            m_layout->addWidget(part->widget());
+            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->showShellInDir(url().path());
+        m_terminal->sendInput("cd " + KShell::quoteArg(url().path()) + '\n');
         m_terminal->sendInput("clear\n");
+        m_terminalWidget->setFocus();
     }
 
     SidebarPage::showEvent(event);