mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-22 15:39:52 +00:00
Reset exits counter when the version is updated
This commit is contained in:
parent
babe23adc8
commit
6611a5ec73
@ -173,6 +173,7 @@
|
|||||||
<option id="wait_days" type="double" default="0.0" migrate="Updater.WaitDays" />
|
<option id="wait_days" type="double" default="0.0" migrate="Updater.WaitDays" />
|
||||||
<option id="last_check" type="int" default="0" migrate="Updater.LastCheck" />
|
<option id="last_check" type="int" default="0" migrate="Updater.LastCheck" />
|
||||||
<option id="uuid" type="std::string" migrate="Updater.Uuid" />
|
<option id="uuid" type="std::string" migrate="Updater.Uuid" />
|
||||||
|
<option id="current_version" type="std::string" />
|
||||||
<option id="new_version" type="std::string" />
|
<option id="new_version" type="std::string" />
|
||||||
<option id="new_url" type="std::string" />
|
<option id="new_url" type="std::string" />
|
||||||
</section>
|
</section>
|
||||||
|
@ -202,15 +202,13 @@ void CheckUpdateThreadLauncher::checkForUpdates()
|
|||||||
|
|
||||||
void CheckUpdateThreadLauncher::showUI()
|
void CheckUpdateThreadLauncher::showUI()
|
||||||
{
|
{
|
||||||
|
std::string localVersionStr = VERSION;
|
||||||
|
base::replace_string(localVersionStr, "-x64", "");
|
||||||
bool newVer = false;
|
bool newVer = false;
|
||||||
|
|
||||||
if (!m_preferences.updater.newVersion().empty()) {
|
if (!m_preferences.updater.newVersion().empty()) {
|
||||||
base::Version serverVersion(m_preferences.updater.newVersion());
|
base::Version serverVersion(m_preferences.updater.newVersion());
|
||||||
|
|
||||||
std::string localVersionStr = VERSION;
|
|
||||||
base::replace_string(localVersionStr, "-x64", "");
|
|
||||||
base::Version localVersion(localVersionStr);
|
base::Version localVersion(localVersionStr);
|
||||||
|
|
||||||
newVer = (localVersion < serverVersion);
|
newVer = (localVersion < serverVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,6 +217,12 @@ void CheckUpdateThreadLauncher::showUI()
|
|||||||
m_preferences.updater.newVersion());
|
m_preferences.updater.newVersion());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// If the program was updated, reset the "exits" counter
|
||||||
|
if (m_preferences.updater.currentVersion() != localVersionStr) {
|
||||||
|
m_preferences.updater.currentVersion(localVersionStr);
|
||||||
|
m_exits = m_inits;
|
||||||
|
}
|
||||||
|
|
||||||
m_delegate->onUpToDate();
|
m_delegate->onUpToDate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user