From dd71994b6cea7730c126f0b68351a96a0c624634 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 15 Aug 2011 13:05:53 +0200 Subject: Fix for KFileItemModel::expansionLevelsCompare Before this commit, expanding and collapsing folders in the details view would lead to strange results in a folder with the items "a", "a/a/", "a/a/1", "a/a-1/", and "a/a-1/1". The problem was that the comparison between "a/a/1" and "a/a-1/1" went wrong: the first character in which the paths differ is a "/" in one of the items, such that the code that reduces this 'index' in KFileItemModel::expansionLevelsCompare in order to find the 'common path' did nothing because it checked that only *one* of the two items does not have an "/" at the position 'index'. --- src/kitemviews/kfileitemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kitemviews/kfileitemmodel.cpp') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index ddc56209b..c54a982f6 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -831,7 +831,7 @@ int KFileItemModel::expansionLevelsCompare(const KFileItem& a, const KFileItem& if (index > maxIndex) { index = maxIndex; } - while (pathA.at(index) != QLatin1Char('/') && index > 0) { + while ((pathA.at(index) != QLatin1Char('/') || pathB.at(index) != QLatin1Char('/')) && index > 0) { --index; } -- cgit v1.3