diff options
| author | Peter Penz <[email protected]> | 2011-12-14 22:30:25 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-14 22:33:34 +0100 |
| commit | 10659d97afc83d3123b7884136ffe293adc2040b (patch) | |
| tree | 749cf5ed7ed64cd12d12934e03d7081369d20ef8 /src/kitemviews/kfileitemmodel.h | |
| parent | ee8d9bb4ab3e121a4ae57eed02cc5b4599055995 (diff) | |
Improve private method KFileItemModel::expansionLevelsCompare()
Get rid of the hack to access the m_itemData member for getting
the parent of an item during sorting. ItemData has been extended
by a parent-member which allows a fast and save way to do this.
Sadly this makes the unit-test for expansionLevelsCompare() more
complex and it has been temporary deactivated. I'll take care to
fix this during the next week.
Diffstat (limited to 'src/kitemviews/kfileitemmodel.h')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index b984ee14c..bc692e7c9 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -207,6 +207,7 @@ private: { KFileItem item; QHash<QByteArray, QVariant> values; + ItemData* parent; }; void insertItems(const KFileItemList& items); @@ -276,7 +277,7 @@ private: * is not sufficient, it is also important to check the hierarchy for having * a correct order like shown in a tree. */ - int expansionLevelsCompare(const KFileItem& a, const KFileItem& b) const; + int expansionLevelsCompare(const ItemData* a, const ItemData* b) const; /** * Helper method for expansionLevelCompare(). |
