From 6c4e237d4b43db5c3f9dc01f8c0d3313f3bd2605 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sun, 19 Jul 2020 16:48:31 -0400 Subject: fixed crash because items were sorted while being expanded when expanding all or updating the tree, only sort once at the end cache file types --- src/filetreemodel.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/filetreemodel.h') diff --git a/src/filetreemodel.h b/src/filetreemodel.h index 334a0577..4894e4be 100644 --- a/src/filetreemodel.h +++ b/src/filetreemodel.h @@ -61,6 +61,10 @@ public: bool enabled() const; void setEnabled(bool b); + void aboutToExpandAll(); + void expandedAll(); + + const SortInfo& sortInfo() const; QModelIndex index(int row, int col, const QModelIndex& parent={}) const override; @@ -77,6 +81,7 @@ public: FileTreeItem* itemFromIndex(const QModelIndex& index) const; void sortItem(FileTreeItem& item, bool force); + void queueSortItem(FileTreeItem* item); private: class Range; @@ -92,11 +97,12 @@ private: mutable QTimer m_iconPendingTimer; SortInfo m_sort; bool m_fullyLoaded; + bool m_sortingEnabled; // see top of filetreemodel.cpp std::vector m_removeItems; - QTimer m_removeTimer; std::vector m_sortItems; + QTimer m_removeTimer; QTimer m_sortTimer; @@ -118,7 +124,6 @@ private: void queueRemoveItem(FileTreeItem* item); void removeItems(); - void queueSortItem(FileTreeItem* item); void sortItems(); -- cgit v1.3.1