mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-13 15:17:42 +02:00
Merge pull request #1204 from crsib/fix_1200
Fixes handling of invalid UpdateScheduledTime
This commit is contained in:
commit
33cd75e302
@ -117,7 +117,7 @@ void UpdateManager::GetUpdates(bool ignoreNetworkErrors)
|
|||||||
wxString());
|
wxString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -136,8 +136,11 @@ void UpdateManager::OnTimer(wxTimerEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
bool UpdateManager::IsTimeForUpdatesChecking()
|
bool UpdateManager::IsTimeForUpdatesChecking()
|
||||||
{
|
{
|
||||||
|
// We use atoll here, so there is no need to handle the exception,
|
||||||
|
// if prefsUpdateScheduledTime is corrupted.
|
||||||
|
// atoll will return 0 on failure, which suits us well.
|
||||||
const TimePoint nextUpdatesCheckingTime(std::chrono::milliseconds(
|
const TimePoint nextUpdatesCheckingTime(std::chrono::milliseconds(
|
||||||
stoll(gPrefs->Read(prefsUpdateScheduledTime, "0").ToStdString())));
|
atoll(gPrefs->Read(prefsUpdateScheduledTime, "0").c_str())));
|
||||||
|
|
||||||
// Get current time
|
// Get current time
|
||||||
const TimePoint currentTime = Clock::now();
|
const TimePoint currentTime = Clock::now();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user