| 409 | } |
| 410 | |
| 411 | void 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 | |
| 432 | std::vector<Notification> UpdateManager::GetActiveNotifications() const |
| 433 | { |