all repos — mgba @ 246142fd551a1e8ba3cd41a49a1821505ed874da

mGBA Game Boy Advance Emulator

Qt: Expose configuration directory
Jeffrey Pfau jeffrey@endrift.com
Mon, 09 Jan 2017 23:44:46 -0800
commit

246142fd551a1e8ba3cd41a49a1821505ed874da

parent

076855deb184cee21c75b691acc7a1d35fdc744a

3 files changed, 7 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -40,6 +40,7 @@ - All: Add C++ header guards

- 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:
M src/platform/qt/ConfigController.cppsrc/platform/qt/ConfigController.cpp

@@ -94,7 +94,8 @@ , m_opts()

{ 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::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);
M src/platform/qt/ConfigController.hsrc/platform/qt/ConfigController.h

@@ -84,6 +84,8 @@ Configuration* input() { return mCoreConfigGetInput(&m_config); }

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 @@ mCoreOptions m_opts;

QMap<QString, ConfigOption*> m_optionSet; QSettings* m_settings; + QString m_configDir; }; }