X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d24597def8cee35fa230ebd9457e4bea89374d02..25f4e3efbd485d229cecd397502b9734bdbdee36:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index d7e79f330..91a41b531 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -408,18 +408,37 @@ void DolphinView::refresh() updateViewportColor(); } -void DolphinView::setUrl(const KUrl& url) +void DolphinView::updateView(const KUrl& url, const KUrl& rootUrl) { if (m_controller->url() == url) { return; } + const bool restoreColumnView = !isColumnViewActive() + && !rootUrl.isEmpty() + && !rootUrl.equals(url, KUrl::CompareWithoutTrailingSlash) + && rootUrl.isParentOf(url); + m_controller->setUrl(url); // emits urlChanged, which we forward - applyViewProperties(url); + if (restoreColumnView) { + applyViewProperties(rootUrl); + Q_ASSERT(itemView() == m_columnView); + startDirLister(rootUrl); + m_columnView->showColumn(url); + } else { + applyViewProperties(url); + startDirLister(url); + } - startDirLister(url); itemView()->setFocus(); + + emit startedPathLoading(url); +} + +void DolphinView::setUrl(const KUrl& url) +{ + updateView(url, KUrl()); } void DolphinView::mouseReleaseEvent(QMouseEvent* event) @@ -525,9 +544,8 @@ void DolphinView::startDirLister(const KUrl& url, bool reload) // The current URL is not a child of the dir lister // URL. This may happen when e. g. a place has been selected // and hence the view must be reset. - keepOldDirs = false; + m_dirLister->openUrl(url, false, false); } - m_dirLister->openUrl(url, keepOldDirs, false); } } else { m_dirLister->openUrl(url, false, reload);