mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
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:
parent
9480a1ee44
commit
ff3b009e68
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue