mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-11-20 16:32:29 +00:00
DolphinAnalytics: Reload backend when config changes
Co-Authored-By: OatmealDome <julian@oatmealdome.me>
This commit is contained in:
parent
5af9bd5e46
commit
f9b167d8c6
@ -58,6 +58,13 @@ DolphinAnalytics::DolphinAnalytics()
|
||||
{
|
||||
ReloadConfig();
|
||||
MakeBaseBuilder();
|
||||
|
||||
m_config_changed_callback_id = Config::AddConfigChangedCallback([this] { ReloadConfig(); });
|
||||
}
|
||||
|
||||
DolphinAnalytics::~DolphinAnalytics()
|
||||
{
|
||||
Config::RemoveConfigChangedCallback(m_config_changed_callback_id);
|
||||
}
|
||||
|
||||
DolphinAnalytics& DolphinAnalytics::Instance()
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
#include "Common/Analytics.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Config/Config.h"
|
||||
|
||||
#if defined(ANDROID)
|
||||
#include <functional>
|
||||
@ -108,6 +109,9 @@ class DolphinAnalytics
|
||||
public:
|
||||
// Performs lazy-initialization of a singleton and returns the instance.
|
||||
static DolphinAnalytics& Instance();
|
||||
DolphinAnalytics(const DolphinAnalytics&) = delete;
|
||||
DolphinAnalytics& operator=(const DolphinAnalytics&) = delete;
|
||||
~DolphinAnalytics();
|
||||
|
||||
#if defined(ANDROID)
|
||||
// Get value from java.
|
||||
@ -198,4 +202,5 @@ private:
|
||||
|
||||
std::mutex m_reporter_mutex;
|
||||
Common::AnalyticsReporter m_reporter;
|
||||
Config::ConfigChangedCallbackID m_config_changed_callback_id{};
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user