Mercurial > minori
comparison 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 |
comparison
equal
deleted
inserted
replaced
306:f4538a4c91ba | 307:8769c5d50b06 |
---|---|
49 while (!queue_.empty() && !isInterruptionRequested()) { | 49 while (!queue_.empty() && !isInterruptionRequested()) { |
50 Services::UpdateAnimeEntry(queue_.front()); | 50 Services::UpdateAnimeEntry(queue_.front()); |
51 queue_.pop(); | 51 queue_.pop(); |
52 } | 52 } |
53 } | 53 } |
54 page_->Refresh(); | 54 emit NeedRefresh(); |
55 } | 55 } |
56 | 56 |
57 AnimeListPageSortFilter::AnimeListPageSortFilter(QObject* parent) : QSortFilterProxyModel(parent) { | 57 AnimeListPageSortFilter::AnimeListPageSortFilter(QObject* parent) : QSortFilterProxyModel(parent) { |
58 } | 58 } |
59 | 59 |
510 connect(tab_bar, &QTabBar::currentChanged, this, [this](int index) { | 510 connect(tab_bar, &QTabBar::currentChanged, this, [this](int index) { |
511 if (sort_models[index]) | 511 if (sort_models[index]) |
512 tree_view->setModel(sort_models[index]); | 512 tree_view->setModel(sort_models[index]); |
513 }); | 513 }); |
514 | 514 |
515 connect(&update_entry_thread_, &AnimeListPageUpdateEntryThread::NeedRefresh, this, &AnimeListPage::Refresh); | |
516 | |
515 SetColumnDefaults(); | 517 SetColumnDefaults(); |
516 setFocusPolicy(Qt::TabFocus); | 518 setFocusPolicy(Qt::TabFocus); |
517 setFocusProxy(tab_bar); | 519 setFocusProxy(tab_bar); |
518 } | 520 } |