diff --git a/debian/patches/0007-demo-Don-t-use-GTimeVal-and-g_date_time_new_from_tim.patch b/debian/patches/0007-demo-Don-t-use-GTimeVal-and-g_date_time_new_from_tim.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c6bce86acd5298c1107685ea4df5a1d3e29aa25 --- /dev/null +++ b/debian/patches/0007-demo-Don-t-use-GTimeVal-and-g_date_time_new_from_tim.patch @@ -0,0 +1,36 @@ +From 9ffb0cae3d3d32b60ec226818bb24582a3c0f5e4 Mon Sep 17 00:00:00 2001 +From: Teemu Ikonen <tpikonen@mailbox.org> +Date: Wed, 20 Oct 2021 17:54:08 +0300 +Subject: demo: Don't use GTimeVal and g_date_time_new_from_timeval_local + +They have been deprecated since GLib version 2.62. + +diff --git a/demo/where-am-i.c b/demo/where-am-i.c +index 4c1c2c3..eaf0f65 100644 +--- a/demo/where-am-i.c ++++ b/demo/where-am-i.c +@@ -84,7 +84,6 @@ print_location (GClueSimple *simple) + GClueLocation *location; + gdouble altitude, speed, heading; + GVariant *timestamp; +- GTimeVal tv = { 0 }; + const char *desc; + + location = gclue_simple_get_location (simple); +@@ -111,11 +110,13 @@ print_location (GClueSimple *simple) + timestamp = gclue_location_get_timestamp (location); + if (timestamp) { + GDateTime *date_time; ++ guint64 sec, usec; + gchar *str; + +- g_variant_get (timestamp, "(tt)", &tv.tv_sec, &tv.tv_usec); ++ g_variant_get (timestamp, "(tt)", &sec, &usec); + +- date_time = g_date_time_new_from_timeval_local (&tv); ++ /* Ignore usec, since it is not in the output format */ ++ date_time = g_date_time_new_from_unix_local ((gint64) sec); + str = g_date_time_format + (date_time, + "%c (%s seconds since the Epoch)"); + diff --git a/debian/patches/series b/debian/patches/series index a63e7502c3c20f3c90c37132e06d503994697fb6..47784efa0b40372dfee3c3e58c05ff2de322b243 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ 0002-config-Make-the-Mozilla-API-key-configurable.patch 0003-service-Sync-in_use-property-when-apps-get-connected.patch 0005-config-Clear-error-after-submission-URL-lookup-fails.patch +0007-demo-Don-t-use-GTimeVal-and-g_date_time_new_from_tim.patch