[evolution-data-server/jjardon/libgweather4] Port to libgweather4




commit ce2a3e8857ae48c8eb39995dbbc9e24df9860fd0
Author: Javier Jardón <jjardon gnome org>
Date:   Sat Jan 8 15:30:52 2022 +0000

    Port to libgweather4

 CMakeLists.txt                                        | 12 ++----------
 config.h.in                                           |  3 ---
 src/calendar/backends/weather/e-cal-backend-weather.c |  4 ++--
 src/calendar/backends/weather/e-weather-source.c      |  3 ---
 4 files changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 73f76f8c2..eb88473b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,7 +118,7 @@ set(sqlite_minimum_version 3.7.17)
 
 # Optional Packages
 set(goa_minimum_version 3.8)
-set(gweather_minimum_version 3.10)
+set(gweather_minimum_version 41)
 set(libaccounts_glib_minimum_version 1.4)
 set(libsignon_glib_minimum_version 1.8)
 set(json_glib_minimum_version 1.0.4)
@@ -755,18 +755,10 @@ endif(NOT have_addrinfo)
 add_printable_option(ENABLE_WEATHER "Build the weather calendar backend" ON)
 
 if(ENABLE_WEATHER)
-       pkg_check_modules_for_option(ENABLE_WEATHER "weather calendar backend" LIBGWEATHER 
gweather-3.0>=${gweather_minimum_version})
+       pkg_check_modules_for_option(ENABLE_WEATHER "weather calendar backend" LIBGWEATHER 
gweather4>=${gweather_minimum_version})
 
        set(CMAKE_REQUIRED_INCLUDES ${LIBGWEATHER_INCLUDE_DIRS})
        set(CMAKE_REQUIRED_LIBRARIES ${LIBGWEATHER_LDFLAGS})
-       CHECK_C_SOURCE_COMPILES("#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE
-                               #include <libgweather/gweather.h>
-                               #undef GWEATHER_I_KNOW_THIS_IS_UNSTABLE
-
-                               int main(void) {
-                                       gweather_info_new (NULL);
-                                       return 0;
-                               }" HAVE_ONE_ARG_GWEATHER_INFO_NEW)
        unset(CMAKE_REQUIRED_INCLUDES)
        unset(CMAKE_REQUIRED_LIBRARIES)
 endif(ENABLE_WEATHER)
diff --git a/config.h.in b/config.h.in
index 4e79549ab..0060789ee 100644
--- a/config.h.in
+++ b/config.h.in
@@ -194,9 +194,6 @@
 #define O_LARGEFILE 0
 #endif /* HAVE_O_LARGEFILE */
 
-/* gweather_info_new() has only one argument */
-#cmakedefine HAVE_ONE_ARG_GWEATHER_INFO_NEW 1
-
 /* evolution-alarm-notify - Define if using Canberra-GTK for sound */
 #cmakedefine HAVE_CANBERRA 1
 
diff --git a/src/calendar/backends/weather/e-cal-backend-weather.c 
b/src/calendar/backends/weather/e-cal-backend-weather.c
index 72faccd62..c757e36de 100644
--- a/src/calendar/backends/weather/e-cal-backend-weather.c
+++ b/src/calendar/backends/weather/e-cal-backend-weather.c
@@ -464,7 +464,7 @@ create_weather (ECalBackendWeather *cbw,
        time_t                     update_time;
        ICalTimezone              *update_zone = NULL;
        const GWeatherLocation    *location;
-       const GWeatherTimezone    *w_timezone;
+       const GTimezone           *w_timezone;
        gdouble tmin = 0.0, tmax = 0.0, temp = 0.0;
 
        g_return_val_if_fail (E_IS_CAL_BACKEND_WEATHER (cbw), NULL);
@@ -484,7 +484,7 @@ create_weather (ECalBackendWeather *cbw,
        /* use timezone of the location to determine date for which this is set */
        location = gweather_info_get_location (report);
        if (location && (w_timezone = gweather_location_get_timezone ((GWeatherLocation *) location)))
-               update_zone = i_cal_timezone_get_builtin_timezone (gweather_timezone_get_tzid 
((GWeatherTimezone *) w_timezone));
+               update_zone = i_cal_timezone_get_builtin_timezone (g_time_zone_get_identifier ((GTimezone *) 
w_timezone));
 
        if (!update_zone)
                update_zone = i_cal_timezone_get_utc_timezone ();
diff --git a/src/calendar/backends/weather/e-weather-source.c 
b/src/calendar/backends/weather/e-weather-source.c
index 3052d034c..86ee03d26 100644
--- a/src/calendar/backends/weather/e-weather-source.c
+++ b/src/calendar/backends/weather/e-weather-source.c
@@ -204,9 +204,6 @@ e_weather_source_parse (EWeatherSource *source,
        if (source->priv->info == NULL) {
                source->priv->info = gweather_info_new (
                        source->priv->location
-               #ifndef HAVE_ONE_ARG_GWEATHER_INFO_NEW
-                       , GWEATHER_FORECAST_LIST
-               #endif
                );
                #if GWEATHER_CHECK_VERSION(3, 39, 0)
                gweather_info_set_application_id (source->priv->info, "org.gnome.Evolution-data-server");


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