[gnome-panel/wip/applets/clock: 13/15] clock: update clock_location_setup_weather_tooltip



commit a0f932145b879d50610c1504c7516b416106451f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Nov 10 05:58:38 2014 +0200

    clock: update clock_location_setup_weather_tooltip

 applets/clock/clock-location-tile.c |    3 +--
 applets/clock/clock-location.c      |   13 ++++++++-----
 applets/clock/clock-location.h      |    5 ++---
 applets/clock/clock.c               |    4 +---
 4 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/applets/clock/clock-location-tile.c b/applets/clock/clock-location-tile.c
index f2d8b04..a114a80 100644
--- a/applets/clock/clock-location-tile.c
+++ b/applets/clock/clock-location-tile.c
@@ -186,8 +186,7 @@ show_weather_tooltip (GtkWidget  *widget,
        tile = CLOCK_LOCATION_TILE (user_data);
 
        return clock_location_setup_weather_tooltip (tile->priv->location,
-                                                    tooltip,
-                                                    clock_location_get_clock_format (tile->priv->location));
+                                                    tooltip);
 }
 
 static void
diff --git a/applets/clock/clock-location.c b/applets/clock/clock-location.c
index 2c964e5..e6d1fb9 100644
--- a/applets/clock/clock-location.c
+++ b/applets/clock/clock-location.c
@@ -666,9 +666,8 @@ clock_location_get_clock_format (ClockLocation *location)
 }
 
 gboolean
-clock_location_setup_weather_tooltip (ClockLocation       *location,
-                                      GtkTooltip          *tooltip,
-                                      GDesktopClockFormat  clock_format)
+clock_location_setup_weather_tooltip (ClockLocation *location,
+                                      GtkTooltip    *tooltip)
 {
        GWeatherInfo *info;
         GdkPixbuf *pixbuf = NULL;
@@ -725,11 +724,15 @@ clock_location_setup_weather_tooltip (ClockLocation       *location,
 
        timezone = clock_location_get_tzname (location);
        if (gweather_info_get_value_sunrise (info, &sunrise_time))
-               sunrise_str = convert_time_to_str (sunrise_time, clock_format, timezone);
+               sunrise_str = convert_time_to_str (sunrise_time,
+                                                  location->priv->clock_format,
+                                                  timezone);
        else
                sunrise_str = g_strdup ("???");
        if (gweather_info_get_value_sunset (info, &sunset_time))
-               sunset_str = convert_time_to_str (sunset_time, clock_format, timezone);
+               sunset_str = convert_time_to_str (sunset_time,
+                                                 location->priv->clock_format,
+                                                 timezone);
        else
                sunset_str = g_strdup ("???");
        line4 = g_strdup_printf (_("Sunrise: %s / Sunset: %s"),
diff --git a/applets/clock/clock-location.h b/applets/clock/clock-location.h
index 9f4e438..2cee4a3 100644
--- a/applets/clock/clock-location.h
+++ b/applets/clock/clock-location.h
@@ -104,9 +104,8 @@ glong clock_location_get_offset (ClockLocation *loc);
 
 GDesktopClockFormat  clock_location_get_clock_format (ClockLocation *location);
 
-gboolean clock_location_setup_weather_tooltip (ClockLocation       *location,
-                                               GtkTooltip          *tip,
-                                               GDesktopClockFormat  clock_format);
+gboolean             clock_location_setup_weather_tooltip (ClockLocation *location,
+                                                           GtkTooltip    *tip);
 
 G_END_DECLS
 
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index 2faa06b..0e0c2f0 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -863,9 +863,7 @@ weather_tooltip (GtkWidget   *widget,
                         gboolean ok;
 
                         ok = clock_location_setup_weather_tooltip (location,
-                                                                   tooltip,
-                                                                   g_settings_get_enum (cd->clock_settings,
-                                                                   "clock-format"));
+                                                                   tooltip);
                         if (ok == FALSE)
                                 continue;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]