mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-28 12:51:03 +00:00
Clear cached updates if the version changes some other way. Closes #1368
This commit is contained in:
@@ -331,6 +331,8 @@ DECLARE_REFLECTION_STRUCT(BugReport);
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, bool, bool, CheckUpdate_UpdateAvailable, false) \
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, QString, rdcstr, CheckUpdate_CurrentVersion, "") \
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, QString, rdcstr, CheckUpdate_UpdateResponse, "") \
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, QDateTime, rdcdatetime, CheckUpdate_LastUpdate, \
|
||||
@@ -655,6 +657,11 @@ For more information about some of these settings that are user-facing see
|
||||
|
||||
Defaults to ``False``.
|
||||
|
||||
.. data:: CheckUpdate_CurrentVersion
|
||||
|
||||
The current version at the time of update checks. Used to determine if a cached pending update is
|
||||
no longer valid because we got updated through some other method.
|
||||
|
||||
.. data:: CheckUpdate_UpdateResponse
|
||||
|
||||
Contains the response from the update server from the last update check, with any release notes
|
||||
|
||||
@@ -1214,6 +1214,15 @@ void MainWindow::CheckUpdates(bool forceCheck, UpdateResultMethod callback)
|
||||
}
|
||||
|
||||
#if RENDERDOC_OFFICIAL_BUILD
|
||||
|
||||
// if the current version isn't the one we expected, clear any cached update state
|
||||
if(m_Ctx.Config().CheckUpdate_CurrentVersion != MAJOR_MINOR_VERSION_STRING)
|
||||
{
|
||||
m_Ctx.Config().CheckUpdate_UpdateAvailable = false;
|
||||
m_Ctx.Config().CheckUpdate_UpdateResponse = "";
|
||||
m_Ctx.Config().CheckUpdate_CurrentVersion = MAJOR_MINOR_VERSION_STRING;
|
||||
}
|
||||
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
|
||||
// check by default every 2 days
|
||||
@@ -1290,6 +1299,7 @@ void MainWindow::CheckUpdates(bool forceCheck, UpdateResultMethod callback)
|
||||
{
|
||||
m_Ctx.Config().CheckUpdate_UpdateAvailable = false;
|
||||
m_Ctx.Config().CheckUpdate_UpdateResponse = "";
|
||||
m_Ctx.Config().CheckUpdate_CurrentVersion = lit(MAJOR_MINOR_VERSION_STRING);
|
||||
m_Ctx.Config().Save();
|
||||
SetNoUpdate();
|
||||
|
||||
@@ -1301,6 +1311,7 @@ void MainWindow::CheckUpdates(bool forceCheck, UpdateResultMethod callback)
|
||||
|
||||
m_Ctx.Config().CheckUpdate_UpdateAvailable = true;
|
||||
m_Ctx.Config().CheckUpdate_UpdateResponse = response;
|
||||
m_Ctx.Config().CheckUpdate_CurrentVersion = lit(MAJOR_MINOR_VERSION_STRING);
|
||||
m_Ctx.Config().Save();
|
||||
SetUpdateAvailable();
|
||||
UpdatePopup();
|
||||
|
||||
Reference in New Issue
Block a user