linux/macOs: update compat_db and config_db on update
This commit is contained in:
@@ -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)
|
: QMainWindow(parent)
|
||||||
, ui(new Ui::main_window)
|
, ui(new Ui::main_window)
|
||||||
, m_gui_settings(gui_settings)
|
, 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]
|
connect(ui->actionDownload_Update, &QAction::triggered, this, [this]
|
||||||
{
|
{
|
||||||
m_updater.update(false);
|
m_updater.update(false, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -260,6 +260,25 @@ bool main_window::Init([[maybe_unused]] bool with_cli_boot)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RPCS3_UPDATE_SUPPORTED
|
#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)
|
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;
|
const bool in_background = with_cli_boot || update_value == gui::update_bkg;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class main_window : public QMainWindow
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
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();
|
~main_window();
|
||||||
bool Init(bool with_cli_boot);
|
bool Init(bool with_cli_boot);
|
||||||
QIcon GetAppIcon() const;
|
QIcon GetAppIcon() const;
|
||||||
|
|||||||
@@ -4575,7 +4575,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacerDebugCore">
|
<spacer name="verticalSpacerDebugCpu">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Orientation::Vertical</enum>
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
|
|
||||||
LOG_CHANNEL(update_log, "UPDATER");
|
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)
|
update_manager::update_manager(QObject* parent, std::shared_ptr<gui_settings> gui_settings)
|
||||||
: QObject(parent), m_gui_settings(std::move(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)
|
if (automatic)
|
||||||
{
|
{
|
||||||
// Don't check for updates on local builds
|
// 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");
|
update_log.notice("Skipped automatic update check: this is a local build");
|
||||||
return;
|
return;
|
||||||
@@ -135,7 +137,7 @@ bool update_manager::handle_json(bool automatic, bool check_only, bool auto_acce
|
|||||||
std::string error_message;
|
std::string error_message;
|
||||||
switch (return_code)
|
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 -2: error_message = "Server Error - Maintenance Mode"; break;
|
||||||
case -3: error_message = "Server Error - Illegal Search"; break;
|
case -3: error_message = "Server Error - Illegal Search"; break;
|
||||||
case -255: error_message = "Server Error - Return code not found"; 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);
|
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 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)
|
if (!allow_local_auto_update && (automatic || return_code != -1))
|
||||||
{
|
|
||||||
m_update_info.hash_found = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_update_info.hash_found = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& current = json_data["current_build"];
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
update(auto_accept);
|
update(auto_accept, true);
|
||||||
return 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);
|
update_log.notice("Updating with auto_accept=%d", auto_accept);
|
||||||
|
|
||||||
ensure(m_downloader);
|
ensure(m_downloader);
|
||||||
|
|
||||||
if (!auto_accept)
|
if (!auto_accept && is_first_call)
|
||||||
{
|
{
|
||||||
if (!m_update_info.update_found)
|
if (!m_update_info.update_found)
|
||||||
{
|
{
|
||||||
@@ -425,6 +425,14 @@ void update_manager::update(bool auto_accept)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
if (is_first_call)
|
||||||
|
{
|
||||||
|
Q_EMIT signal_download_additional_files(auto_accept);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_downloader->disconnect();
|
m_downloader->disconnect();
|
||||||
|
|
||||||
connect(m_downloader, &downloader::signal_download_error, this, [this](const QString& /*error*/)
|
connect(m_downloader, &downloader::signal_download_error, this, [this](const QString& /*error*/)
|
||||||
|
|||||||
@@ -16,10 +16,11 @@ class update_manager final : public QObject
|
|||||||
public:
|
public:
|
||||||
update_manager(QObject* parent, std::shared_ptr<gui_settings> gui_settings);
|
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 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:
|
Q_SIGNALS:
|
||||||
void signal_update_available(bool update_available);
|
void signal_update_available(bool update_available);
|
||||||
|
void signal_download_additional_files(bool auto_accept);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
downloader* m_downloader = nullptr;
|
downloader* m_downloader = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user