]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.cpp
Merge branch 'work/zakharafoniam/useful-groups' of https://invent.kde.org/zakharafoni...
[dolphin.git] / src / kitemviews / kfileitemmodel.cpp
index 960847ea7f8aaca66beebd36912c53e75559c4ce..2133eef79e5fc57bc2a67d0184a791d82d7a3d8a 100644 (file)
@@ -946,6 +946,15 @@ QList<KFileItemModel::RoleInfo> KFileItemModel::rolesInformation()
     return rolesInfo;
 }
 
+QList<KFileItemModel::RoleInfo> KFileItemModel::extraGroupingInformation()
+{
+    static QList<RoleInfo> rolesInfo{
+        {QByteArray("none"),         kli18nc("@label", "No grouping").toString(),       nullptr,     nullptr,     false,      false},
+        {QByteArray("followSort"),   kli18nc("@label", "Follow sorting").toString(),    nullptr,    nullptr,     false,      false}
+    };
+    return rolesInfo;
+}
+
 void KFileItemModel::onGroupedSortingChanged(bool current)
 {
     Q_UNUSED(current)
@@ -2828,7 +2837,7 @@ KFileItemModel::ItemGroupInfo KFileItemModel::ratingRoleGroup(const ItemData *it
     if (withString) {
         // Dolphin does not currently use string representation of star rating
         // as stars are rendered as graphics in group headers.
-        groupInfo.text = i18nc("@item:intext Rated N (stars)", "Rated ") + QString::number(groupInfo.comparable);
+        groupInfo.text = i18nc("@item:intext Rated N (stars)", "Rated %i", QString::number(groupInfo.comparable));
     }
     return groupInfo;
 }