Qt: delete batch progress dialog after user closed it (as originally intended)

This commit is contained in:
Megamouse 2025-01-04 02:13:59 +01:00
parent 635eac7704
commit d2b96636db

View file

@ -2366,20 +2366,18 @@ void game_list_frame::BatchActionBySerials(progress_dialog* pdlg, const std::set
if ((*iterate_over_serial)(*index)) if ((*iterate_over_serial)(*index))
{ {
QTimer::singleShot(1, this, *periodic_func); QTimer::singleShot(1, this, *periodic_func);
return;
} }
else
{
pdlg->setLabelText(progressLabel.arg(*index).arg(serials_size)); pdlg->setLabelText(progressLabel.arg(*index).arg(serials_size));
pdlg->setCancelButtonText(tr("OK")); pdlg->setCancelButtonText(tr("OK"));
connect(pdlg, &progress_dialog::canceled, this, [pdlg](){ pdlg->deleteLater(); });
QApplication::beep(); QApplication::beep();
if (refresh_on_finish && index) if (refresh_on_finish && index)
{ {
Refresh(true); Refresh(true);
} }
pdlg->deleteLater();
}
}; };
// Invoked on the next event loop processing iteration // Invoked on the next event loop processing iteration