mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01: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_EnableHighDpiScaling);
|
||||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
|
QCoreApplication::setOrganizationName(QStringLiteral("Dolphin Emulator"));
|
||||||
|
QCoreApplication::setOrganizationDomain(QStringLiteral("dolphin-emu.org"));
|
||||||
|
QCoreApplication::setApplicationName(QStringLiteral("dolphin"));
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QSettings>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
|
|
||||||
#include "AudioCommon/AudioCommon.h"
|
#include "AudioCommon/AudioCommon.h"
|
||||||
@ -13,15 +14,7 @@
|
|||||||
#include "DolphinQt2/Settings.h"
|
#include "DolphinQt2/Settings.h"
|
||||||
#include "InputCommon/InputConfig.h"
|
#include "InputCommon/InputConfig.h"
|
||||||
|
|
||||||
Settings::Settings()
|
Settings::Settings() = default;
|
||||||
:
|
|
||||||
#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::Instance()
|
Settings& Settings::Instance()
|
||||||
{
|
{
|
||||||
@ -81,22 +74,22 @@ void Settings::RemovePath(const QString& qpath)
|
|||||||
|
|
||||||
bool Settings::GetPreferredView() const
|
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)
|
void Settings::SetPreferredView(bool table)
|
||||||
{
|
{
|
||||||
m_native_settings.setValue(QStringLiteral("PreferredView"), table);
|
QSettings().setValue(QStringLiteral("PreferredView"), table);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Settings::GetStateSlot() const
|
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)
|
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)
|
void Settings::SetHideCursor(bool hide_cursor)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QObject>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
#include "Common/NonCopyable.h"
|
#include "Common/NonCopyable.h"
|
||||||
@ -64,5 +64,4 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Settings();
|
Settings();
|
||||||
QSettings m_native_settings;
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user