Changeset View
Changeset View
Standalone View
Standalone View
src/panels/terminal/terminalpanel.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | |||||
77 | { | 77 | { | ||
78 | m_terminal = nullptr; | 78 | m_terminal = nullptr; | ||
79 | emit hideTerminalPanel(); | 79 | emit hideTerminalPanel(); | ||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | bool TerminalPanel::isHiddenInVisibleWindow() const | 82 | bool TerminalPanel::isHiddenInVisibleWindow() const | ||
83 | { | 83 | { | ||
84 | return parentWidget() | 84 | return parentWidget() | ||
85 | && parentWidget()->isHidden() | 85 | && parentWidget()->isHidden(); | ||
86 | && m_terminal | | |||
87 | && !hasProgramRunning(); | | |||
88 | } | 86 | } | ||
89 | 87 | | |||
90 | void TerminalPanel::dockVisibilityChanged() | 88 | void TerminalPanel::dockVisibilityChanged() | ||
91 | { | 89 | { | ||
92 | // Only react when the DockWidget itself (not some parent) is hidden. This way we don't | 90 | // Only react when the DockWidget itself (not some parent) is hidden. This way we don't | ||
93 | // respond when e.g. Dolphin is minimized. | 91 | // respond when e.g. Dolphin is minimized. | ||
94 | if (isHiddenInVisibleWindow()) { | 92 | if (isHiddenInVisibleWindow() && m_terminal && !hasProgramRunning()) { | ||
95 | // Make sure that the following "cd /" command will not affect the view. | 93 | // Make sure that the following "cd /" command will not affect the view. | ||
96 | disconnect(m_konsolePart, SIGNAL(currentDirectoryChanged(QString)), | 94 | disconnect(m_konsolePart, SIGNAL(currentDirectoryChanged(QString)), | ||
97 | this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString))); | 95 | this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString))); | ||
98 | 96 | | |||
99 | // Make sure this terminal does not prevent unmounting any removable drives | 97 | // Make sure this terminal does not prevent unmounting any removable drives | ||
100 | changeDir(QUrl::fromLocalFile(QStringLiteral("/"))); | 98 | changeDir(QUrl::fromLocalFile(QStringLiteral("/"))); | ||
101 | 99 | | |||
102 | // Because we have disconnected from the part's currentDirectoryChanged() | 100 | // Because we have disconnected from the part's currentDirectoryChanged() | ||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |