Mercurial > minori
diff src/gui/pages/anime_list.cc @ 230:2f5a9247e501
torrents: implement download button
erg
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sat, 13 Jan 2024 09:42:02 -0500 |
parents | 7cf53145de11 |
children | ff0061e75f0f |
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cc Wed Jan 10 21:23:57 2024 -0500 +++ b/src/gui/pages/anime_list.cc Sat Jan 13 09:42:02 2024 -0500 @@ -28,7 +28,7 @@ #include <QTreeView> #include <QStylePainter> #include <QStyledItemDelegate> -#include <QThreadPool> +#include <QThread> #include <set> @@ -218,10 +218,14 @@ } void AnimeListPage::UpdateAnime(int id) { - QThreadPool::globalInstance()->start([this, id] { + QThread* thread = QThread::create([id] { Services::UpdateAnimeEntry(id); - Refresh(); }); + + connect(thread, &QThread::finished, this, &AnimeListPage::Refresh); + connect(thread, &QThread::finished, this, &QThread::deleteLater); + + thread->start(); } void AnimeListPage::RemoveAnime(int id) {