X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/1a6b3c0a2baba955259d6083c0a3f25dfb44a682..87e8d0ba5f:/src/panels/terminal/terminalpanel.cpp diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index c205374cd..849d3f8c9 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -73,12 +73,19 @@ void TerminalPanel::terminalExited() emit hideTerminalPanel(); } +bool TerminalPanel::isHiddenInVisibleWindow() +{ + return parentWidget() + && parentWidget()->isHidden() + && m_terminal + && (m_terminal->foregroundProcessId() == -1); +} + void TerminalPanel::dockVisibilityChanged() { // 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)) { + if (isHiddenInVisibleWindow()) { // Make sure that the following "cd /" command will not affect the view. disconnect(m_konsolePart, SIGNAL(currentDirectoryChanged(QString)), this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));