summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2022-01-08 15:30:52 +0000
committerJavier Jardón <jjardon@gnome.org>2022-01-08 17:25:02 +0000
commitfaff42076ad5f35886ecddd3138d8a4c4cb4736d (patch)
tree30ec3b08c45adf940f3ecd97d658fd9e01ee9a79
parent2d562b1610640fb6f5ca3b2664db76a4492e5def (diff)
downloadevolution-data-server-jjardon/libgweather4.tar.gz
Port to libgweather4jjardon/libgweather4
-rw-r--r--CMakeLists.txt12
-rw-r--r--config.h.in3
-rw-r--r--src/calendar/backends/weather/e-cal-backend-weather.c4
-rw-r--r--src/calendar/backends/weather/e-weather-source.c30
4 files changed, 8 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 73f76f8c2..5812f56c2 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 3.91.0)
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..abab67fd9 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;
+ 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 (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..18fccbf53 100644
--- a/src/calendar/backends/weather/e-weather-source.c
+++ b/src/calendar/backends/weather/e-weather-source.c
@@ -39,8 +39,7 @@ weather_source_dispose (GObject *object)
EWeatherSourcePrivate *priv;
priv = E_WEATHER_SOURCE (object)->priv;
- g_clear_pointer (&priv->location, gweather_location_unref);
-
+ g_clear_object (&priv->location);
g_clear_object (&priv->info);
/* Chain up to parent's dispose() method. */
@@ -85,31 +84,20 @@ weather_source_find_location_by_coords (GWeatherLocation *start,
gweather_location_get_coords (location, &lat, &lon);
if (lat == latitude && lon == longitude) {
- gweather_location_ref (location);
+ g_object_ref (location);
return location;
}
}
- #if GWEATHER_CHECK_VERSION(3, 39, 0)
while (child = gweather_location_next_child (location, child), child) {
GWeatherLocation *result;
result = weather_source_find_location_by_coords (child, latitude, longitude);
if (result) {
- gweather_location_unref (child);
+ g_object_unref (child);
return result;
}
}
- #else
- children = gweather_location_get_children (location);
- for (ii = 0; children[ii]; ii++) {
- location = weather_source_find_location_by_coords (children[ii], latitude, longitude);
- if (location) {
- gweather_location_ref (location);
- return location;
- }
- }
- #endif
return NULL;
}
@@ -143,11 +131,6 @@ e_weather_source_new (const gchar *location)
glocation = gweather_location_find_by_station_code (world, tokens[0]);
-#if !GWEATHER_CHECK_VERSION(3, 39, 0)
- if (glocation)
- gweather_location_ref (glocation);
-#endif
-
if (!glocation) {
gdouble latitude, longitude;
gchar *endptr = NULL;
@@ -159,9 +142,7 @@ e_weather_source_new (const gchar *location)
}
}
-#if GWEATHER_CHECK_VERSION(3, 39, 0)
- gweather_location_unref (world);
-#endif
+ g_object_unref (world);
g_strfreev (tokens);
if (glocation == NULL)
@@ -204,9 +185,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");