summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-01-10 17:26:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-10 20:30:32 -0800
commit868a2cc0905b719cb5f3eaf15f0550d6ce82dbeb (patch)
treef7cca241ff73a2ae6c38c975911b3beae5cc1406 /info.c
parent4c13f1f6b4ad7deb2071fb4848ddf43be0af4db7 (diff)
downloadsubsurface-868a2cc0905b719cb5f3eaf15f0550d6ce82dbeb.tar.gz
Split up preference data structure definition into 'pref.h'
.. and rename the badly named 'output_units/input_units' variables. We used to have this confusing thing where we had two different units (input vs output) that *look* like they are mirror images, but in fact "output_units" was the user units, and "input_units" are the XML parsing units. So this renames them to be clearer. "output_units" is now just "units" (it's the units a user would ever see), and "input_units" is now "xml_parsing_units" and set by the XML file parsers to reflect the units of the parsed file. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/info.c b/info.c
index 26b664f3e..9deaa3901 100644
--- a/info.c
+++ b/info.c
@@ -450,7 +450,7 @@ static void save_dive_info_changes(struct dive *dive, struct dive *master, struc
new_text = (char *)gtk_entry_get_text(info->airtemp);
if(sscanf(new_text, "%lf", &newtemp) == 1) {
unsigned long mkelvin;
- switch (prefs.output_units.temperature) {
+ switch (prefs.units.temperature) {
case CELSIUS:
mkelvin = C_to_mkelvin(newtemp);
break;
@@ -895,8 +895,8 @@ static timestamp_t dive_time_widget(struct dive *dive)
gtk_box_pack_end(GTK_BOX(box), duration, FALSE, FALSE, 0);
/* Depth box */
- box = frame_box(hbox, _("Depth (%s):"), prefs.output_units.length == FEET ? _("ft") : _("m"));
- if (prefs.output_units.length == FEET) {
+ box = frame_box(hbox, _("Depth (%s):"), prefs.units.length == FEET ? _("ft") : _("m"));
+ if (prefs.units.length == FEET) {
depthinterval = 1.0;
} else {
depthinterval = 0.1;
@@ -922,7 +922,7 @@ static timestamp_t dive_time_widget(struct dive *dive)
tm.tm_min = gtk_spin_button_get_value(GTK_SPIN_BUTTON(m));
val = gtk_spin_button_get_value(GTK_SPIN_BUTTON(depth));
- if (prefs.output_units.length == FEET) {
+ if (prefs.units.length == FEET) {
dive->maxdepth.mm = feet_to_mm(val);
} else {
dive->maxdepth.mm = val * 1000 + 0.5;