1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Add Audacuty naming style and fix macOS assertion.

This commit is contained in:
gera 2021-06-16 18:15:34 +03:00 committed by Paul Licameli
parent ec0554e131
commit d6f95c8575
7 changed files with 22 additions and 22 deletions

View File

@ -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:

View File

@ -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 };
};

View File

@ -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());

View File

@ -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()

View File

@ -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("<html><body><h3>")
@ -100,7 +100,7 @@ HtmlWindow* UpdatePopupDialog::AddHtmlContent (wxWindow* parent)
<< wxT("</h5><p>");
informationStr << wxT("<ul>");
for (auto& logLine : mUpdateManager->getVersionPatch().changelog)
for (auto& logLine : mUpdateManager->GetVersionPatch().changelog)
{
informationStr << wxT("<li>");
// We won't to translate downloaded text.

View File

@ -43,7 +43,7 @@ VersionId VersionId::ParseFromString(wxString& versionString)
);
}
wxString VersionId::getString() const
wxString VersionId::GetString() const
{
return MakeString(mVersion, mRelease, mRevision);
}

View File

@ -28,7 +28,7 @@ public:
static VersionId ParseFromString(wxString& versionString);
/// Make string with version by MakeString() from instance values.
wxString getString() const;
wxString GetString() const;
bool operator== (const VersionId& other);
bool operator!= (const VersionId& other);