]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix dir change when show hidden terminal panel with running program in it
authorAndrey Yashkin <andreyyashkin@gmail.com>
Sun, 28 Jul 2019 16:26:36 +0000 (18:26 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 28 Jul 2019 16:29:38 +0000 (18:29 +0200)
Summary: Terminal panel doesn't change its working directory, while any procces is running in it. However, if you hide it and show again the program will get a string with a //cd path// command.

Test Plan:
1. Open dolphin
2. Press F4
3. Start any process like gnu nano
4. Press F4 two more times

Reviewers: #dolphin

Subscribers: anthonyfieroni, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D22422

src/panels/terminal/terminalpanel.cpp

index 8dedd0be11adb4baa2cbceedbad7d46be4644100..52d2a77df7a31dd08b8a26c76f49080e88789388 100644 (file)
@@ -177,7 +177,9 @@ void TerminalPanel::showEvent(QShowEvent* event)
     }
     if (m_terminal) {
         m_terminal->showShellInDir(url().toLocalFile());
-        changeDir(url());
+        if(!hasProgramRunning()) {
+            changeDir(url());
+        }
         m_terminalWidget->setFocus();
         connect(m_konsolePart, SIGNAL(currentDirectoryChanged(QString)),
                 this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));