┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-02-21 13:29:32 +0000
committerPeter Penz <[email protected]>2010-02-21 13:29:32 +0000
commit642062284c7e3b90ef3c8296c901b04cc0d7aa28 (patch)
tree0ef125538617b590ee725d045525c8acd10e151c /src
parenta2f0d69558cd933086636baee68cb2918e27743f (diff)
Forward port of SVN commit 1093803: Assure that the changed selection model is reconnected when changing columns. This fixes the regression that some operations have been disabled on sub columns. Thanks to Frank Reininghaus for the analyses.
CCBUG: 226749 svn path=/trunk/KDE/kdebase/apps/; revision=1093807
Diffstat (limited to 'src')
-rw-r--r--src/dolphinview.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 3911b92bd..c00d6a7e7 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -535,22 +535,30 @@ QList<QAction*> 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()
@@ -1325,8 +1333,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());