From ee3d64145ce76022485bea61a0cad0ada88059fb Mon Sep 17 00:00:00 2001 From: spycrab Date: Thu, 22 Mar 2018 12:20:15 +0100 Subject: Qt: Improve updater --- Source/Core/UICommon/AutoUpdate.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'Source/Core/UICommon/AutoUpdate.cpp') diff --git a/Source/Core/UICommon/AutoUpdate.cpp b/Source/Core/UICommon/AutoUpdate.cpp index 3313b706fd..dc094f29ac 100644 --- a/Source/Core/UICommon/AutoUpdate.cpp +++ b/Source/Core/UICommon/AutoUpdate.cpp @@ -20,15 +20,6 @@ namespace { -bool SystemSupportsAutoUpdates() -{ -#ifdef _WIN32 - return true; -#else - return false; -#endif -} - #ifdef _WIN32 const char UPDATER_FILENAME[] = "Updater.exe"; @@ -57,10 +48,19 @@ void CleanupFromPreviousUpdate() #endif } // namespace +bool AutoUpdateChecker::SystemSupportsAutoUpdates() +{ +#ifdef _WIN32 + return true; +#else + return false; +#endif +} + void AutoUpdateChecker::CheckForUpdate() { // Don't bother checking if updates are not supported or not enabled. - if (SConfig::GetInstance().m_auto_update_track.empty() || !SystemSupportsAutoUpdates()) + if (!SystemSupportsAutoUpdates() || SConfig::GetInstance().m_auto_update_track.empty()) return; #ifdef _WIN32 @@ -104,7 +104,10 @@ void AutoUpdateChecker::CheckForUpdate() nvi.content_store_url = obj["content-store"].get(); nvi.new_shortrev = obj["new"].get()["name"].get(); nvi.new_hash = obj["new"].get()["hash"].get(); + // TODO: generate the HTML changelog from the JSON information. + nvi.changelog_html = "

TBD

"; + OnUpdateAvailable(nvi); } -- cgit v1.2.3