Qt: Expose configuration directory
Jeffrey Pfau jeffrey@endrift.com
Mon, 09 Jan 2017 23:44:46 -0800
3 files changed,
7 insertions(+),
4 deletions(-)
M
src/platform/qt/ConfigController.cpp
→
src/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.h
→
src/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; }; }