]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.cpp
Merge branch 'master' into kf6
[dolphin.git] / src / kitemviews / kfileitemmodel.cpp
index 629332703685f561b75dd18261fcf95ab19f5570..28e0876b9ed4d5c21a024b1d6f7fbf053a589bb1 100644 (file)
@@ -17,7 +17,6 @@
 #include <KIO/Job>
 #include <KLocalizedString>
 #include <KUrlMimeData>
-#include <kio_version.h>
 
 #include <QElapsedTimer>
 #include <QIcon>
@@ -263,11 +262,7 @@ void KFileItemModel::setShowTrashMime(bool show)
 
 void KFileItemModel::setShowHiddenFiles(bool show)
 {
-#if KIO_VERSION < QT_VERSION_CHECK(5, 100, 0)
-    m_dirLister->setShowingDotFiles(show);
-#else
     m_dirLister->setShowHiddenFiles(show);
-#endif
     setShowTrashMime(show);
     m_dirLister->emitChanges();
     if (show) {
@@ -277,11 +272,7 @@ void KFileItemModel::setShowHiddenFiles(bool show)
 
 bool KFileItemModel::showHiddenFiles() const
 {
-#if KIO_VERSION < QT_VERSION_CHECK(5, 100, 0)
-    return m_dirLister->showingDotFiles();
-#else
     return m_dirLister->showHiddenFiles();
-#endif
 }
 
 void KFileItemModel::setShowDirectoriesOnly(bool enabled)
@@ -624,9 +615,7 @@ bool KFileItemModel::setExpanded(int index, bool expanded)
 
         m_expandedDirs.remove(targetUrl);
         m_dirLister->stop(url);
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 92, 0)
         m_dirLister->forgetDirs(url);
-#endif
 
         const int parentLevel = expandedParentsCount(index);
         const int itemCount = m_itemData.count();
@@ -642,9 +631,7 @@ bool KFileItemModel::setExpanded(int index, bool expanded)
                 const QUrl url = itemData->item.url();
                 m_expandedDirs.remove(targetUrl);
                 m_dirLister->stop(url); // TODO: try to unit-test this, see https://bugs.kde.org/show_bug.cgi?id=332102#c11
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 92, 0)
                 m_dirLister->forgetDirs(url);
-#endif
                 expandedChildren.append(targetUrl);
             }
             ++childIndex;
@@ -2606,7 +2593,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;
@@ -2619,7 +2606,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;
@@ -2632,7 +2619,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) {