diff options
author | Tomaz Canabrava <tomaz.canabrava@gmail.com> | 2016-08-10 18:10:15 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-08-27 11:40:44 -0700 |
commit | db8e8957abc8b8dc407a94835e686f649c9643a6 (patch) | |
tree | 5c21bd7e9a4174704e1c53752146c1229464b2bc /desktop-widgets/mainwindow.cpp | |
parent | b264c3e36704c83a6c9353fe5eac3dc0eb3c9a80 (diff) | |
download | subsurface-db8e8957abc8b8dc407a94835e686f649c9643a6.tar.gz |
Settings update: Add "Dive Computer" settings to SettingsObjectWrapper
For some reason, the dive computer settings weren't in the
settings prefs. This moves it, makes the boilerplate on Settings
ObjectWrapper and make things compile.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 868545600..78faaadc5 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -1305,33 +1305,17 @@ void MainWindow::initialUiSetup() show(); } -const char *getSetting(const QSettings &s,const QString& name) -{ - QVariant v; - v = s.value(name); - if (v.isValid()) { - return strdup(v.toString().toUtf8().data()); - } - return NULL; -} - void MainWindow::readSettings() { static bool firstRun = true; - - QSettings s; //WARNING: Why those prefs are not on the prefs struct? - s.beginGroup("DiveComputer"); - default_dive_computer_vendor = getSetting(s, "dive_computer_vendor"); - default_dive_computer_product = getSetting(s, "dive_computer_product"); - default_dive_computer_device = getSetting(s, "dive_computer_device"); - default_dive_computer_download_mode = s.value("dive_computer_download_mode").toInt(); - s.endGroup(); init_proxy(); // now make sure that the cloud menu items are enabled IFF cloud account is verified enableDisableCloudActions(); #if !defined(SUBSURFACE_MOBILE) + QSettings s; //TODO: this 's' exists only for the loadRecentFiles, remove it. + loadRecentFiles(&s); if (firstRun) { checkSurvey(&s); |