diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 51e2a0a575..ad66e5ad76 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 f550fa5135..4a2f5be025 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;