diff --git a/CHANGES b/CHANGES index 7e52ade99..aca969533 100644 --- a/CHANGES +++ b/CHANGES @@ -40,6 +40,7 @@ Misc: - GBA I/O: Clear JOYSTAT RECV flag when reading JOY_RECV registers - GBA I/O: Set JOYSTAT TRANS flag when writing JOY_TRANS registers - Qt: Improved HiDPI support + - Qt: Expose configuration directory 0.5.2: (2016-12-31) Bugfixes: diff --git a/src/platform/qt/ConfigController.cpp b/src/platform/qt/ConfigController.cpp index d008fd756..034f76198 100644 --- a/src/platform/qt/ConfigController.cpp +++ b/src/platform/qt/ConfigController.cpp @@ -94,7 +94,8 @@ ConfigController::ConfigController(QObject* parent) { char path[PATH_MAX]; mCoreConfigDirectory(path, sizeof(path)); - QString fileName(path); + m_configDir = QString::fromUtf8(path); + QString fileName = (m_configDir); fileName.append(QDir::separator()); fileName.append("qt.ini"); m_settings = new QSettings(fileName, QSettings::IniFormat, this); @@ -269,9 +270,7 @@ void ConfigController::write() { void ConfigController::makePortable() { mCoreConfigMakePortable(&m_config); - char path[PATH_MAX]; - mCoreConfigDirectory(path, sizeof(path)); - QString fileName(path); + QString fileName(m_configDir); fileName.append(QDir::separator()); fileName.append("qt.ini"); QSettings* settings2 = new QSettings(fileName, QSettings::IniFormat, this); diff --git a/src/platform/qt/ConfigController.h b/src/platform/qt/ConfigController.h index 2ce8868fd..f98389b76 100644 --- a/src/platform/qt/ConfigController.h +++ b/src/platform/qt/ConfigController.h @@ -84,6 +84,8 @@ public: const mCoreConfig* config() { return &m_config; } + const QString& configDir() { return m_configDir; } + public slots: void setOption(const char* key, bool value); void setOption(const char* key, int value); @@ -103,6 +105,7 @@ private: QMap m_optionSet; QSettings* m_settings; + QString m_configDir; }; }