From 70910a6713fed1996afbde69d0be18ac55ae8244 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 1 Jan 2020 09:22:41 +0100 Subject: [PATCH] libmm-glib,nmea: deprecate mm_location_gps_nmea_build_full() The new mm_location_gps_nmea_get_traces() is a much more generic way to retrieve the full list of traces and suits the libmm-glib API much better. --- libmm-glib/mm-location-gps-nmea.c | 9 ++++++++- libmm-glib/mm-location-gps-nmea.h | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libmm-glib/mm-location-gps-nmea.c b/libmm-glib/mm-location-gps-nmea.c index 8bc7db90..6b6b95c4 100644 --- a/libmm-glib/mm-location-gps-nmea.c +++ b/libmm-glib/mm-location-gps-nmea.c @@ -188,6 +188,8 @@ mm_location_gps_nmea_get_traces (MMLocationGpsNmea *self) /*****************************************************************************/ +#ifndef MM_DISABLE_DEPRECATED + static void build_full_foreach (const gchar *trace_type, const gchar *trace, @@ -203,12 +205,15 @@ build_full_foreach (const gchar *trace_type, * mm_location_gps_nmea_build_full: * @self: a #MMLocationGpsNmea. * - * Gets a compilation of all cached traces. + * Gets a compilation of all cached traces, in a single string. + * Traces are separated by '\r\n'. * * Returns: (transfer full): a string containing all traces, or #NULL if none * available. The returned value should be freed with g_free(). * * Since: 1.0 + * Deprecated: 1.14: user should use mm_location_gps_nmea_get_traces() instead, + * which provides a much more generic interface to the full list of traces. */ gchar * mm_location_gps_nmea_build_full (MMLocationGpsNmea *self) @@ -222,6 +227,8 @@ mm_location_gps_nmea_build_full (MMLocationGpsNmea *self) return g_string_free (built, FALSE); } +#endif + /*****************************************************************************/ /** diff --git a/libmm-glib/mm-location-gps-nmea.h b/libmm-glib/mm-location-gps-nmea.h index 286069c3..ba90788c 100644 --- a/libmm-glib/mm-location-gps-nmea.h +++ b/libmm-glib/mm-location-gps-nmea.h @@ -62,7 +62,11 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocationGpsNmea, g_object_unref) const gchar *mm_location_gps_nmea_get_trace (MMLocationGpsNmea *self, const gchar *trace_type); gchar **mm_location_gps_nmea_get_traces (MMLocationGpsNmea *self); -gchar *mm_location_gps_nmea_build_full (MMLocationGpsNmea *self); + +#ifndef MM_DISABLE_DEPRECATED +G_DEPRECATED_FOR(mm_location_gps_nmea_get_traces) +gchar *mm_location_gps_nmea_build_full (MMLocationGpsNmea *self); +#endif /*****************************************************************************/ /* ModemManager/libmm-glib/mmcli specific methods */