Qt: Expose configuration directory

This commit is contained in:
Jeffrey Pfau 2017-01-09 23:44:46 -08:00
parent 076855deb1
commit 246142fd55
3 changed files with 7 additions and 4 deletions

View File

@ -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:

View File

@ -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);

View File

@ -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<QString, ConfigOption*> m_optionSet;
QSettings* m_settings;
QString m_configDir;
};
}