From: Peter Penz Date: Fri, 22 Jan 2010 14:05:09 +0000 (+0000) Subject: Fixed crash, if the categorizied view sorted by date is used. Use case: modified... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/0ad9abf7b1621a834d272c55d3989e53b6abf30e Fixed crash, if the categorizied view sorted by date is used. Use case: modified date = 2010-01-01 (= week number 53), current date = 2010-01-22 (= week number 3). BUG: 223651 svn path=/trunk/KDE/kdebase/apps/; revision=1078626 --- diff --git a/src/dolphinmodel.cpp b/src/dolphinmodel.cpp index 3467c8a38..f7fd2b350 100644 --- a/src/dolphinmodel.cpp +++ b/src/dolphinmodel.cpp @@ -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) {