diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-06-25 11:24:20 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-06-25 19:01:06 +0200 |
commit | 6363add86a3a848be08def62f5c14f683fb0de34 (patch) | |
tree | ee423fc380666b39da2094038830c8be5d7f1560 /libmm-glib | |
parent | b38586a12cd1aca12ebdfa363f2c48773a7ca13b (diff) |
libmm-glib,location-gps-nmea: move deprecated methods to compat source
Diffstat (limited to 'libmm-glib')
-rw-r--r-- | libmm-glib/mm-compat.c | 11 | ||||
-rw-r--r-- | libmm-glib/mm-compat.h | 20 | ||||
-rw-r--r-- | libmm-glib/mm-location-gps-nmea.c | 43 | ||||
-rw-r--r-- | libmm-glib/mm-location-gps-nmea.h | 5 |
4 files changed, 31 insertions, 48 deletions
diff --git a/libmm-glib/mm-compat.c b/libmm-glib/mm-compat.c index 22c63d21..6d6c95d1 100644 --- a/libmm-glib/mm-compat.c +++ b/libmm-glib/mm-compat.c @@ -106,6 +106,17 @@ mm_call_properties_get_state_reason (MMCallProperties *self) /*****************************************************************************/ +gchar * +mm_location_gps_nmea_build_full (MMLocationGpsNmea *self) +{ + g_auto(GStrv) traces = NULL; + + traces = mm_location_gps_nmea_get_traces (self); + return (traces ? g_strjoinv ("\r\n", traces) : g_strdup ("")); +} + +/*****************************************************************************/ + gboolean mm_modem_get_pending_network_initiated_sessions (MMModemOma *self, MMOmaPendingNetworkInitiatedSession **sessions, diff --git a/libmm-glib/mm-compat.h b/libmm-glib/mm-compat.h index 07a655ec..3d94e9a1 100644 --- a/libmm-glib/mm-compat.h +++ b/libmm-glib/mm-compat.h @@ -32,6 +32,7 @@ #include "mm-simple-connect-properties.h" #include "mm-bearer-properties.h" #include "mm-call-properties.h" +#include "mm-location-gps-nmea.h" #include "mm-modem-oma.h" /** @@ -210,6 +211,25 @@ MMCallState mm_call_properties_get_state (MMCallProperties *self); /*****************************************************************************/ /** + * mm_location_gps_nmea_build_full: + * @self: a #MMLocationGpsNmea. + * + * 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. + */ +G_DEPRECATED_FOR(mm_location_gps_nmea_get_traces) +gchar *mm_location_gps_nmea_build_full (MMLocationGpsNmea *self); + +/*****************************************************************************/ + +/** * mm_modem_get_pending_network_initiated_sessions: * @self: A #MMModem. * @sessions: (out) (array length=n_sessions): Return location for the array of diff --git a/libmm-glib/mm-location-gps-nmea.c b/libmm-glib/mm-location-gps-nmea.c index a52ad34d..f1a33bf7 100644 --- a/libmm-glib/mm-location-gps-nmea.c +++ b/libmm-glib/mm-location-gps-nmea.c @@ -190,49 +190,6 @@ mm_location_gps_nmea_get_traces (MMLocationGpsNmea *self) /*****************************************************************************/ -#ifndef MM_DISABLE_DEPRECATED - -static void -build_full_foreach (const gchar *trace_type, - const gchar *trace, - GString **built) -{ - if ((*built)->len == 0 || g_str_has_suffix ((*built)->str, "\r\n")) - g_string_append (*built, trace); - else - g_string_append_printf (*built, "\r\n%s", trace); -} - -/** - * mm_location_gps_nmea_build_full: - * @self: a #MMLocationGpsNmea. - * - * 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) -{ - GString *built; - - built = g_string_new (""); - g_hash_table_foreach (self->priv->traces, - (GHFunc)build_full_foreach, - &built); - return g_string_free (built, FALSE); -} - -#endif - -/*****************************************************************************/ - /** * mm_location_gps_nmea_get_string_variant: (skip) */ diff --git a/libmm-glib/mm-location-gps-nmea.h b/libmm-glib/mm-location-gps-nmea.h index e584c82a..d0f8deb1 100644 --- a/libmm-glib/mm-location-gps-nmea.h +++ b/libmm-glib/mm-location-gps-nmea.h @@ -60,11 +60,6 @@ const gchar *mm_location_gps_nmea_get_trace (MMLocationGpsNmea *self, const gchar *trace_type); gchar **mm_location_gps_nmea_get_traces (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 */ |