]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.cpp
Merge remote-tracking branch 'origin/master' into kf6
[dolphin.git] / src / kitemviews / kfileitemmodel.cpp
index f42f2c193877d34183fff9cc82e74f766c39425f..77d5a319ca5670c585a6cfaed78fbf0db7c50ec5 100644 (file)
@@ -17,7 +17,6 @@
 #include <KIO/Job>
 #include <KLocalizedString>
 #include <KUrlMimeData>
-#include <kio_version.h>
 
 #include <QElapsedTimer>
 #include <QIcon>
@@ -982,7 +981,7 @@ void KFileItemModel::resortAllItems()
     // been moved because of the resorting.
     QList<QUrl> oldUrls;
     oldUrls.reserve(itemCount);
-    for (const ItemData *itemData : qAsConst(m_itemData)) {
+    for (const ItemData *itemData : std::as_const(m_itemData)) {
         oldUrls.append(itemData->item.url());
     }
 
@@ -1232,7 +1231,7 @@ void KFileItemModel::slotItemsDeleted(const KFileItemList &items)
         indexesToRemoveWithChildren.reserve(m_itemData.count());
 
         const int itemCount = m_itemData.count();
-        for (int index : qAsConst(indexesToRemove)) {
+        for (int index : std::as_const(indexesToRemove)) {
             indexesToRemoveWithChildren.append(index);
 
             const int parentLevel = expandedParentsCount(index);
@@ -1650,7 +1649,7 @@ void KFileItemModel::prepareItemsForSorting(QList<ItemData *> &itemDataList)
     case DeletionTimeRole:
         // These roles can be determined with retrieveData, and they have to be stored
         // in the QHash "values" for the sorting.
-        for (ItemData *itemData : qAsConst(itemDataList)) {
+        for (ItemData *itemData : std::as_const(itemDataList)) {
             if (itemData->values.isEmpty()) {
                 itemData->values = retrieveData(itemData->item, itemData->parent);
             }
@@ -1659,7 +1658,7 @@ void KFileItemModel::prepareItemsForSorting(QList<ItemData *> &itemDataList)
 
     case TypeRole:
         // At least store the data including the file type for items with known MIME type.
-        for (ItemData *itemData : qAsConst(itemDataList)) {
+        for (ItemData *itemData : std::as_const(itemDataList)) {
             if (itemData->values.isEmpty()) {
                 const KFileItem item = itemData->item;
                 if (item.isDir() || item.isMimeTypeKnown()) {
@@ -2599,7 +2598,7 @@ QList<QPair<int, QVariant>> KFileItemModel::permissionRoleGroups() const
         if (info.permission(QFile::ExeUser)) {
             user += i18nc("@item:intext Access permission, concatenated", "Execute, ");
         }
-        user = user.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : user.mid(0, user.count() - 2);
+        user = user.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : user.mid(0, user.length() - 2);
 
         // Set group string
         QString group;
@@ -2612,7 +2611,7 @@ QList<QPair<int, QVariant>> KFileItemModel::permissionRoleGroups() const
         if (info.permission(QFile::ExeGroup)) {
             group += i18nc("@item:intext Access permission, concatenated", "Execute, ");
         }
-        group = group.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : group.mid(0, group.count() - 2);
+        group = group.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : group.mid(0, group.length() - 2);
 
         // Set others string
         QString others;
@@ -2625,7 +2624,7 @@ QList<QPair<int, QVariant>> KFileItemModel::permissionRoleGroups() const
         if (info.permission(QFile::ExeOther)) {
             others += i18nc("@item:intext Access permission, concatenated", "Execute, ");
         }
-        others = others.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : others.mid(0, others.count() - 2);
+        others = others.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : others.mid(0, others.length() - 2);
 
         const QString newGroupValue = i18nc("@title:group Files and folders by permissions", "User: %1 | Group: %2 | Others: %3", user, group, others);
         if (newGroupValue != groupValue) {