MCPcopy Create free account
hub / github.com/audacity/audacity / UpdatePrefs

Method UpdatePrefs

src/update/UpdateManager.cpp:411–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411void UpdateManager::UpdatePrefs()
412{
413 const bool updatedSendAnonymousUsageInfo = SendAnonymousUsageInfo->Read();
414 bool prefsUpdated = false;
415
416 //! Create the instance id if the user allowed it and it was not created before
417 if (updatedSendAnonymousUsageInfo && !mSendAnonymousUsageInfo) {
418 if(InstanceId->Read().IsEmpty()) {
419 InstanceId->Write(audacity::Uuid::Generate().ToHexString());
420 prefsUpdated = true;
421 }
422 }
423 else if (mSendAnonymousUsageInfo && !updatedSendAnonymousUsageInfo) {
424 SendOptOutRequest();
425 }
426
427 mSendAnonymousUsageInfo = updatedSendAnonymousUsageInfo;
428 if (prefsUpdated)
429 gPrefs->Flush();
430}
431
432std::vector<Notification> UpdateManager::GetActiveNotifications() const
433{

Callers 1

StartMethod · 0.45

Calls 6

GenerateFunction · 0.85
ToHexStringMethod · 0.80
ReadMethod · 0.45
IsEmptyMethod · 0.45
WriteMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected