]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Share the selection model. Does not fix the selections yet though
authorJohn Tapsell <john.tapsell@kdemail.net>
Mon, 3 Dec 2007 00:29:56 +0000 (00:29 +0000)
committerJohn Tapsell <john.tapsell@kdemail.net>
Mon, 3 Dec 2007 00:29:56 +0000 (00:29 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=744230

src/dolphinview.cpp
src/dolphinview.h

index 51e2a0a575ae6e2e8e3ef48c1c83531abb1b1935..ad66e5ad765b5d743ee06e758bbc5379d8b97ea5 100644 (file)
@@ -72,6 +72,7 @@ DolphinView::DolphinView(QWidget* parent,
     m_detailsView(0),
     m_columnView(0),
     m_fileItemDelegate(0),
     m_detailsView(0),
     m_columnView(0),
     m_fileItemDelegate(0),
+    m_selectionModel(0),
     m_dolphinModel(dolphinModel),
     m_dirLister(dirLister),
     m_proxyModel(proxyModel)
     m_dolphinModel(dolphinModel),
     m_dirLister(dirLister),
     m_proxyModel(proxyModel)
@@ -863,6 +864,13 @@ void DolphinView::createView()
     view->setItemDelegate(m_fileItemDelegate);
 
     view->setModel(m_proxyModel);
     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);
     view->setSelectionMode(QAbstractItemView::ExtendedSelection);
 
     new KMimeTypeResolver(view, m_dolphinModel);
index f550fa51356dd1368e24e8009a6cb860baec80c4..4a2f5be02530813c9bc7acb1291e5ae38f36799d 100644 (file)
@@ -690,6 +690,7 @@ private:
     DolphinDetailsView* m_detailsView;
     DolphinColumnView* m_columnView;
     KFileItemDelegate* m_fileItemDelegate;
     DolphinDetailsView* m_detailsView;
     DolphinColumnView* m_columnView;
     KFileItemDelegate* m_fileItemDelegate;
+    QItemSelectionModel *m_selectionModel;
 
     DolphinModel* m_dolphinModel;
     KDirLister* m_dirLister;
 
     DolphinModel* m_dolphinModel;
     KDirLister* m_dirLister;