mirror of https://github.com/RPCS3/rpcs3.git
Qt: make sure the gamelist refresh progress dialog runs on the main thread
This commit is contained in:
parent
ee69468104
commit
4a7d982a2b
|
@ -316,8 +316,21 @@ void game_list_frame::Refresh(const bool from_drive, const bool scroll_after)
|
||||||
m_games.pop_all();
|
m_games.pop_all();
|
||||||
|
|
||||||
m_progress_dialog = new progress_dialog(tr("Loading games"), tr("Loading games, please wait..."), tr("Cancel"), 0, 0, true, this, Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
|
m_progress_dialog = new progress_dialog(tr("Loading games"), tr("Loading games, please wait..."), tr("Cancel"), 0, 0, true, this, Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
|
||||||
connect(&m_refresh_watcher, &QFutureWatcher<void>::progressRangeChanged, m_progress_dialog, &QProgressDialog::setRange);
|
|
||||||
connect(&m_refresh_watcher, &QFutureWatcher<void>::progressValueChanged, m_progress_dialog, &QProgressDialog::setValue);
|
connect(&m_refresh_watcher, &QFutureWatcher<void>::progressRangeChanged, this, [this](int minimum, int maximum)
|
||||||
|
{
|
||||||
|
if (m_progress_dialog)
|
||||||
|
{
|
||||||
|
m_progress_dialog->SetRange(minimum, maximum);
|
||||||
|
}
|
||||||
|
}, Qt::QueuedConnection);
|
||||||
|
connect(&m_refresh_watcher, &QFutureWatcher<void>::progressValueChanged, this, [this](int value)
|
||||||
|
{
|
||||||
|
if (m_progress_dialog)
|
||||||
|
{
|
||||||
|
m_progress_dialog->SetValue(value);
|
||||||
|
}
|
||||||
|
}, Qt::QueuedConnection);
|
||||||
connect(m_progress_dialog, &QProgressDialog::canceled, this, [this]()
|
connect(m_progress_dialog, &QProgressDialog::canceled, this, [this]()
|
||||||
{
|
{
|
||||||
gui::utils::stop_future_watcher(m_parsing_watcher, true);
|
gui::utils::stop_future_watcher(m_parsing_watcher, true);
|
||||||
|
|
Loading…
Reference in New Issue