From 283f97ac27c3cfe5c72682b0843503e31643a612 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 15 Oct 2011 22:55:01 +0200 Subject: 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. --- src/kitemviews/kfileitemmodel.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/kitemviews/kfileitemmodel.h') 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 @@ -54,18 +54,6 @@ public: virtual QHash data(int index) const; virtual bool setData(int index, const QHash& 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). */ @@ -84,6 +72,9 @@ public: /** @reimp */ virtual QString roleDescription(const QByteArray& role) const; + /** @reimp */ + virtual QList > 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; -- cgit v1.3.1