From f07315deb093852ca86734ef60d1e19623eee3c2 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 24 Dec 2011 14:12:09 +0100 Subject: [PATCH] Fix sort-issue for trees If a protocol like fish is used, the sorting of sub-trees was wrong. The root cause was a wrong comparing of URLs where the protocol was not initialized. BUG: 289697 FIXED-IN: 4.8.0 --- src/kitemviews/kfileitemmodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 70e92eaac..0ac9400c9 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -1531,16 +1531,16 @@ int KFileItemModel::expansionLevelsCompare(const ItemData* a, const ItemData* b) // Compare the items of the parents that represent the first // different path after the common path. - const KUrl parentUrlA(pathA.left(index) + subPathA); - const KUrl parentUrlB(pathB.left(index) + subPathB); + const QString parentPathA = pathA.left(index) + subPathA; + const QString parentPathB = pathB.left(index) + subPathB; const ItemData* parentA = a; - while (parentA && parentA->item.url() != parentUrlA) { + while (parentA && parentA->item.url().path() != parentPathA) { parentA = parentA->parent; } const ItemData* parentB = b; - while (parentB && parentB->item.url() != parentUrlB) { + while (parentB && parentB->item.url().path() != parentPathB) { parentB = parentB->parent; } -- 2.47.3