]> cloud.milkyroute.net Git - dolphin.git/commitdiff
fixes for the terminal panel:
authorPeter Penz <peter.penz19@gmail.com>
Sun, 16 Dec 2007 11:28:52 +0000 (11:28 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 16 Dec 2007 11:28:52 +0000 (11:28 +0000)
* 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

src/terminalsidebarpage.cpp
src/terminalsidebarpage.h

index 25a92b380a050726df7356a4f6e1e46eb40fa3bd..ced80ab9567be712b618c0a04d1c6e859fa347b2 100644 (file)
@@ -30,7 +30,8 @@
 TerminalSidebarPage::TerminalSidebarPage(QWidget* parent) :
     SidebarPage(parent),
     m_layout(0),
 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);
 {
     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) {
         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 = qobject_cast<TerminalInterface *>(part);
+            m_terminal->showShellInDir(url().path());
         }
     }
     if (m_terminal != 0) {
         }
     }
     if (m_terminal != 0) {
-        m_terminal->showShellInDir(url().path());
+        m_terminal->sendInput("cd " + KShell::quoteArg(url().path()) + '\n');
         m_terminal->sendInput("clear\n");
         m_terminal->sendInput("clear\n");
+        m_terminalWidget->setFocus();
     }
 
     SidebarPage::showEvent(event);
     }
 
     SidebarPage::showEvent(event);
index 6cee2392effc4b0129aaf1265976a7595892cd6e..5a4d40bdb9cfe4aaf472c49fd038a3368a1854a9 100644 (file)
@@ -24,6 +24,7 @@
 
 class TerminalInterface;
 class QVBoxLayout;
 
 class TerminalInterface;
 class QVBoxLayout;
+class QWidget;
 
 /**
  * @brief Shows the terminal which is synchronized with the URL of the
 
 /**
  * @brief Shows the terminal which is synchronized with the URL of the
@@ -51,6 +52,7 @@ protected:
 private:
     QVBoxLayout* m_layout;
     TerminalInterface* m_terminal;
 private:
     QVBoxLayout* m_layout;
     TerminalInterface* m_terminal;
+    QWidget* m_terminalWidget;
 };
 
 #endif // TERMINALSIDEBARPAGE_H
 };
 
 #endif // TERMINALSIDEBARPAGE_H