┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Tapsell <[email protected]>2007-12-03 00:29:56 +0000
committerJohn Tapsell <[email protected]>2007-12-03 00:29:56 +0000
commit396d620466e2a3042650d95b114e79e7d32c970b (patch)
tree5fcb8d33989bf423cdb8140418662f227267b634 /src
parente71af0e7c12f43360078e98e49553731303ea891 (diff)
Share the selection model. Does not fix the selections yet though
svn path=/trunk/KDE/kdebase/apps/; revision=744230
Diffstat (limited to 'src')
-rw-r--r--src/dolphinview.cpp8
-rw-r--r--src/dolphinview.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 51e2a0a57..ad66e5ad7 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -72,6 +72,7 @@ DolphinView::DolphinView(QWidget* parent,
m_detailsView(0),
m_columnView(0),
m_fileItemDelegate(0),
+ m_selectionModel(0),
m_dolphinModel(dolphinModel),
m_dirLister(dirLister),
m_proxyModel(proxyModel)
@@ -863,6 +864,13 @@ void DolphinView::createView()
view->setItemDelegate(m_fileItemDelegate);
view->setModel(m_proxyModel);
+ if(m_selectionModel)
+ view->setSelectionModel(m_selectionModel);
+ else
+ m_selectionModel = view->selectionModel();
+
+ m_selectionModel->setParent(this); //Reparent the selection model. We do not want it to be deleted when we delete the model
+
view->setSelectionMode(QAbstractItemView::ExtendedSelection);
new KMimeTypeResolver(view, m_dolphinModel);
diff --git a/src/dolphinview.h b/src/dolphinview.h
index f550fa513..4a2f5be02 100644
--- a/src/dolphinview.h
+++ b/src/dolphinview.h
@@ -690,6 +690,7 @@ private:
DolphinDetailsView* m_detailsView;
DolphinColumnView* m_columnView;
KFileItemDelegate* m_fileItemDelegate;
+ QItemSelectionModel *m_selectionModel;
DolphinModel* m_dolphinModel;
KDirLister* m_dirLister;