┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemlisttostring.cpp
diff options
context:
space:
mode:
authorSerg Podtynnyi <[email protected]>2023-02-04 00:14:53 +0700
committerSerg Podtynnyi <[email protected]>2023-02-05 12:45:38 +0700
commit38c34eeca315c7be58e65d4d3fb72aaf7b866719 (patch)
tree886e53f20c9c43edc3eb7fe04789716a9bc98ebe /src/kitemviews/kfileitemlisttostring.cpp
parentffff8af851e3a386c44438337779d0ce7ca98a61 (diff)
Add clang-format and format code as in Frameworks
Diffstat (limited to 'src/kitemviews/kfileitemlisttostring.cpp')
-rw-r--r--src/kitemviews/kfileitemlisttostring.cpp48
1 files changed, 27 insertions, 21 deletions
diff --git a/src/kitemviews/kfileitemlisttostring.cpp b/src/kitemviews/kfileitemlisttostring.cpp
index 0004c7e7f..d10680adc 100644
--- a/src/kitemviews/kfileitemlisttostring.cpp
+++ b/src/kitemviews/kfileitemlisttostring.cpp
@@ -19,27 +19,35 @@ QString fileItemListToString(KFileItemList items, int maximumTextWidth, const QF
QString text;
switch (items.count()) {
case 1:
- text = i18nc("Textual representation of a file. %1 is the name of the file/folder.",
- "\"%1\"", items.first().name());
+ text = i18nc("Textual representation of a file. %1 is the name of the file/folder.", "\"%1\"", items.first().name());
break;
case 2:
- text = i18nc("Textual representation of two files. %1 and %2 are names of files/folders.",
- "\"%1\" and \"%2\"", items.first().name(), items.last().name());
+ text =
+ i18nc("Textual representation of two files. %1 and %2 are names of files/folders.", "\"%1\" and \"%2\"", items.first().name(), items.last().name());
break;
case 3:
text = i18nc("Textual representation of three files. %1, %2 and %3 are names of files/folders.",
- "\"%1\", \"%2\" and \"%3\"",
- items.first().name(), items.at(1).name(), items.last().name());
+ "\"%1\", \"%2\" and \"%3\"",
+ items.first().name(),
+ items.at(1).name(),
+ items.last().name());
break;
case 4:
text = i18nc("Textual representation of four files. %1, %2, %3 and %4 are names of files/folders.",
- "\"%1\", \"%2\", \"%3\" and \"%4\"",
- items.first().name(), items.at(1).name(), items.at(2).name(), items.last().name());
+ "\"%1\", \"%2\", \"%3\" and \"%4\"",
+ items.first().name(),
+ items.at(1).name(),
+ items.at(2).name(),
+ items.last().name());
break;
case 5:
text = i18nc("Textual representation of five files. %1, %2, %3, %4 and %5 are names of files/folders.",
- "\"%1\", \"%2\", \"%3\", \"%4\" and \"%5\"",
- items.first().name(), items.at(1).name(), items.at(2).name(), items.at(3).name(), items.last().name());
+ "\"%1\", \"%2\", \"%3\", \"%4\" and \"%5\"",
+ items.first().name(),
+ items.at(1).name(),
+ items.at(2).name(),
+ items.at(3).name(),
+ items.last().name());
break;
default:
text = QString();
@@ -54,14 +62,15 @@ QString fileItemListToString(KFileItemList items, int maximumTextWidth, const QF
const KFileItemListProperties properties(items);
if (itemsState == Selected) {
if (properties.isFile()) {
- text = i18ncp("Textual representation of selected files. %1 is the number of files.",
- "One Selected File", "%1 Selected Files", items.count());
+ text = i18ncp("Textual representation of selected files. %1 is the number of files.", "One Selected File", "%1 Selected Files", items.count());
} else if (properties.isDirectory()) {
- text = i18ncp("Textual representation of selected folders. %1 is the number of folders.",
- "One Selected Folder", "%1 Selected Folders", items.count());
+ text =
+ i18ncp("Textual representation of selected folders. %1 is the number of folders.", "One Selected Folder", "%1 Selected Folders", items.count());
} else {
text = i18ncp("Textual representation of selected fileitems. %1 is the number of files/folders.",
- "One Selected Item", "%1 Selected Items", items.count());
+ "One Selected Item",
+ "%1 Selected Items",
+ items.count());
}
if (fontMetrics.horizontalAdvance(text) <= maximumTextWidth) {
@@ -70,13 +79,10 @@ QString fileItemListToString(KFileItemList items, int maximumTextWidth, const QF
}
if (properties.isFile()) {
- return i18ncp("Textual representation of files. %1 is the number of files.",
- "One File", "%1 Files", items.count());
+ return i18ncp("Textual representation of files. %1 is the number of files.", "One File", "%1 Files", items.count());
} else if (properties.isDirectory()) {
- return i18ncp("Textual representation of folders. %1 is the number of folders.",
- "One Folder", "%1 Folders", items.count());
+ return i18ncp("Textual representation of folders. %1 is the number of folders.", "One Folder", "%1 Folders", items.count());
} else {
- return i18ncp("Textual representation of fileitems. %1 is the number of files/folders.",
- "One Item", "%1 Items", items.count());
+ return i18ncp("Textual representation of fileitems. %1 is the number of files/folders.", "One Item", "%1 Items", items.count());
}
}