diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-04-17 06:58:21 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-04-17 06:58:21 -0400 |
| commit | 0faa5d69953f41deafba33cf36317127cbea8a8a (patch) | |
| tree | b0b00df4afd0e8a1ce477e438e6cf52a5a5823cf /src/filetreemodel.h | |
| parent | 502e752b0af4e7a6800a7504ddbefbeef99778e4 (diff) | |
fixed crashes and empty items in the file tree
sorting and removing items have to be queued since they corrupt various internal structures in Qt when done during layout
Diffstat (limited to 'src/filetreemodel.h')
| -rw-r--r-- | src/filetreemodel.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/filetreemodel.h b/src/filetreemodel.h index 5bfb75aa..8d3af5f7 100644 --- a/src/filetreemodel.h +++ b/src/filetreemodel.h @@ -93,6 +93,13 @@ private: SortInfo m_sort; bool m_fullyLoaded; + // see top of filetreemodel.cpp + std::vector<FileTreeItem*> m_removeItems; + QTimer m_removeTimer; + std::vector<FileTreeItem*> m_sortItems; + QTimer m_sortTimer; + + bool showConflictsOnly() const { return (m_flags & ConflictsOnly); @@ -101,18 +108,28 @@ private: bool showArchives() const; + // for `forFetching`, see top of filetreemodel.cpp void update( FileTreeItem& parentItem, const MOShared::DirectoryEntry& parentEntry, - const std::wstring& parentPath); + const std::wstring& parentPath, bool forFetching); + + void queueRemoveItem(FileTreeItem* item); + void removeItems(); + void queueSortItem(FileTreeItem* item); + void sortItems(); + + // for `forFetching`, see top of filetreemodel.cpp bool updateDirectories( FileTreeItem& parentItem, const std::wstring& path, - const MOShared::DirectoryEntry& parentEntry); + const MOShared::DirectoryEntry& parentEntry, bool forFetching); + // for `forFetching`, see top of filetreemodel.cpp void removeDisappearingDirectories( FileTreeItem& parentItem, const MOShared::DirectoryEntry& parentEntry, - const std::wstring& parentPath, std::unordered_set<std::wstring_view>& seen); + const std::wstring& parentPath, std::unordered_set<std::wstring_view>& seen, + bool forFetching); bool addNewDirectories( FileTreeItem& parentItem, const MOShared::DirectoryEntry& parentEntry, |
