]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix problems with commit 8d789f2626243d
authorSebastian Dörner <sebastian@sebastian-doerner.de>
Wed, 1 Jun 2011 20:51:22 +0000 (21:51 +0100)
committerSebastian Dörner <sebastian@sebastian-doerner.de>
Wed, 1 Jun 2011 20:53:44 +0000 (21:53 +0100)
 - fix crash when Ctrl-D-ing in the terminal
 - don't respond to window manager actions, only when the dock itself is
   hidden

Refers to commit 8d789f2626243ddc6c763c84e582e8e20afe7689

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

index 3b5f493ca903be55baa485d6f20013c28567a1af..4c584cdf9fb2572c94e2fc1eddc8b12dce870846 100644 (file)
@@ -1801,7 +1801,7 @@ void DolphinMainWindow::setupDockWidgets()
 
     connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
     connect(terminalDock, SIGNAL(visibilityChanged(bool)),
-            terminalPanel, SLOT(visibilityChanged(bool)));
+            terminalPanel, SLOT(dockVisibilityChanged()));
 
     QAction* terminalAction = terminalDock->toggleViewAction();
     terminalAction->setShortcut(Qt::Key_F4);
index b45be621a56e5d24aadb5ec177c576dccda2d95b..b3bf0506f236c6e6312189aca3adb08a78ca7fcf 100644 (file)
@@ -50,13 +50,16 @@ TerminalPanel::~TerminalPanel()
 
 void TerminalPanel::terminalExited()
 {
-    emit hideTerminalPanel();
     m_terminal = 0;
+    emit hideTerminalPanel();
 }
 
-void TerminalPanel::visibilityChanged(bool visible)
+void TerminalPanel::dockVisibilityChanged()
 {
-    if (!visible && m_terminal && (m_terminal->foregroundProcessId() == -1)) {
+    // Only react when the DockWidget itself (not some parent) is hidden. This way we don't
+    // respond when e.g. Dolphin is minimized.
+    if (parentWidget() && parentWidget()->isHidden() &&
+        m_terminal && (m_terminal->foregroundProcessId() == -1)) {
         // Make sure this terminal does not prevent unmounting any removable drives
         changeDir(KUrl::fromPath("/"));
     }
index 288cb05d3adc5db2918ad2b455bba1e965e1b466..cc27212e8cdec5823d0532b8963f0f0265d20f11 100644 (file)
@@ -44,7 +44,7 @@ public:
 
 public slots:
     void terminalExited();
-    void visibilityChanged(bool visible);
+    void dockVisibilityChanged();
 
 signals:
     void hideTerminalPanel();