libmm-glib,location-gps-nmea: move deprecated methods to compat source

This commit is contained in:
Aleksander Morgado
2021-06-25 19:01:06 +02:00
parent b38586a12c
commit 6363add86a
5 changed files with 33 additions and 49 deletions
@@ -544,7 +544,6 @@ MMLocationGpsNmea
<SUBSECTION Getters>
mm_location_gps_nmea_get_trace
mm_location_gps_nmea_get_traces
mm_location_gps_nmea_build_full
<SUBSECTION Private>
mm_location_gps_nmea_new
mm_location_gps_nmea_new_from_string_variant
@@ -1834,6 +1833,8 @@ mm_call_properties_get_state
mm_call_properties_set_state
mm_call_properties_get_state_reason
mm_call_properties_set_state_reason
<SUBSECTION LocationGpsNmea>
mm_location_gps_nmea_build_full
<SUBSECTION ModemOma>
mm_modem_peek_pending_network_initiated_sessions
mm_modem_get_pending_network_initiated_sessions
+11
View File
@@ -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,
+20
View File
@@ -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"
/**
@@ -209,6 +210,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.
-43
View File
@@ -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)
*/
-5
View File
@@ -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 */