┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Jansen <[email protected]>2012-12-30 20:56:59 +0100
committerMichael Jansen <[email protected]>2013-01-03 17:14:30 +0100
commitfe1e3f240a09c18c721f78713e3c359666c42fed (patch)
treeef346d58a3491b35bd69ea372cdb6737cfce992d /src
parentbf202f3931c804af1c03bd958a8e946bab8b4b52 (diff)
Fix crash when browsing bluetooth device.
When trying to browse a N900 it crashed here because pathA was empty. Which lead to index = maxIndex beeing -1 and pathA.at(index) crashing. Reorder the while condition to prevent that courtesy of tsdgeos. (cherry picked from commit f0c90a47de3f59e4a98932ae6f0499921d9aa899)
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 231bfe077..6c015db37 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -1499,7 +1499,7 @@ int KFileItemModel::expandedParentsCountCompare(const ItemData* a, const ItemDat
if (index > maxIndex) {
index = maxIndex;
}
- while ((pathA.at(index) != QLatin1Char('/') || pathB.at(index) != QLatin1Char('/')) && index > 0) {
+ while (index > 0 && (pathA.at(index) != QLatin1Char('/') || pathB.at(index) != QLatin1Char('/'))) {
--index;
}