From: Lasse Liehu Date: Thu, 9 Apr 2015 23:41:00 +0000 (+0300) Subject: Rewrap lines in KFileItemModel::dateRoleGroups X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d4475653db4dd57a0534adaa4159067431e56e6b Rewrap lines in KFileItemModel::dateRoleGroups Now they are under 100 characters. --- diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index eac3ddf8b..705b325b6 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -1933,13 +1933,17 @@ QList > KFileItemModel::dateRoleGroups() const const int daysDistance = modifiedDate.daysTo(currentDate); QString newGroupValue; - if (currentDate.year() == modifiedDate.year() && currentDate.month() == modifiedDate.month()) { + if (currentDate.year() == modifiedDate.year() && + currentDate.month() == modifiedDate.month()) { + switch (daysDistance / 7) { case 0: switch (daysDistance) { case 0: newGroupValue = i18nc("@title:group Date", "Today"); break; case 1: newGroupValue = i18nc("@title:group Date", "Yesterday"); break; - default: newGroupValue = modifiedTime.toString(i18nc("@title:group The week day name: dddd", "dddd")); + default: + newGroupValue = modifiedTime.toString( + i18nc("@title:group The week day name: dddd", "dddd")); } break; case 1: @@ -1960,22 +1964,39 @@ QList > KFileItemModel::dateRoleGroups() const } } else { const QDate lastMonthDate = currentDate.addMonths(-1); - if (lastMonthDate.year() == modifiedDate.year() && lastMonthDate.month() == modifiedDate.month()) { + if (lastMonthDate.year() == modifiedDate.year() && + lastMonthDate.month() == modifiedDate.month()) { + if (daysDistance == 1) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: MMMM is full month name in current locale, and yyyy is full year number", "'Yesterday' (MMMM, yyyy)")); + newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + "MMMM is full month name in current locale, and yyyy is " + "full year number", "'Yesterday' (MMMM, yyyy)")); } else if (daysDistance <= 7) { - newGroupValue = modifiedTime.toString(i18nc("@title:group The week day name: dddd, MMMM is full month name in current locale, and yyyy is full year number", "dddd (MMMM, yyyy)")); + newGroupValue = modifiedTime.toString(i18nc("@title:group " + "The week day name: dddd, MMMM is full month name " + "in current locale, and yyyy is full year number", + "dddd (MMMM, yyyy)")); } else if (daysDistance <= 7 * 2) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: MMMM is full month name in current locale, and yyyy is full year number", "'One Week Ago' (MMMM, yyyy)")); + newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + "MMMM is full month name in current locale, and yyyy is " + "full year number", "'One Week Ago' (MMMM, yyyy)")); } else if (daysDistance <= 7 * 3) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: MMMM is full month name in current locale, and yyyy is full year number", "'Two Weeks Ago' (MMMM, yyyy)")); + newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + "MMMM is full month name in current locale, and yyyy is " + "full year number", "'Two Weeks Ago' (MMMM, yyyy)")); } else if (daysDistance <= 7 * 4) { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: MMMM is full month name in current locale, and yyyy is full year number", "'Three Weeks Ago' (MMMM, yyyy)")); + newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + "MMMM is full month name in current locale, and yyyy is " + "full year number", "'Three Weeks Ago' (MMMM, yyyy)")); } else { - newGroupValue = modifiedTime.toString(i18nc("@title:group Date: MMMM is full month name in current locale, and yyyy is full year number", "'Earlier on' MMMM, yyyy")); + newGroupValue = modifiedTime.toString(i18nc("@title:group Date: " + "MMMM is full month name in current locale, and yyyy is " + "full year number", "'Earlier on' MMMM, yyyy")); } } else { - newGroupValue = modifiedTime.toString(i18nc("@title:group The month and year: MMMM is full month name in current locale, and yyyy is full year number", "MMMM, yyyy")); + newGroupValue = modifiedTime.toString(i18nc("@title:group " + "The month and year: MMMM is full month name in current locale, " + "and yyyy is full year number", "MMMM, yyyy")); } }