diff options
| author | Peter Penz <[email protected]> | 2011-10-15 22:55:01 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-10-15 22:55:01 +0200 |
| commit | 283f97ac27c3cfe5c72682b0843503e31643a612 (patch) | |
| tree | 35325115a5e5c001e1e307acc580af572bad0ac1 /src/kitemviews/kitemlistview.cpp | |
| parent | a49109b09a191b73f3fda8b65c29e9c6c9bd33d8 (diff) | |
Interface cleanups to prepare the return of "grouped sorting"
- Rename setCategorizedSorting() to setGroupedSorting()
- Change the model interface to allow enabling/disabling grouping
without the need to declare a role (the sort role will be taken).
- Add dummy group role implementation in KFileItemModel
The grouping code itself requires some cleanups and might crash
at the moment or lead to weird layouts.
Diffstat (limited to 'src/kitemviews/kitemlistview.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistview.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 6d1aeca24..a4cb4b041 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -845,6 +845,11 @@ void KItemListView::slotItemsChanged(const KItemRangeList& itemRanges, } } +void KItemListView::slotGroupedSortingChanged(bool current) +{ + m_grouped = current; +} + void KItemListView::slotCurrentChanged(int current, int previous) { Q_UNUSED(previous); @@ -1101,11 +1106,13 @@ void KItemListView::setModel(KItemModelBase* model) this, SLOT(slotItemsRemoved(KItemRangeList))); disconnect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)), this, SLOT(slotItemsMoved(KItemRange,QList<int>))); + disconnect(m_model, SIGNAL(groupedSortingChanged(bool)), + this, SLOT(slotGroupedSortingChanged(bool))); } m_model = model; m_layouter->setModel(model); - m_grouped = !model->groupRole().isEmpty(); + m_grouped = model->groupedSorting(); if (m_model) { connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)), @@ -1116,6 +1123,8 @@ void KItemListView::setModel(KItemModelBase* model) this, SLOT(slotItemsRemoved(KItemRangeList))); connect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)), this, SLOT(slotItemsMoved(KItemRange,QList<int>))); + connect(m_model, SIGNAL(groupedSortingChanged(bool)), + this, SLOT(slotGroupedSortingChanged(bool))); } onModelChanged(model, previous); |
