diff include/gui/pages/anime_list.h @ 273:f31305b9f60a

*: various code safety changes this also makes the code build on Qt 5.7. I can't test it though because I don't have it working... FAIL!
author Paper <paper@paper.us.eu.org>
date Thu, 18 Apr 2024 16:53:17 -0400
parents 3ec7804abf17
children f6a756c19bfb
line wrap: on
line diff
--- a/include/gui/pages/anime_list.h	Thu Apr 18 16:51:35 2024 -0400
+++ b/include/gui/pages/anime_list.h	Thu Apr 18 16:53:17 2024 -0400
@@ -6,10 +6,27 @@
 #include <QSortFilterProxyModel>
 #include <QStyledItemDelegate>
 #include <QWidget>
+#include <QThread>
 #include <vector>
+#include <queue>
 
 class QTreeView;
 class QTabBar;
+class AnimeListPage;
+
+class AnimeListPageUpdateEntryThread final : public QThread {
+public:
+	AnimeListPageUpdateEntryThread(AnimeListPage* parent);
+
+	void AddToQueue(int id);
+
+protected:
+	void run() override;
+
+private:
+	AnimeListPage* page_ = nullptr;
+	std::queue<int> queue_;
+};
 
 class AnimeListPageSortFilter final : public QSortFilterProxyModel {
 	Q_OBJECT
@@ -87,6 +104,8 @@
 	QTabBar* tab_bar;
 	QTreeView* tree_view;
 	QRect panelRect;
+
+	AnimeListPageUpdateEntryThread update_entry_thread_;
 	std::array<AnimeListPageSortFilter*, 5> sort_models;
 };