From a543f3870486b5db794221b217a3f657e0ce5bab Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 13 Apr 2026 19:56:58 +0200 Subject: [PATCH] linux/macOs: update compat_db and config_db on update --- rpcs3/rpcs3qt/main_window.cpp | 23 +++++++++++++++++++++-- rpcs3/rpcs3qt/main_window.h | 2 +- rpcs3/rpcs3qt/settings_dialog.ui | 8 ++++---- rpcs3/rpcs3qt/update_manager.cpp | 28 ++++++++++++++++++---------- rpcs3/rpcs3qt/update_manager.h | 3 ++- 5 files changed, 46 insertions(+), 18 deletions(-) diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 22ce52d89c..0bf6a060e1 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -169,7 +169,7 @@ extern void qt_events_aware_op(int repeat_duration_ms, std::function wra } } -main_window::main_window(std::shared_ptr gui_settings, std::shared_ptr emu_settings, std::shared_ptr persistent_settings, QWidget *parent) +main_window::main_window(std::shared_ptr gui_settings, std::shared_ptr emu_settings, std::shared_ptr persistent_settings, QWidget* parent) : QMainWindow(parent) , ui(new Ui::main_window) , m_gui_settings(gui_settings) @@ -234,7 +234,7 @@ bool main_window::Init([[maybe_unused]] bool with_cli_boot) connect(ui->actionDownload_Update, &QAction::triggered, this, [this] { - m_updater.update(false); + m_updater.update(false, true); }); #ifdef _WIN32 @@ -260,6 +260,25 @@ bool main_window::Init([[maybe_unused]] bool with_cli_boot) #endif #ifdef RPCS3_UPDATE_SUPPORTED +#ifndef _WIN32 + connect(&m_updater, &update_manager::signal_download_additional_files, this, [this](bool auto_accept) + { + if (!m_game_list_frame) return; + + connect(m_game_list_frame->GetGameCompatibility(), &game_compatibility::DownloadFinished, this, [this, auto_accept]() + { + connect(m_game_list_frame->GetConfigDatabase(), &config_database::download_finished, this, [this, auto_accept]() + { + m_updater.update(auto_accept, false); + }, Qt::ConnectionType::SingleShotConnection); + + m_game_list_frame->GetConfigDatabase()->request_config_database(true); + }, Qt::ConnectionType::SingleShotConnection); + + m_game_list_frame->GetGameCompatibility()->RequestCompatibility(true); + }); +#endif + if (const auto update_value = m_gui_settings->GetValue(gui::m_check_upd_start).toString(); update_value != gui::update_off) { const bool in_background = with_cli_boot || update_value == gui::update_bkg; diff --git a/rpcs3/rpcs3qt/main_window.h b/rpcs3/rpcs3qt/main_window.h index e9206070cf..b1dc4847d1 100644 --- a/rpcs3/rpcs3qt/main_window.h +++ b/rpcs3/rpcs3qt/main_window.h @@ -70,7 +70,7 @@ class main_window : public QMainWindow }; public: - explicit main_window(std::shared_ptr gui_settings, std::shared_ptr emu_settings, std::shared_ptr persistent_settings, QWidget *parent = nullptr); + explicit main_window(std::shared_ptr gui_settings, std::shared_ptr emu_settings, std::shared_ptr persistent_settings, QWidget* parent = nullptr); ~main_window(); bool Init(bool with_cli_boot); QIcon GetAppIcon() const; diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 9e23f48f1a..77b3f26593 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -4519,11 +4519,11 @@ - + - Accurate PPU/SPU Double-Precision FMA + Accurate PPU/SPU Double-Precision FMA - + @@ -4575,7 +4575,7 @@ - + Qt::Orientation::Vertical diff --git a/rpcs3/rpcs3qt/update_manager.cpp b/rpcs3/rpcs3qt/update_manager.cpp index a66ac6ea46..87d3b445b6 100644 --- a/rpcs3/rpcs3qt/update_manager.cpp +++ b/rpcs3/rpcs3qt/update_manager.cpp @@ -46,6 +46,8 @@ LOG_CHANNEL(update_log, "UPDATER"); +constexpr bool allow_local_auto_update = false; // Set true for debugging the auto updater locally + update_manager::update_manager(QObject* parent, std::shared_ptr gui_settings) : QObject(parent), m_gui_settings(std::move(gui_settings)) { @@ -60,7 +62,7 @@ void update_manager::check_for_updates(bool automatic, bool check_only, bool aut if (automatic) { // Don't check for updates on local builds - if (rpcs3::is_local_build()) + if (!allow_local_auto_update && rpcs3::is_local_build()) { update_log.notice("Skipped automatic update check: this is a local build"); return; @@ -135,7 +137,7 @@ bool update_manager::handle_json(bool automatic, bool check_only, bool auto_acce std::string error_message; switch (return_code) { - case -1: error_message = "Hash not found(Custom/PR build)"; break; + case -1: error_message = "Hash not found (Custom/PR build)"; break; case -2: error_message = "Server Error - Maintenance Mode"; break; case -3: error_message = "Server Error - Illegal Search"; break; case -255: error_message = "Server Error - Return code not found"; break; @@ -148,14 +150,12 @@ bool update_manager::handle_json(bool automatic, bool check_only, bool auto_acce update_log.warning("Update error: %s, return code: %d", error_message, return_code); // If a user clicks "Check for Updates" with a custom build ask him if he's sure he wants to update to latest version - if (!automatic && return_code == -1) - { - m_update_info.hash_found = false; - } - else + if (!allow_local_auto_update && (automatic || return_code != -1)) { return false; } + + m_update_info.hash_found = false; } const auto& current = json_data["current_build"]; @@ -311,17 +311,17 @@ bool update_manager::handle_json(bool automatic, bool check_only, bool auto_acce return true; } - update(auto_accept); + update(auto_accept, true); return true; } -void update_manager::update(bool auto_accept) +void update_manager::update(bool auto_accept, bool is_first_call) { update_log.notice("Updating with auto_accept=%d", auto_accept); ensure(m_downloader); - if (!auto_accept) + if (!auto_accept && is_first_call) { if (!m_update_info.update_found) { @@ -425,6 +425,14 @@ void update_manager::update(bool auto_accept) return; } +#ifndef _WIN32 + if (is_first_call) + { + Q_EMIT signal_download_additional_files(auto_accept); + return; + } +#endif + m_downloader->disconnect(); connect(m_downloader, &downloader::signal_download_error, this, [this](const QString& /*error*/) diff --git a/rpcs3/rpcs3qt/update_manager.h b/rpcs3/rpcs3qt/update_manager.h index 98ef5cf3f1..62986b796b 100644 --- a/rpcs3/rpcs3qt/update_manager.h +++ b/rpcs3/rpcs3qt/update_manager.h @@ -16,10 +16,11 @@ class update_manager final : public QObject public: update_manager(QObject* parent, std::shared_ptr gui_settings); void check_for_updates(bool automatic, bool check_only, bool auto_accept, QWidget* parent = nullptr); - void update(bool auto_accept); + void update(bool auto_accept, bool is_first_call); Q_SIGNALS: void signal_update_available(bool update_available); + void signal_download_additional_files(bool auto_accept); private: downloader* m_downloader = nullptr;