From 234ab6f7598dbb9734836fafc42860da7df3e6a5 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Wed, 5 Jul 2017 17:35:47 -0700 Subject: [PATCH] DolphinQt2: set QSettings parameters globally --- Source/Core/DolphinQt2/Main.cpp | 3 +++ Source/Core/DolphinQt2/Settings.cpp | 19 ++++++------------- Source/Core/DolphinQt2/Settings.h | 3 +-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Source/Core/DolphinQt2/Main.cpp b/Source/Core/DolphinQt2/Main.cpp index 192527e8dc..7c4c757624 100644 --- a/Source/Core/DolphinQt2/Main.cpp +++ b/Source/Core/DolphinQt2/Main.cpp @@ -25,6 +25,9 @@ int main(int argc, char* argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + QCoreApplication::setOrganizationName(QStringLiteral("Dolphin Emulator")); + QCoreApplication::setOrganizationDomain(QStringLiteral("dolphin-emu.org")); + QCoreApplication::setApplicationName(QStringLiteral("dolphin")); QApplication app(argc, argv); diff --git a/Source/Core/DolphinQt2/Settings.cpp b/Source/Core/DolphinQt2/Settings.cpp index 20a0445810..6e3907a52c 100644 --- a/Source/Core/DolphinQt2/Settings.cpp +++ b/Source/Core/DolphinQt2/Settings.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include #include "AudioCommon/AudioCommon.h" @@ -13,15 +14,7 @@ #include "DolphinQt2/Settings.h" #include "InputCommon/InputConfig.h" -Settings::Settings() - : -#ifdef Q_OS_MAC - m_native_settings(QStringLiteral("dolphin-emu.org"), QStringLiteral("dolphin")) -#else - m_native_settings(QStringLiteral("Dolphin Emulator"), QStringLiteral("Dolphin")) -#endif -{ -} +Settings::Settings() = default; Settings& Settings::Instance() { @@ -81,22 +74,22 @@ void Settings::RemovePath(const QString& qpath) bool Settings::GetPreferredView() const { - return m_native_settings.value(QStringLiteral("PreferredView"), true).toBool(); + return QSettings().value(QStringLiteral("PreferredView"), true).toBool(); } void Settings::SetPreferredView(bool table) { - m_native_settings.setValue(QStringLiteral("PreferredView"), table); + QSettings().setValue(QStringLiteral("PreferredView"), table); } int Settings::GetStateSlot() const { - return m_native_settings.value(QStringLiteral("Emulation/StateSlot"), 1).toInt(); + return QSettings().value(QStringLiteral("Emulation/StateSlot"), 1).toInt(); } void Settings::SetStateSlot(int slot) { - m_native_settings.setValue(QStringLiteral("Emulation/StateSlot"), slot); + QSettings().setValue(QStringLiteral("Emulation/StateSlot"), slot); } void Settings::SetHideCursor(bool hide_cursor) diff --git a/Source/Core/DolphinQt2/Settings.h b/Source/Core/DolphinQt2/Settings.h index 5adc95dd8f..ca953b2d04 100644 --- a/Source/Core/DolphinQt2/Settings.h +++ b/Source/Core/DolphinQt2/Settings.h @@ -4,7 +4,7 @@ #pragma once -#include +#include #include #include "Common/NonCopyable.h" @@ -64,5 +64,4 @@ signals: private: Settings(); - QSettings m_native_settings; };