diff options
| author | John Tapsell <[email protected]> | 2007-12-03 10:32:27 +0000 |
|---|---|---|
| committer | John Tapsell <[email protected]> | 2007-12-03 10:32:27 +0000 |
| commit | e80f07735774cfd8e4debef48cbef7869506e585 (patch) | |
| tree | f3da24f85c408335ca17c7190aab466e766146b6 /src/dolphincolumnview.cpp | |
| parent | 0f4ecd1c61631bcd8fb050f4d8af5c49e78bbeee (diff) | |
The first columns model and selection model should be the same as the view's model and selection model.
This means
1) We don't leak memory switching to and from column view
2) Selection is preserved when switching views
3) We don't have 2 models running for the root directory
CCMAIL:[email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=744386
Diffstat (limited to 'src/dolphincolumnview.cpp')
| -rw-r--r-- | src/dolphincolumnview.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dolphincolumnview.cpp b/src/dolphincolumnview.cpp index a6fda66d0..d6bd08a42 100644 --- a/src/dolphincolumnview.cpp +++ b/src/dolphincolumnview.cpp @@ -554,4 +554,19 @@ void DolphinColumnView::removeAllColumns() assureVisibleActiveColumn(); } +void DolphinColumnView::setModel ( QAbstractItemModel * model ) +{ + QAbstractItemView::setModel(model); + if(m_columns[0]) { + m_columns[0]->setModel(model); + m_columns[0]->setSelectionModel(selectionModel()); + } +} +void DolphinColumnView::setSelectionModel ( QItemSelectionModel * selectionModel ) +{ + if(m_columns[0]) + m_columns[0]->setSelectionModel(selectionModel); + QAbstractItemView::setSelectionModel(selectionModel); +} + #include "dolphincolumnview.moc" |
