]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix sort-issue for trees
authorPeter Penz <peter.penz19@gmail.com>
Sat, 24 Dec 2011 13:12:09 +0000 (14:12 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 24 Dec 2011 13:16:10 +0000 (14:16 +0100)
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

index 70e92eaac1990e56b0810460edbfcb38e1da1ca3..0ac9400c99a229b4d8fb97ae498796dcbb95f0f5 100644 (file)
@@ -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;
     }