diff include/gui/pages/anime_list.h @ 307:8769c5d50b06

pages/anime_list: don't call GUI functions in a non-GUI thread
author Paper <paper@paper.us.eu.org>
date Sun, 19 May 2024 18:25:14 -0400
parents 9a88e1725fd2
children 1b5c04268d6a
line wrap: on
line diff
--- a/include/gui/pages/anime_list.h	Sun May 19 17:48:52 2024 -0400
+++ b/include/gui/pages/anime_list.h	Sun May 19 18:25:14 2024 -0400
@@ -15,11 +15,16 @@
 class AnimeListPage;
 
 class AnimeListPageUpdateEntryThread final : public QThread {
+	Q_OBJECT
+
 public:
 	AnimeListPageUpdateEntryThread(AnimeListPage* parent);
 
 	void AddToQueue(int id);
 
+signals:
+	void NeedRefresh();
+
 protected:
 	void run() override;
 
@@ -73,13 +78,13 @@
 	std::vector<Anime::Anime> list;
 };
 
-/* todo: rename these to "page" or something more
-   sensible than "widget" */
 class AnimeListPage final : public QWidget {
 	Q_OBJECT
 
 public:
 	AnimeListPage(QWidget* parent = nullptr);
+
+public slots:
 	void Refresh();
 
 protected: