From 97b91b5fe5077228a82c622e4af6a9b698396fda Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sun, 2 Feb 2020 14:23:14 -0500 Subject: prune empty directories --- src/filetreemodel.h | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/filetreemodel.h') diff --git a/src/filetreemodel.h b/src/filetreemodel.h index 0fbcf521..23640ac5 100644 --- a/src/filetreemodel.h +++ b/src/filetreemodel.h @@ -15,9 +15,10 @@ class FileTreeModel : public QAbstractItemModel public: enum Flag { - NoFlags = 0x00, - Conflicts = 0x01, - Archives = 0x02 + NoFlags = 0x00, + ConflictsOnly = 0x01, + Archives = 0x02, + PruneDirectories = 0x04 }; enum Columns @@ -58,12 +59,6 @@ public: FileTreeItem* itemFromIndex(const QModelIndex& index) const; private: - enum class FillFlag - { - None = 0x00, - PruneDirectories = 0x01 - }; - struct Sort { int column = 0; @@ -72,8 +67,6 @@ private: class Range; - Q_DECLARE_FLAGS(FillFlags, FillFlag); - using DirectoryIterator = std::vector::const_iterator; OrganizerCore& m_core; mutable FileTreeItem m_root; @@ -83,9 +76,9 @@ private: mutable QTimer m_iconPendingTimer; Sort m_sort; - bool showConflicts() const + bool showConflictsOnly() const { - return (m_flags & Conflicts); + return (m_flags & ConflictsOnly); } bool showArchives() const; @@ -98,7 +91,7 @@ private: bool updateDirectories( FileTreeItem& parentItem, const std::wstring& path, - const MOShared::DirectoryEntry& parentEntry, FillFlags flags); + const MOShared::DirectoryEntry& parentEntry); void removeDisappearingDirectories( FileTreeItem& parentItem, const MOShared::DirectoryEntry& parentEntry, -- cgit v1.3.1