From de29b6a5a89c1db4c19cc5ed4b4946230b7a3885 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 10 Dec 2019 16:29:41 -0500 Subject: IconFetcher --- src/filetree.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/filetree.h') diff --git a/src/filetree.h b/src/filetree.h index aabdf61b..75270d29 100644 --- a/src/filetree.h +++ b/src/filetree.h @@ -38,6 +38,7 @@ public: const QString& filename() const; const QString& mod() const; + const QString& realPath() const; QString dataRelativeParentPath() const; QString dataRelativeFilePath() const; @@ -95,11 +96,15 @@ public: Qt::ItemFlags flags(const QModelIndex& index) const override; private: + class IconFetcher; + using DirectoryIterator = std::vector::const_iterator; OrganizerCore& m_core; mutable FileTreeItem m_root; Flags m_flags; - QIcon m_fileIcon, m_directoryIcon; + std::unique_ptr m_iconFetcher; + mutable std::vector m_iconPending; + mutable QTimer m_iconPendingTimer; bool showConflicts() const; bool showArchives() const; @@ -120,6 +125,7 @@ private: FileTreeItem* itemFromIndex(const QModelIndex& index) const; void ensureLoaded(FileTreeItem* item) const; + void updatePendingIcons(); }; Q_DECLARE_OPERATORS_FOR_FLAGS(FileTreeModel::Flags); -- cgit v1.3.1