diff options
author | rbuj <[email protected]> | 2021-12-15 10:59:18 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2021-12-19 11:24:23 +0000 |
commit | eefd98c9bd9965c9022316d1336d914bfb1063ed (patch) | |
tree | 9363248292c752d533d67c5413d3a855db459389 /applets/clock | |
parent | 293948ad80f2f9dddf4af282e2b83b99b2e56014 (diff) | |
download | mate-panel-eefd98c9bd9965c9022316d1336d914bfb1063ed.tar.bz2 mate-panel-eefd98c9bd9965c9022316d1336d914bfb1063ed.tar.xz |
clock: fix temperature_unit_changed and -Wsign-compare warnings
Diffstat (limited to 'applets/clock')
-rw-r--r-- | applets/clock/clock.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c index f589c65b..f806a387 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -1921,7 +1921,8 @@ format_changed (GSettings *settings, gchar *key, ClockData *clock) { - int new_format; + ClockFormat new_format; + new_format = g_settings_get_enum (settings, key); if (!clock->can_handle_format_12 && new_format == CLOCK_FORMAT_12) @@ -2330,11 +2331,13 @@ temperature_unit_changed (GSettings *settings, if (cd->temperature_unit > 0) { GtkWidget *widget; - gint oldvalue; + int oldvalue; + widget = _clock_get_widget (cd, "temperature_combo"); oldvalue = gtk_combo_box_get_active (GTK_COMBO_BOX (widget)) + 2; - if (oldvalue != cd->speed_unit) - gtk_combo_box_set_active (GTK_COMBO_BOX (widget), cd->temperature_unit - 2); + if (((TempUnit) oldvalue) != cd->temperature_unit) + gtk_combo_box_set_active (GTK_COMBO_BOX (widget), + cd->temperature_unit - 2); } update_weather_locations (cd); } @@ -2348,11 +2351,14 @@ speed_unit_changed (GSettings *settings, if (cd->speed_unit > 0) { GtkWidget *widget; - gint oldvalue; + int oldvalue; + widget = _clock_get_widget (cd, "wind_speed_combo"); oldvalue = gtk_combo_box_get_active (GTK_COMBO_BOX (widget)) + 2; - if (oldvalue != cd->speed_unit) - gtk_combo_box_set_active (GTK_COMBO_BOX (widget), cd->speed_unit - 2); + + if (((SpeedUnit) oldvalue) != cd->speed_unit) + gtk_combo_box_set_active (GTK_COMBO_BOX (widget), + cd->speed_unit - 2); } update_weather_locations (cd); } |