From ff3b009e68f485a1a65a7535b01eeeb7128463d2 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 2 May 2013 19:38:01 +0200 Subject: [PATCH] Do not change the view URL if it is a symlink to the current directory BUG: 302037 FIXED-IN: 4.10.3 REVIEW: 110233 --- src/panels/terminal/terminalpanel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index 28c6a9383..bfd3002f0 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -31,6 +31,7 @@ #include #include +#include #include TerminalPanel::TerminalPanel(QWidget* parent) : @@ -183,8 +184,12 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir) { m_konsolePartCurrentDirectory = dir; + // Only change the view URL if 'dir' is different from the current view URL. + // Note that the current view URL could also be a symbolic link to 'dir' + // -> use QDir::canonicalPath() to check that. + const KUrl oldUrl(url()); const KUrl newUrl(dir); - if (newUrl != url()) { + if (newUrl != oldUrl && dir != QDir(oldUrl.path()).canonicalPath()) { emit changeUrl(newUrl); } } -- 2.47.3