summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator/qfunctionconfigurator.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-09-14 16:18:24 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-09-14 16:18:24 +0200
commita847cac005d6e42b302fbc9cb58caa0e9acd4ebd (patch)
treecd39cc10dbb00821d30fa06d4412e6a3ffd1c95a /qfunctionconfigurator/qfunctionconfigurator.cpp
parentb8fd03ece0aca5ac01b04d5df1beee1c93438ec0 (diff)
Fix splines not loading from ini without restart
It's still a mess, though.
Diffstat (limited to 'qfunctionconfigurator/qfunctionconfigurator.cpp')
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp
index 17905752..05ebbc4a 100644
--- a/qfunctionconfigurator/qfunctionconfigurator.cpp
+++ b/qfunctionconfigurator/qfunctionconfigurator.cpp
@@ -89,16 +89,22 @@ QFunctionConfigurator::QFunctionConfigurator(QWidget *parent)
// Attach an existing FunctionConfig to the Widget.
//
void QFunctionConfigurator::setConfig(FunctionConfig* config, QString settingsFile) {
-QPointF currentPoint;
-QPointF drawPoint;
-qreal x;
+ QPointF currentPoint;
+ QPointF drawPoint;
+ qreal x;
- _config = config;
- _points = config->getPoints();
- strSettingsFile = settingsFile; // Remember for Reset()
+ QSettings settings("opentrack"); // Registry settings (in HK_USER)
+ QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
+ QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
+ config->loadSettings(iniFile);
+
+ _config = config;
+
+ _points = config->getPoints();
+ strSettingsFile = settingsFile; // Remember for Reset()
- qDebug() << "QFunctionConfigurator::setConfig" << config->getTitle();
- setCaption(config->getTitle());
+ qDebug() << "QFunctionConfigurator::setConfig" << config->getTitle();
+ setCaption(config->getTitle());
//
// Get the Function Points, one for each pixel in the horizontal range.
@@ -132,7 +138,6 @@ void QFunctionConfigurator::loadSettings(QString settingsFile) {
qDebug() << "QFunctionConfigurator::loadSettings = " << settingsFile;
if (_config) {
_config->loadSettings(iniFile);
- setConfig(_config, settingsFile);
}
}