Share the selection model. Does not fix the selections yet though

svn path=/trunk/KDE/kdebase/apps/; revision=744230
This commit is contained in:
John Tapsell 2007-12-03 00:29:56 +00:00
parent e71af0e7c1
commit 396d620466
2 changed files with 9 additions and 0 deletions

View file

@ -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);

View file

@ -690,6 +690,7 @@ private:
DolphinDetailsView* m_detailsView;
DolphinColumnView* m_columnView;
KFileItemDelegate* m_fileItemDelegate;
QItemSelectionModel *m_selectionModel;
DolphinModel* m_dolphinModel;
KDirLister* m_dirLister;