[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-baseapps/KDE/4.10] dolphin/src/kitemviews: Fix crash when browsing bluetooth device.
From:       Michael Jansen <kde () michael-jansen ! biz>
Date:       2013-01-03 16:15:17
Message-ID: 20130103161517.F0F63A60C4 () git ! kde ! org
[Download RAW message or body]

Git commit 90c7fd400c34e6d4d583c54c04631856c387d359 by Michael Jansen.
Committed on 30/12/2012 at 20:56.
Pushed by mjansen into branch 'KDE/4.10'.

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)

M  +1    -1    dolphin/src/kitemviews/kfileitemmodel.cpp

http://commits.kde.org/kde-baseapps/90c7fd400c34e6d4d583c54c04631856c387d359

diff --git a/dolphin/src/kitemviews/kfileitemmodel.cpp b/dolphin/src/kitemviews/kfileitemmodel.cpp
index 231bfe0..6c015db 100644
--- a/dolphin/src/kitemviews/kfileitemmodel.cpp
+++ b/dolphin/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;
     }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic