diff --git a/src/update/UpdateDataParser.cpp b/src/update/UpdateDataParser.cpp index c5bb923ea..958f1a74c 100644 --- a/src/update/UpdateDataParser.cpp +++ b/src/update/UpdateDataParser.cpp @@ -28,7 +28,7 @@ bool UpdateDataParser::Parse(const VersionPatch::UpdateDataFormat& updateData, V return ok; } -wxArrayString UpdateDataParser::splitChangelogSentences(const wxString& changelogContent) +wxArrayString UpdateDataParser::SplitChangelogSentences(const wxString& changelogContent) { wxArrayString changelogSentenceList; @@ -122,7 +122,7 @@ void UpdateDataParser::HandleXMLContent(const wxString& content) { case XmlParsedTags::kDescriptionTag: trimedContent.Trim(true).Trim(false); - mVersionPatch->changelog = splitChangelogSentences(trimedContent); + mVersionPatch->changelog = SplitChangelogSentences(trimedContent); break; case XmlParsedTags::kVersionTag: diff --git a/src/update/UpdateDataParser.h b/src/update/UpdateDataParser.h index abb8b526b..da72b7ccf 100644 --- a/src/update/UpdateDataParser.h +++ b/src/update/UpdateDataParser.h @@ -60,7 +60,7 @@ private: void HandleXMLContent(const wxString& content) override; XMLTagHandler* HandleXMLChild(const wxChar* tag) override; - wxArrayString splitChangelogSentences(const wxString& changelogContent); + wxArrayString SplitChangelogSentences(const wxString& changelogContent); VersionPatch* mVersionPatch{ nullptr }; }; diff --git a/src/update/UpdateManager.cpp b/src/update/UpdateManager.cpp index 9b9bc58bf..93adf19ad 100644 --- a/src/update/UpdateManager.cpp +++ b/src/update/UpdateManager.cpp @@ -51,27 +51,27 @@ void UpdateManager::Start() static std::once_flag flag; std::call_once(flag, [&instance] { instance.mTimer.SetOwner(&instance, ID_TIMER); - instance.mTimer.StartOnce(); + instance.mTimer.StartOnce(1); }); } -void UpdateManager::enableUpdatesChecking(bool enable) +void UpdateManager::EnableUpdatesChecking(bool enable) { gPrefs->Write(prefsUpdatePopupDialogShown, enable); gPrefs->Flush(); } -bool UpdateManager::isUpdatesCheckingEnabled() +bool UpdateManager::IsUpdatesCheckingEnabled() { return gPrefs->ReadBool(prefsUpdatePopupDialogShown, true); } -VersionPatch UpdateManager::getVersionPatch() const +VersionPatch UpdateManager::GetVersionPatch() const { return mVersionPatch; } -void UpdateManager::getUpdates() +void UpdateManager::GetUpdates() { const audacity::network_manager::Request request("https://updates.audacityteam.org/feed/latest.xml"); auto response = audacity::network_manager::NetworkManager::GetInstance().doGet(request); @@ -123,13 +123,13 @@ void UpdateManager::getUpdates() void UpdateManager::OnTimer(wxTimerEvent& WXUNUSED(event)) { - if (isUpdatesCheckingEnabled() && isTimeToUpdate()) - getUpdates(); + if (IsUpdatesCheckingEnabled() && IsTimeToUpdate()) + GetUpdates(); mTimer.StartOnce(mTrackingInterval); } -bool UpdateManager::isTimeToUpdate() +bool UpdateManager::IsTimeToUpdate() { long long nextUpdatesCheckingTime = std::stoll( gPrefs->Read(prefsUpdateScheduledTime, "0").ToStdString()); diff --git a/src/update/UpdateManager.h b/src/update/UpdateManager.h index 3cf99a29a..82d024b24 100644 --- a/src/update/UpdateManager.h +++ b/src/update/UpdateManager.h @@ -33,12 +33,12 @@ public: static UpdateManager& GetInstance(); static void Start(); - void getUpdates(); + void GetUpdates(); - void enableUpdatesChecking(bool enable); - bool isUpdatesCheckingEnabled(); + void EnableUpdatesChecking(bool enable); + bool IsUpdatesCheckingEnabled(); - VersionPatch getVersionPatch() const; + VersionPatch GetVersionPatch() const; private: UpdateDataParser mUpdateDataParser; @@ -50,7 +50,7 @@ private: void OnTimer(wxTimerEvent& event); /// Scheduling update time for avoiding multiplying update notifications. - bool isTimeToUpdate(); + bool IsTimeToUpdate(); public: DECLARE_EVENT_TABLE() diff --git a/src/update/UpdatePopupDialog.cpp b/src/update/UpdatePopupDialog.cpp index 12d5ed5e0..1de015590 100644 --- a/src/update/UpdatePopupDialog.cpp +++ b/src/update/UpdatePopupDialog.cpp @@ -45,7 +45,7 @@ UpdatePopupDialog::UpdatePopupDialog (wxWindow* parent, UpdateManager* updateMan S.SetBorder (5); S.Id (DontShowID).AddCheckBox ( - XO ("Don't show this again at start up"), !mUpdateManager->isUpdatesCheckingEnabled()); + XO ("Don't show this again at start up"), !mUpdateManager->IsUpdatesCheckingEnabled()); S.Prop(1).AddSpace(1, 0, 1); @@ -80,7 +80,7 @@ void UpdatePopupDialog::OnSkip (wxCommandEvent&) void UpdatePopupDialog::OnDontShow (wxCommandEvent& event) { - mUpdateManager->enableUpdatesChecking(!event.IsChecked()); + mUpdateManager->EnableUpdatesChecking(!event.IsChecked()); } HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent) @@ -90,7 +90,7 @@ HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent) // i18n-hint Substitution of version number for %s. static const auto title = XC("Audacity %s is available!", "update dialog") - .Format(mUpdateManager->getVersionPatch().version.getString()); + .Format(mUpdateManager->GetVersionPatch().version.GetString()); informationStr << wxT("

") @@ -100,7 +100,7 @@ HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent) << wxT("

"); informationStr << wxT("