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

BUG: 302037
FIXED-IN: 4.10.3
REVIEW: 110233
This commit is contained in:
Frank Reininghaus 2013-05-02 19:38:01 +02:00
parent 9480a1ee44
commit ff3b009e68

View file

@ -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);
}
}