]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't let hidden terminals prevent unmounting
authorSebastian Dörner <sebastian@sebastian-doerner.de>
Wed, 25 May 2011 21:14:14 +0000 (22:14 +0100)
committerSebastian Dörner <sebastian@sebastian-doerner.de>
Wed, 25 May 2011 21:19:11 +0000 (22:19 +0100)
Previous state: When the terminal is hidden, the cwd is not updated
anymore. If it was on a removable device when hiding, the hidden
terminal might prevent unmounting this device.
This patch fixes that bug by changing the cwd to "/" when hiding the panel.

REVIEW: 101387
BUG: 158264
FIXED-IN: 4.7.0

src/dolphinmainwindow.cpp
src/panels/terminal/terminalpanel.cpp
src/panels/terminal/terminalpanel.h

index f5ac94f407b25088eb0b83c411453f4e0ef3fb86..9324cdb21a9e393d2702803bdf6753683a0665d3 100644 (file)
@@ -1798,6 +1798,8 @@ void DolphinMainWindow::setupDockWidgets()
     terminalDock->setWidget(terminalPanel);
 
     connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
+    connect(terminalDock, SIGNAL(visibilityChanged(bool)),
+            terminalPanel, SLOT(visibilityChanged(bool)));
 
     QAction* terminalAction = terminalDock->toggleViewAction();
     terminalAction->setShortcut(Qt::Key_F4);
index 8977111f8fabcaa7a03a076ba67312370730de98..b45be621a56e5d24aadb5ec177c576dccda2d95b 100644 (file)
@@ -54,6 +54,14 @@ void TerminalPanel::terminalExited()
     m_terminal = 0;
 }
 
+void TerminalPanel::visibilityChanged(bool visible)
+{
+    if (!visible && m_terminal && (m_terminal->foregroundProcessId() == -1)) {
+        // Make sure this terminal does not prevent unmounting any removable drives
+        changeDir(KUrl::fromPath("/"));
+    }
+}
+
 bool TerminalPanel::urlChanged()
 {
     if (!url().isValid()) {
index e4d76d54c58d227929cb278e9fcd2f9b832c225c..288cb05d3adc5db2918ad2b455bba1e965e1b466 100644 (file)
@@ -44,6 +44,7 @@ public:
 
 public slots:
     void terminalExited();
+    void visibilityChanged(bool visible);
 
 signals:
     void hideTerminalPanel();