Clear cached updates if the version changes some other way. Closes #1368

This commit is contained in:
baldurk
2019-05-01 10:24:28 +01:00
parent 3b328fd251
commit 53f54ae882
2 changed files with 18 additions and 0 deletions
+11
View File
@@ -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();