┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.cpp
diff options
context:
space:
mode:
authorMichael Jansen <[email protected]>2012-12-30 20:56:59 +0100
committerMichael Jansen <[email protected]>2012-12-30 20:57:48 +0100
commited4644bd875bce2bb797a96652b4aced9eb75976 (patch)
tree7c2a93aba65b2a4d7b850339422d6f6e54745b74 /src/kitemviews/kfileitemmodel.cpp
parentc473003fca026301dbe7db92e82cfc474e001a52 (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.
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
-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;
}