┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-03-26 18:05:41 +0000
committerPeter Penz <[email protected]>2009-03-26 18:05:41 +0000
commit18a81c6301981617ab506f7d3e88f535ce459fda (patch)
tree7b693ca04bf13dd9404bdfb69d403b51b4e89c7d
parentb4da9212aec8580fbcdb4607de4c4f334b523d26 (diff)
Fixed incorrect grouping of dates. Thanks to Jacopo De Simoi for the patch!
BUG: 187958 svn path=/trunk/KDE/kdebase/apps/; revision=945024
-rw-r--r--src/dolphinmodel.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dolphinmodel.cpp b/src/dolphinmodel.cpp
index 76bd86264..bb1fd36dd 100644
--- a/src/dolphinmodel.cpp
+++ b/src/dolphinmodel.cpp
@@ -221,8 +221,7 @@ QVariant DolphinModel::displayRoleData(const QModelIndex& index) const
modifiedWeek = 53;
}
- if (currentDate.year() == modifiedDate.year() &&
- currentDate.month() == modifiedDate.month()) {
+ if (currentDate.year() == modifiedDate.year() && currentDate.month() == modifiedDate.month()) {
switch (currentWeek - modifiedWeek) {
case 0:
switch (daysDistance) {
@@ -248,7 +247,8 @@ QVariant DolphinModel::displayRoleData(const QModelIndex& index) const
Q_ASSERT(false);
}
} else {
- if (daysDistance <= (currentDate.day() + modifiedDate.daysInMonth())) {
+ const QDate lastMonthDate = currentDate.addMonths(-1);
+ if (lastMonthDate.year() == modifiedDate.year() && lastMonthDate.month() == modifiedDate.month()) {
if (daysDistance == 1) {
retString = i18nc("@title:group Date: %B is full month name in current locale, and %Y is full year number", "Yesterday (%B, %Y)");
} else if (daysDistance <= 7) {