linux/macOs: update compat_db and config_db on update

This commit is contained in:
Megamouse 2026-04-13 19:56:58 +02:00 committed by Ani
parent 1cdc401cc5
commit a543f38704
5 changed files with 46 additions and 18 deletions

View File

@ -169,7 +169,7 @@ extern void qt_events_aware_op(int repeat_duration_ms, std::function<bool()> wra
}
}
main_window::main_window(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> persistent_settings, QWidget *parent)
main_window::main_window(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> 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;

View File

@ -70,7 +70,7 @@ class main_window : public QMainWindow
};
public:
explicit main_window(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> persistent_settings, QWidget *parent = nullptr);
explicit main_window(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> persistent_settings, QWidget* parent = nullptr);
~main_window();
bool Init(bool with_cli_boot);
QIcon GetAppIcon() const;

View File

@ -4519,11 +4519,11 @@
</property>
<layout class="QVBoxLayout" name="gb_debug_cpu_layout">
<item>
<widget class="QCheckBox" name="accurateDFMA">
<widget class="QCheckBox" name="accurateDFMA">
<property name="text">
<string>Accurate PPU/SPU Double-Precision FMA</string>
<string>Accurate PPU/SPU Double-Precision FMA</string>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QCheckBox" name="accurateClineStores">
@ -4575,7 +4575,7 @@
</widget>
</item>
<item>
<spacer name="verticalSpacerDebugCore">
<spacer name="verticalSpacerDebugCpu">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>

View File

@ -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> 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*/)

View File

@ -16,10 +16,11 @@ class update_manager final : public QObject
public:
update_manager(QObject* parent, std::shared_ptr<gui_settings> 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;