┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-12-13 23:38:57 +0100
committerPeter Penz <[email protected]>2011-12-13 23:43:28 +0100
commit67783026f5c4de6f3c757f967d0e9a6a48295361 (patch)
treecb3ef1a14fddae480141cbc71c7c885df08037f7 /src/kitemviews/kfileitemmodel.h
parentbd9f6e49d395568311f03e5bb1b8ffc76360e447 (diff)
Fix several sort-issues
- Treeview: When sorting descending assure that the parent item is still ordered before the child items and not afterwards. - Treeview: When sorting by other roles than names expansionsLevelCompare() had been buggy and resulted in ordering child items below wrong parent items. - General: When sorting by another role than names and the role of two items had been equal a case sensitive sorting of the names had been done. This has been fixed by using the default name sorting as fallback. BUG: 286726 FIXED-IN: 4.8.0
Diffstat (limited to 'src/kitemviews/kfileitemmodel.h')
-rw-r--r--src/kitemviews/kfileitemmodel.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h
index 20cc75e52..b984ee14c 100644
--- a/src/kitemviews/kfileitemmodel.h
+++ b/src/kitemviews/kfileitemmodel.h
@@ -231,7 +231,18 @@ private:
QHash<QByteArray, QVariant> retrieveData(const KFileItem& item) const;
+ /**
+ * @return True if the item-data \a a should be ordered before the item-data
+ * \b. The item-data may have different parent-items.
+ */
bool lessThan(const ItemData* a, const ItemData* b) const;
+
+ /**
+ * Helper method for lessThan() and expansionLevelsCompare(): Compares
+ * the passed item-data using m_sortRole as criteria. Both items must
+ * have the same parent item, otherwise the comparison will be wrong.
+ */
+ int sortRoleCompare(const ItemData* a, const ItemData* b) const;
/**
* Sorts the items by using lessThan() as comparison criteria.