From fd9cac1188130d3ef09530a902c95cf6190990a1 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 18 Oct 2011 22:11:22 +0200 Subject: Implement group-header layouting The most tricky part for groups - the layouting - basically works now for all views (grouping was available only in the icons views for Dolphin 1.x) and is nearly equally fast as without groups. Still open: - Group headers are ugly screen rectangles - Return valid groups in KFileItemModel instead of the currently hardcoded testing values - Dynamically turning on/off groups does not work currently, the directory must be reentered --- src/kitemviews/kfileitemmodel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/kitemviews/kfileitemmodel.cpp') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 3a49135f9..46de7c5aa 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -225,15 +225,19 @@ QString KFileItemModel::roleDescription(const QByteArray& role) const QList > KFileItemModel::groups() const { - // TODO: + // TODO: dirty hack for initial testing of grouping functionality QPair group1(0, "Group 1"); - QPair group2(5, "Group 2"); + QPair group2(2, "Group 2"); QPair group3(10, "Group 3"); + QPair group4(11, "Group 4"); + QPair group5(40, "Group 5"); QList > groups; groups.append(group1); groups.append(group2); groups.append(group3); + groups.append(group4); + groups.append(group5); return groups; } -- cgit v1.3