]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.h
Full row highlight implementation
[dolphin.git] / src / kitemviews / kfileitemmodel.h
index 161f6a0e25e3c0d6ae8b7ad794262ffe2f45252d..f88a8830a0b95e56483359f12944927e6620c7f3 100644 (file)
@@ -12,6 +12,7 @@
 #include "kitemviews/private/kfileitemmodelfilter.h"
 
 #include <KFileItem>
+#include <KLazyLocalizedString>
 
 #include <QCollator>
 #include <QHash>
@@ -309,7 +310,8 @@ private:
 
     enum RemoveItemsBehavior {
         KeepItemData,
-        DeleteItemData
+        DeleteItemData,
+        DeleteItemDataIfUnfiltered
     };
 
     void insertItems(QList<ItemData*>& items);
@@ -439,10 +441,8 @@ private:
     {
         const char* const role;
         const RoleType roleType;
-        const char* const roleTranslationContext;
-        const char* const roleTranslation;
-        const char* const groupTranslationContext;
-        const char* const groupTranslation;
+        const KLazyLocalizedString roleTranslation;
+        const KLazyLocalizedString groupTranslation;
         const bool requiresBaloo;
         const bool requiresIndexer;
     };
@@ -469,6 +469,15 @@ private:
      */
     bool isConsistent() const;
 
+    /**
+     * Filters out the expanded folders that don't pass the filter themselves and don't have any filter-passing children.
+     * Will update the removedItemRanges arguments to include the parents that have been filtered.
+     * @returns the number of parents that have been filtered.
+     * @param removedItemRanges The ranges of items being deleted/filtered, will get updated
+     * @param parentsToEnsureVisible Parents that must be visible no matter what due to being ancestors of newly visible items
+     */
+    int filterChildlessParents(KItemRangeList &removedItemRanges, const QSet<ItemData *> &parentsToEnsureVisible = QSet<ItemData *>());
+
 private:
     KDirLister *m_dirLister = nullptr;