From 08ba648a4f59d7eb8aa1315a513bb2d4fe645cba Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 10 Oct 2016 18:39:32 +0200 Subject: [client] Get rid of SYSTEM_SETTINGS macro, move to ClientApp --- src/client/clientapp/clientapp.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/client/clientapp/clientapp.cpp') diff --git a/src/client/clientapp/clientapp.cpp b/src/client/clientapp/clientapp.cpp index e1ef22c..5786e03 100644 --- a/src/client/clientapp/clientapp.cpp +++ b/src/client/clientapp/clientapp.cpp @@ -44,7 +44,9 @@ QStringList ClientApp::parseParameters() _connectionMode = ConnectionMode::Auto; } else if (a.startsWith("--session=")) { _connectionMode = ConnectionMode::Session; - _sessionName = a.replace("--session=", ""); + _sessionName = a.mid(10); + } else if (a.startsWith("--config=")) { + _iniPath = a.mid(9); } else { rest << a; } @@ -56,3 +58,18 @@ QStringList ClientApp::arguments() { return _arguments; } + +QSharedPointer ClientApp::getSettings() +{ + QSharedPointer set; + if (_iniPath == "") { + /* default location (system scope) */ + set = QSharedPointer(new QSettings(QSettings::IniFormat, QSettings::SystemScope, "openslx/pvs2", "pvs2")); + } else { + /* use _iniPath to find ini file */ + set = QSharedPointer(new QSettings(_iniPath, QSettings::IniFormat)); + } + set->setIniCodec("UTF-8"); + return set; +} + -- cgit v1.2.3-55-g7522