Use the default cylinder if defined

With this every cylinder downloaded from a divecomputer that doesn't
provide cylinder data, and every cylinder manually added anywhere will
default to the default cylinder that is set in the preferences.

For people who most of the time dive with the same equipment (always on
dive boats with AL80, or almost always diving their personal HP119) this
should be a nice improvement.

If you don't like this behavior, simply leave the default cylinder setting
in the preferences empty.

This commit also fixes the incorrect s->value call (should be
s->setValue). I wonder what this did to the default filename before...

Fixes #145

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-23 21:54:51 -08:00
parent 8e5c222e98
commit 904c20feef
2 changed files with 20 additions and 6 deletions

View file

@ -139,8 +139,8 @@ void PreferencesDialog::syncSettings()
s.endGroup();
// Defaults
s.beginGroup("GeneralSettings");
s.value("default_filename", ui.defaultfilename->text());
s.value("default_cylinder", ui.defaultcylinder->text());
s.setValue("default_filename", ui.defaultfilename->text());
s.setValue("default_cylinder", ui.defaultcylinder->text());
s.endGroup();
s.beginGroup("Display");