m_detailsView(0),
m_columnView(0),
m_fileItemDelegate(0),
+ m_selectionModel(0),
m_dolphinModel(dolphinModel),
m_dirLister(dirLister),
m_proxyModel(proxyModel)
const KUrl viewPropsUrl = viewPropertiesUrl();
ViewProperties props(viewPropsUrl);
props.setViewMode(m_mode);
-
createView();
// the file item delegate has been recreated, apply the current
emit categorizedSortingChanged();
}
- loadDirectory(viewPropsUrl);
-
emit modeChanged();
}
view->setItemDelegate(m_fileItemDelegate);
view->setModel(m_proxyModel);
+ if (m_selectionModel != 0) {
+ 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);