Commit 2e123de9 authored by Frank Reininghaus's avatar Frank Reininghaus

Do not change the view URL if it is a symlink to the current directory

BUG: 302037
FIXED-IN: 4.10.3
REVIEW: 110233
parent 572513a1
......@@ -31,6 +31,7 @@
#include <KIO/JobUiDelegate>
#include <QBoxLayout>
#include <QDir>
#include <QShowEvent>
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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment