diff src/gui/pages/anime_list.cc @ 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 91ac90a34003
children 34347fd2a2de
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cc	Sun May 19 17:48:52 2024 -0400
+++ b/src/gui/pages/anime_list.cc	Sun May 19 18:25:14 2024 -0400
@@ -51,7 +51,7 @@
 			queue_.pop();
 		}
 	}
-	page_->Refresh();
+	emit NeedRefresh();
 }
 
 AnimeListPageSortFilter::AnimeListPageSortFilter(QObject* parent) : QSortFilterProxyModel(parent) {
@@ -512,6 +512,8 @@
 			tree_view->setModel(sort_models[index]);
 	});
 
+	connect(&update_entry_thread_, &AnimeListPageUpdateEntryThread::NeedRefresh, this, &AnimeListPage::Refresh);
+
 	SetColumnDefaults();
 	setFocusPolicy(Qt::TabFocus);
 	setFocusProxy(tab_bar);