+ // 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 that the following "cd /" command will not affect the view.
+ disconnect(m_konsolePart, SIGNAL(currentDirectoryChanged(QString)),
+ this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));
+