Skip to content

Commit adf3e38

Browse files
committed
fix: Fix where we store the QSettings ini file
1 parent 22c9f68 commit adf3e38

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

ozwadmin-main/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ int main(int argc, char *argv[])
101101

102102
parser.process(a);
103103

104+
105+
106+
#ifdef Q_OS_UNIX
107+
if (parser.isSet(userDir)) {
108+
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, parser.value(userDir).append("ozw-admin.ini"));
109+
qCDebug(ozwadmin) << "Settings Path is at " << QSettings().fileName();
110+
}
111+
#endif
104112
QSettings settings;
105113

106114
QString dbPath, userPath;
@@ -240,7 +248,6 @@ int main(int argc, char *argv[])
240248
qCInfo(ozwadmin) << "DBPath: " << dbPath;
241249
qCInfo(ozwadmin) << "userPath: " << userPath;
242250

243-
244251
MainWindow w;
245252
w.show();
246253
if (parser.isSet(serialPort)) {

ozwadmin-main/ozwcore.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ QTOZWManager *OZWCore::getQTOZWManager() {
4343
SettingsManager::SettingsManager(QObject *parent) :
4444
QObject(parent)
4545
{
46+
qCDebug(ozwadmin) << "Settings Path: " << m_settings.fileName();
47+
4648
bool ok;
4749
int size = qEnvironmentVariableIntValue("QTRO_NODES_CACHE_SIZE", &ok);
4850
if (!ok) {
@@ -57,7 +59,6 @@ SettingsManager::SettingsManager(QObject *parent) :
5759

5860
setLogBufferSize(logBufferSize());
5961
setRetriveLogBuffer(retriveLogBuffer());
60-
6162
}
6263
SettingsManager::~SettingsManager()
6364
{

0 commit comments

Comments
 (0)