]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Do not change the view URL if it is a symlink to the current directory
authorFrank Reininghaus <frank78ac@googlemail.com>
Thu, 2 May 2013 17:38:01 +0000 (19:38 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Thu, 2 May 2013 17:40:01 +0000 (19:40 +0200)
BUG: 302037
FIXED-IN: 4.10.3
REVIEW: 110233

src/panels/terminal/terminalpanel.cpp

index 28c6a9383fd67e505b88958bdadeef9c8e1ec342..bfd3002f0b14315b0d2176d2d483f23bf88c5dfd 100644 (file)
@@ -31,6 +31,7 @@
 #include <KIO/JobUiDelegate>
 
 #include <QBoxLayout>
 #include <KIO/JobUiDelegate>
 
 #include <QBoxLayout>
+#include <QDir>
 #include <QShowEvent>
 
 TerminalPanel::TerminalPanel(QWidget* parent) :
 #include <QShowEvent>
 
 TerminalPanel::TerminalPanel(QWidget* parent) :
@@ -183,8 +184,12 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir)
 {
     m_konsolePartCurrentDirectory = 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);
     const KUrl newUrl(dir);
-    if (newUrl != url()) {
+    if (newUrl != oldUrl && dir != QDir(oldUrl.path()).canonicalPath()) {
         emit changeUrl(newUrl);
     }
 }
         emit changeUrl(newUrl);
     }
 }