mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 09:00:52 +02:00
Add some recommends and delete extra static methods.
This commit is contained in:
parent
d15d88af71
commit
ec0554e131
@ -32,14 +32,10 @@ END_EVENT_TABLE()
|
|||||||
UpdateManager::UpdateManager()
|
UpdateManager::UpdateManager()
|
||||||
: mTrackingInterval(
|
: mTrackingInterval(
|
||||||
std::chrono::milliseconds(std::chrono::hours(12)).count())
|
std::chrono::milliseconds(std::chrono::hours(12)).count())
|
||||||
{
|
{}
|
||||||
mTimer.SetOwner(this, ID_TIMER);
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateManager::~UpdateManager()
|
UpdateManager::~UpdateManager()
|
||||||
{
|
{}
|
||||||
Stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateManager& UpdateManager::GetInstance()
|
UpdateManager& UpdateManager::GetInstance()
|
||||||
{
|
{
|
||||||
@ -52,16 +48,11 @@ void UpdateManager::Start()
|
|||||||
{
|
{
|
||||||
auto& instance = GetInstance();
|
auto& instance = GetInstance();
|
||||||
|
|
||||||
if (!instance.mTimer.IsRunning())
|
static std::once_flag flag;
|
||||||
|
std::call_once(flag, [&instance] {
|
||||||
|
instance.mTimer.SetOwner(&instance, ID_TIMER);
|
||||||
instance.mTimer.StartOnce();
|
instance.mTimer.StartOnce();
|
||||||
}
|
});
|
||||||
|
|
||||||
void UpdateManager::Stop()
|
|
||||||
{
|
|
||||||
auto& instance = GetInstance();
|
|
||||||
|
|
||||||
if (instance.mTimer.IsRunning())
|
|
||||||
instance.mTimer.Stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateManager::enableUpdatesChecking(bool enable)
|
void UpdateManager::enableUpdatesChecking(bool enable)
|
||||||
|
@ -32,7 +32,6 @@ public:
|
|||||||
|
|
||||||
static UpdateManager& GetInstance();
|
static UpdateManager& GetInstance();
|
||||||
static void Start();
|
static void Start();
|
||||||
static void Stop();
|
|
||||||
|
|
||||||
void getUpdates();
|
void getUpdates();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include <wx/arrstr.h>
|
#include <wx/arrstr.h>
|
||||||
|
|
||||||
/// A class, that support base manipulation with version number.
|
/// A class, that supports base manipulation with version number.
|
||||||
/**
|
/**
|
||||||
By default initialized by zero version number (Version = 0, Release = 0, Revision = 0),
|
By default initialized by zero version number (Version = 0, Release = 0, Revision = 0),
|
||||||
that not allow us to update.
|
that not allow us to update.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user