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/kfileitemmodel.h | |
| 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/kfileitemmodel.h')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index 4c36a2c21..7d10aad8e 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -55,18 +55,6 @@ public: virtual bool setData(int index, const QHash<QByteArray, QVariant>& values); /** - * @return True - * @reimp - */ - virtual bool supportsGrouping() const; - - /** - * @return True - * @reimp - */ - virtual bool supportsSorting() const; - - /** * Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */ void setSortFoldersFirst(bool foldersFirst); @@ -84,6 +72,9 @@ public: /** @reimp */ virtual QString roleDescription(const QByteArray& role) const; + /** @reimp */ + virtual QList<QPair<int, QVariant> > groups() const; + /** * @return The file-item for the index \a index. If the index is in a valid * range it is assured that the file-item is not null. The runtime @@ -135,7 +126,7 @@ signals: void loadingCompleted(); protected: - virtual void onGroupRoleChanged(const QByteArray& current, const QByteArray& previous); + virtual void onGroupedSortingChanged(bool current); virtual void onSortRoleChanged(const QByteArray& current, const QByteArray& previous); virtual void onSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous); @@ -209,7 +200,6 @@ private: bool m_naturalSorting; bool m_sortFoldersFirst; - Role m_groupRole; Role m_sortRole; Qt::CaseSensitivity m_caseSensitivity; |
