mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #5755 from ligfx/qtglobalorganizationname
DolphinQt2: set QSettings parameters globally
This commit is contained in:
commit
a621a1bc2f
@ -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);
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <QSize>
|
||||
|
||||
#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)
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QSettings>
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
|
||||
#include "Common/NonCopyable.h"
|
||||
@ -64,5 +64,4 @@ signals:
|
||||
|
||||
private:
|
||||
Settings();
|
||||
QSettings m_native_settings;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user