X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d472cb2a25cef38dbebbd0ec9073e4ec05d65272..d3839617:/src/kitemviews/kfileitemmodel.h diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index 3602c16c1..f88a8830a 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -12,6 +12,7 @@ #include "kitemviews/private/kfileitemmodelfilter.h" #include +#include #include #include @@ -85,6 +86,12 @@ public: void setSortDirectoriesFirst(bool dirsFirst); bool sortDirectoriesFirst() const; + /** + * Sets a separate sorting with hidden files and folders last (true) or not (false). + */ + void setSortHiddenLast(bool hiddenLast); + bool sortHiddenLast() const; + void setShowHiddenFiles(bool show); bool showHiddenFiles() const; @@ -303,7 +310,8 @@ private: enum RemoveItemsBehavior { KeepItemData, - DeleteItemData + DeleteItemData, + DeleteItemDataIfUnfiltered }; void insertItems(QList& items); @@ -433,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; }; @@ -463,12 +469,22 @@ 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 &parentsToEnsureVisible = QSet()); + private: KDirLister *m_dirLister = nullptr; QCollator m_collator; bool m_naturalSorting; bool m_sortDirsFirst; + bool m_sortHiddenLast; RoleType m_sortRole; int m_sortingProgressPercent; // Value of directorySortingProgress() signal