]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fixed crash, if the categorizied view sorted by date is used. Use case: modified...
authorPeter Penz <peter.penz19@gmail.com>
Fri, 22 Jan 2010 14:05:09 +0000 (14:05 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 22 Jan 2010 14:05:09 +0000 (14:05 +0000)
BUG: 223651

svn path=/trunk/KDE/kdebase/apps/; revision=1078626

src/dolphinmodel.cpp

index 3467c8a3822056df2905fcbe28a79f9a5c851ba2..f7fd2b3502dad446972a95cde046bf64ac3b127d 100644 (file)
@@ -251,6 +251,11 @@ QVariant DolphinModel::displayRoleData(const QModelIndex& index) const
         }
 
         if (currentDate.year() == modifiedDate.year() && currentDate.month() == modifiedDate.month()) {
+            if (modifiedWeek > currentWeek) {
+                // use case: modified date = 2010-01-01, current date = 2010-01-22
+                //           modified week = 53,         current week = 3
+                modifiedWeek = 0;
+            }
             switch (currentWeek - modifiedWeek) {
             case 0:
                 switch (daysDistance) {