mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 15:48:51 +00:00
DolphinQt2: make Settings a singleton
With this, we can get signals when properties change.
This commit is contained in:
parent
95ef785b1f
commit
548522877a
15 changed files with 109 additions and 89 deletions
|
@ -34,8 +34,9 @@ int main(int argc, char* argv[])
|
|||
QObject::connect(QAbstractEventDispatcher::instance(), &QAbstractEventDispatcher::aboutToBlock,
|
||||
&app, &Core::HostDispatchJobs);
|
||||
|
||||
auto& settings = Settings::Instance();
|
||||
int retval = 0;
|
||||
if (Settings().IsInDevelopmentWarningEnabled())
|
||||
if (settings.IsInDevelopmentWarningEnabled())
|
||||
{
|
||||
InDevelopmentWarning warning_box;
|
||||
retval = warning_box.exec() == QDialog::Rejected;
|
||||
|
@ -48,7 +49,7 @@ int main(int argc, char* argv[])
|
|||
win.show();
|
||||
|
||||
#if defined(USE_ANALYTICS) && USE_ANALYTICS
|
||||
if (!Settings().HasAskedForAnalyticsPermission())
|
||||
if (!settings.HasAskedForAnalyticsPermission())
|
||||
{
|
||||
QMessageBox analytics_prompt(&win);
|
||||
|
||||
|
@ -69,9 +70,9 @@ int main(int argc, char* argv[])
|
|||
|
||||
const int answer = analytics_prompt.exec();
|
||||
|
||||
Settings().SetAskedForAnalyticsPermission(true);
|
||||
Settings().SetAnalyticsEnabled(answer == QMessageBox::Yes);
|
||||
Settings().Save();
|
||||
settings.SetAskedForAnalyticsPermission(true);
|
||||
settings.SetAnalyticsEnabled(answer == QMessageBox::Yes);
|
||||
settings.Save();
|
||||
|
||||
DolphinAnalytics::Instance()->ReloadConfig();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue