X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/17ff26c355adf945e143418c8bd756cf168d963b..7eeb8dba6aeba09aa3dfa7fa5f0b00840d4d8317:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index a2689b8c8..c5f6c91d3 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -108,8 +108,6 @@ DolphinView::DolphinView(QWidget* parent, connect(m_controller, SIGNAL(urlChanged(const KUrl&)), this, SIGNAL(urlChanged(const KUrl&))); - connect(m_controller, SIGNAL(requestUrlChange(const KUrl&)), - this, SLOT(slotRequestUrlChange(const KUrl&))); connect(m_controller, SIGNAL(requestContextMenu(const QPoint&, const QList&)), this, SLOT(openContextMenu(const QPoint&, const QList&))); @@ -535,22 +533,30 @@ QList DolphinView::versionControlActions(const KFileItemList& items) c void DolphinView::setUrl(const KUrl& url) { - if (m_controller->url() == url) { - return; - } + if (m_controller->url() != url) { + m_newFileNames.clear(); - m_newFileNames.clear(); + m_controller->setUrl(url); // emits urlChanged, which we forward + m_viewAccessor.prepareUrlChange(url); + applyViewProperties(); + loadDirectory(url); - m_controller->setUrl(url); // emits urlChanged, which we forward - m_viewAccessor.prepareUrlChange(url); - applyViewProperties(); - loadDirectory(url); + // When changing the URL there is no need to keep the version + // data of the previous URL. + m_viewAccessor.dirModel()->clearVersionData(); - // When changing the URL there is no need to keep the version - // data of the previous URL. - m_viewAccessor.dirModel()->clearVersionData(); + emit startedPathLoading(url); + } - emit startedPathLoading(url); + // the selection model might have changed in the case of a column view + QItemSelectionModel* selectionModel = m_viewAccessor.itemView()->selectionModel(); + if (m_selectionModel != selectionModel) { + disconnect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), + this, SLOT(slotSelectionChanged(QItemSelection, QItemSelection))); + m_selectionModel = selectionModel; + connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), + this, SLOT(slotSelectionChanged(QItemSelection, QItemSelection))); + } } void DolphinView::selectAll() @@ -1117,12 +1123,6 @@ void DolphinView::slotDeleteFileFinished(KJob* job) } } -void DolphinView::slotRequestUrlChange(const KUrl& url) -{ - emit requestUrlChange(url); - m_controller->setUrl(url); -} - void DolphinView::slotDirListerCompleted() { if (!m_expanderActive) { @@ -1209,18 +1209,8 @@ void DolphinView::loadDirectory(const KUrl& url, bool reload) return; } - m_expanderActive = false; - KDirLister* dirLister = m_viewAccessor.dirLister(); dirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags); - - KDirLister* rootDirLister = m_viewAccessor.rootDirLister(); - if (dirLister != rootDirLister) { - // In the case of the column view the root directory lister can be different. Assure - // that it gets synchronized (clients from DolphinView are not aware that internally - // different directory listers are used). - rootDirLister->openUrl(url, reload ? KDirLister::Reload : KDirLister::NoFlags); - } } void DolphinView::applyViewProperties() @@ -1327,8 +1317,8 @@ void DolphinView::createView() m_selectionModel = view->selectionModel(); } m_selectionModel->setParent(this); - connect(view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), - this, SLOT(slotSelectionChanged(const QItemSelection&, const QItemSelection&))); + connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), + this, SLOT(slotSelectionChanged(QItemSelection, QItemSelection))); setFocusProxy(m_viewAccessor.layoutTarget()); m_topLayout->insertWidget(1, m_viewAccessor.layoutTarget()); @@ -1509,11 +1499,6 @@ KUrl DolphinView::ViewAccessor::rootUrl() const return (m_columnsContainer != 0) ? m_columnsContainer->rootUrl() : KUrl(); } -KDirLister* DolphinView::ViewAccessor::rootDirLister() const -{ - return static_cast(m_proxyModel->sourceModel())->dirLister(); -} - bool DolphinView::ViewAccessor::supportsCategorizedSorting() const { return m_iconsView != 0;