┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Liehu <[email protected]>2015-04-10 02:41:00 +0300
committerLasse Liehu <[email protected]>2015-04-23 17:40:33 +0300
commitd4475653db4dd57a0534adaa4159067431e56e6b (patch)
tree6fd248ccf7ecb8b573ec17cd109b9d8353df1a1a /src
parent7042c6c2899a4e46a095a38ee1481b63ca4b96d8 (diff)
Rewrap lines in KFileItemModel::dateRoleGroups
Now they are under 100 characters.
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp41
1 files changed, 31 insertions, 10 deletions
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<QPair<int, QVariant> > 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<QPair<int, QVariant> > 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"));
}
}