mirror of https://github.com/mgba-emu/mgba.git
Qt: Expose configuration directory
This commit is contained in:
parent
076855deb1
commit
246142fd55
1
CHANGES
1
CHANGES
|
@ -40,6 +40,7 @@ Misc:
|
||||||
- GBA I/O: Clear JOYSTAT RECV flag when reading JOY_RECV registers
|
- GBA I/O: Clear JOYSTAT RECV flag when reading JOY_RECV registers
|
||||||
- GBA I/O: Set JOYSTAT TRANS flag when writing JOY_TRANS registers
|
- GBA I/O: Set JOYSTAT TRANS flag when writing JOY_TRANS registers
|
||||||
- Qt: Improved HiDPI support
|
- Qt: Improved HiDPI support
|
||||||
|
- Qt: Expose configuration directory
|
||||||
|
|
||||||
0.5.2: (2016-12-31)
|
0.5.2: (2016-12-31)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -94,7 +94,8 @@ ConfigController::ConfigController(QObject* parent)
|
||||||
{
|
{
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
mCoreConfigDirectory(path, sizeof(path));
|
mCoreConfigDirectory(path, sizeof(path));
|
||||||
QString fileName(path);
|
m_configDir = QString::fromUtf8(path);
|
||||||
|
QString fileName = (m_configDir);
|
||||||
fileName.append(QDir::separator());
|
fileName.append(QDir::separator());
|
||||||
fileName.append("qt.ini");
|
fileName.append("qt.ini");
|
||||||
m_settings = new QSettings(fileName, QSettings::IniFormat, this);
|
m_settings = new QSettings(fileName, QSettings::IniFormat, this);
|
||||||
|
@ -269,9 +270,7 @@ void ConfigController::write() {
|
||||||
void ConfigController::makePortable() {
|
void ConfigController::makePortable() {
|
||||||
mCoreConfigMakePortable(&m_config);
|
mCoreConfigMakePortable(&m_config);
|
||||||
|
|
||||||
char path[PATH_MAX];
|
QString fileName(m_configDir);
|
||||||
mCoreConfigDirectory(path, sizeof(path));
|
|
||||||
QString fileName(path);
|
|
||||||
fileName.append(QDir::separator());
|
fileName.append(QDir::separator());
|
||||||
fileName.append("qt.ini");
|
fileName.append("qt.ini");
|
||||||
QSettings* settings2 = new QSettings(fileName, QSettings::IniFormat, this);
|
QSettings* settings2 = new QSettings(fileName, QSettings::IniFormat, this);
|
||||||
|
|
|
@ -84,6 +84,8 @@ public:
|
||||||
|
|
||||||
const mCoreConfig* config() { return &m_config; }
|
const mCoreConfig* config() { return &m_config; }
|
||||||
|
|
||||||
|
const QString& configDir() { return m_configDir; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setOption(const char* key, bool value);
|
void setOption(const char* key, bool value);
|
||||||
void setOption(const char* key, int value);
|
void setOption(const char* key, int value);
|
||||||
|
@ -103,6 +105,7 @@ private:
|
||||||
|
|
||||||
QMap<QString, ConfigOption*> m_optionSet;
|
QMap<QString, ConfigOption*> m_optionSet;
|
||||||
QSettings* m_settings;
|
QSettings* m_settings;
|
||||||
|
QString m_configDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue