fixes and suggestions

This commit is contained in:
Dmugetsu 2025-02-21 20:51:57 -06:00
parent c1630f7ebd
commit 78d5d265bb
2 changed files with 10 additions and 6 deletions

View File

@ -29,7 +29,7 @@
using namespace Common::FS;
CheckUpdate::CheckUpdate(MainWindow* mainWindow, bool showMessage, QWidget* parent)
CheckUpdate::CheckUpdate(MainWindow* mainWindow, const bool showMessage, QWidget* parent)
: QDialog(parent), networkManager(new QNetworkAccessManager(this)), m_mainWindow(mainWindow) {
setWindowTitle(tr("Auto Updater"));
setFixedSize(0, 0);
@ -424,8 +424,10 @@ void CheckUpdate::DownloadUpdate(const QString& url) {
void CheckUpdate::Install() {
if (m_mainWindow && m_mainWindow->isGameRunning) {
QMessageBox::warning(this, tr("Update Warning"),
tr("A game is currently running. Please close the game to prevent "
"save file corruption."));
// clang-format off
tr("A game is currently running. Please close the game to prevent save file corruption."));
// clang-format on
m_mainWindow->StopGameforUpdate(false);
}

View File

@ -226,10 +226,12 @@ void MainWindow::LoadGameLists() {
#ifdef ENABLE_UPDATER
void MainWindow::CheckUpdateMain(bool checkSave) {
if (checkSave && !Config::autoUpdate()) {
if (checkSave) {
if (!Config::autoUpdate()) {
return;
}
auto checkUpdate = new CheckUpdate(this, false, this);
}
auto checkUpdate = new CheckUpdate(this, true, this);
checkUpdate->exec();
}
#endif