]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemlisttostring.cpp
GIT_SILENT Update Appstream for new release
[dolphin.git] / src / kitemviews / kfileitemlisttostring.cpp
index d10680adca8b6a6c2c78a7dc519f5c7f47075c55..e289c87786e4a2da2255ad281f105a1f82de6c23 100644 (file)
@@ -1,6 +1,6 @@
 /*
     This file is part of the KDE project
-    SPDX-FileCopyrightText: 2022 Felix Ernst <felixernst@zohomail.eu>
+    SPDX-FileCopyrightText: 2022 Felix Ernst <felixernst@kde.org>
 
     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
 */
@@ -19,35 +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().replace("&", "&&"));
         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());
+            i18nc("Textual representation of two files. %1 and %2 are names of files/folders.", "\"%1\" and \"%2\"", items.first().name().replace("&", "&&"), items.last().name().replace("&", "&&"));
         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());
+                     items.first().name().replace("&", "&&"),
+                     items.at(1).name().replace("&", "&&"),
+                     items.last().name().replace("&", "&&"));
         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());
+                     items.first().name().replace("&", "&&"),
+                     items.at(1).name().replace("&", "&&"),
+                     items.at(2).name().replace("&", "&&"),
+                     items.last().name().replace("&", "&&"));
         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());
+                     items.first().name().replace("&", "&&"),
+                     items.at(1).name().replace("&", "&&"),
+                     items.at(2).name().replace("&", "&&"),
+                     items.at(3).name().replace("&", "&&"),
+                     items.last().name().replace("&", "&&"));
         break;
     default:
         text = QString();