Commit 5325e179 authored by Harald Judt's avatar Harald Judt

Config dialog: Set altitude to 0 when detection failed.

parent 690fbb91
......@@ -237,15 +237,14 @@ cb_lookup_altitude(SoupSession *session,
if (altitude) {
alt = string_to_double(altitude->altitude, -9999);
weather_debug("Altitude returned by GeoNames: %.0f meters", alt);
if (alt >= -420) {
if (dialog->pd->units->altitude == FEET)
alt /= 0.3048;
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->spin_alt),
alt);
}
xml_altitude_free(altitude);
}
weather_debug("Altitude returned by GeoNames: %.0f meters", alt);
if (alt < -420)
alt = 0;
else if (dialog->pd->units->altitude == FEET)
alt /= 0.3048;
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->spin_alt), alt);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment