libmm-glib,cli: Replaced 'list call' with 'list calls'

This commit is contained in:
Marco Bascetta
2015-06-03 09:37:39 +02:00
committed by Aleksander Morgado
parent 9f3801df3f
commit 2ac5d620c4
4 changed files with 47 additions and 47 deletions

View File

@@ -1134,7 +1134,7 @@ list_call_ready (MMModemVoice *modem,
GList *call_list; GList *call_list;
GError *error = NULL; GError *error = NULL;
call_list = mm_modem_voice_list_call_finish (modem, res, &error); call_list = mm_modem_voice_list_calls_finish (modem, res, &error);
if (error) { if (error) {
g_printerr ("error: couldn't list call at '%s': '%s'\n", g_printerr ("error: couldn't list call at '%s': '%s'\n",
mm_modem_voice_get_path (modem), mm_modem_voice_get_path (modem),
@@ -1179,7 +1179,7 @@ look_for_call_in_modem (GetVoiceContext *ctx)
g_debug ("Looking for call '%s' in modem '%s'...", g_debug ("Looking for call '%s' in modem '%s'...",
ctx->call_path, ctx->call_path,
mm_object_get_path (ctx->current)); mm_object_get_path (ctx->current));
mm_modem_voice_list_call (modem, mm_modem_voice_list_calls (modem,
ctx->cancellable, ctx->cancellable,
(GAsyncReadyCallback)list_call_ready, (GAsyncReadyCallback)list_call_ready,
ctx); ctx);
@@ -1308,7 +1308,7 @@ mmcli_get_call_sync (GDBusConnection *connection,
if (!voice) if (!voice)
continue; continue;
call_list = mm_modem_voice_list_call_sync (voice, NULL, &error); call_list = mm_modem_voice_list_calls_sync (voice, NULL, &error);
if (error) { if (error) {
g_printerr ("error: couldn't list call at '%s': '%s'\n", g_printerr ("error: couldn't list call at '%s': '%s'\n",
mm_modem_voice_get_path (voice), mm_modem_voice_get_path (voice),

View File

@@ -51,8 +51,8 @@ static gchar *create_str;
static gchar *delete_str; static gchar *delete_str;
static GOptionEntry entries[] = { static GOptionEntry entries[] = {
{ "voice-list-call", 0, 0, G_OPTION_ARG_NONE, &list_flag, { "voice-list-calls", 0, 0, G_OPTION_ARG_NONE, &list_flag,
"List call available in a given modem", "List calls available in a given modem",
NULL NULL
}, },
{ "voice-create-call", 0, 0, G_OPTION_ARG_STRING, &create_str, { "voice-create-call", 0, 0, G_OPTION_ARG_STRING, &create_str,
@@ -203,7 +203,7 @@ list_ready (MMModemVoice *modem,
GList *operation_result; GList *operation_result;
GError *error = NULL; GError *error = NULL;
operation_result = mm_modem_voice_list_call_finish (modem, result, &error); operation_result = mm_modem_voice_list_calls_finish (modem, result, &error);
list_process_reply (operation_result, error); list_process_reply (operation_result, error);
mmcli_async_operation_done (); mmcli_async_operation_done ();
@@ -305,8 +305,8 @@ get_modem_ready (GObject *source,
/* Request to list call? */ /* Request to list call? */
if (list_flag) { if (list_flag) {
g_debug ("Asynchronously listing call in modem..."); g_debug ("Asynchronously listing calls in modem...");
mm_modem_voice_list_call (ctx->modem_voice, mm_modem_voice_list_calls (ctx->modem_voice,
ctx->cancellable, ctx->cancellable,
(GAsyncReadyCallback)list_ready, (GAsyncReadyCallback)list_ready,
NULL); NULL);
@@ -382,7 +382,7 @@ mmcli_modem_voice_run_synchronous (GDBusConnection *connection)
GList *result; GList *result;
g_debug ("Synchronously listing call..."); g_debug ("Synchronously listing call...");
result = mm_modem_voice_list_call_sync (ctx->modem_voice, NULL, &error); result = mm_modem_voice_list_calls_sync (ctx->modem_voice, NULL, &error);
list_process_reply (result, error); list_process_reply (result, error);
return; return;
} }

View File

@@ -90,7 +90,7 @@ typedef struct {
gchar **call_paths; gchar **call_paths;
GList *call_objects; GList *call_objects;
guint i; guint i;
} ListCallContext; } ListCallsContext;
static void static void
call_object_list_free (GList *list) call_object_list_free (GList *list)
@@ -99,7 +99,7 @@ call_object_list_free (GList *list)
} }
static void static void
list_call_context_complete_and_free (ListCallContext *ctx) list_call_context_complete_and_free (ListCallsContext *ctx)
{ {
g_simple_async_result_complete_in_idle (ctx->result); g_simple_async_result_complete_in_idle (ctx->result);
@@ -109,21 +109,21 @@ list_call_context_complete_and_free (ListCallContext *ctx)
if (ctx->cancellable) if (ctx->cancellable)
g_object_unref (ctx->cancellable); g_object_unref (ctx->cancellable);
g_object_ref (ctx->self); g_object_ref (ctx->self);
g_slice_free (ListCallContext, ctx); g_slice_free (ListCallsContext, ctx);
} }
/** /**
* mm_modem_voice_list_call_finish: * mm_modem_voice_list_calls_finish:
* @self: A #MMModem. * @self: A #MMModem.
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_voice_list_call(). * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_voice_list_calls().
* @error: Return location for error or %NULL. * @error: Return location for error or %NULL.
* *
* Finishes an operation started with mm_modem_voice_list_call(). * Finishes an operation started with mm_modem_voice_list_calls().
* *
* Returns: (element-type ModemManager.Call) (transfer full): A list of #MMCall objects, or #NULL if either not found or @error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as #GDestroyNotify function. * Returns: (element-type ModemManager.Call) (transfer full): A list of #MMCall objects, or #NULL if either not found or @error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as #GDestroyNotify function.
*/ */
GList * GList *
mm_modem_voice_list_call_finish (MMModemVoice *self, mm_modem_voice_list_calls_finish (MMModemVoice *self,
GAsyncResult *res, GAsyncResult *res,
GError **error) GError **error)
{ {
@@ -142,12 +142,12 @@ mm_modem_voice_list_call_finish (MMModemVoice *self,
return g_list_copy (list); return g_list_copy (list);
} }
static void create_next_call (ListCallContext *ctx); static void create_next_call (ListCallsContext *ctx);
static void static void
list_build_object_ready (GDBusConnection *connection, list_build_object_ready (GDBusConnection *connection,
GAsyncResult *res, GAsyncResult *res,
ListCallContext *ctx) ListCallsContext *ctx)
{ {
GError *error = NULL; GError *error = NULL;
GObject *call; GObject *call;
@@ -181,7 +181,7 @@ list_build_object_ready (GDBusConnection *connection,
} }
static void static void
create_next_call (ListCallContext *ctx) create_next_call (ListCallsContext *ctx)
{ {
g_async_initable_new_async (MM_TYPE_CALL, g_async_initable_new_async (MM_TYPE_CALL,
G_PRIORITY_DEFAULT, G_PRIORITY_DEFAULT,
@@ -197,7 +197,7 @@ create_next_call (ListCallContext *ctx)
} }
/** /**
* mm_modem_voice_list_call: * mm_modem_voice_list_calls:
* @self: A #MMModemVoice. * @self: A #MMModemVoice.
* @cancellable: (allow-none): A #GCancellable or %NULL. * @cancellable: (allow-none): A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
@@ -206,26 +206,26 @@ create_next_call (ListCallContext *ctx)
* Asynchronously lists the #MMCall objects in the modem. * Asynchronously lists the #MMCall objects in the modem.
* *
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from. * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
* You can then call mm_modem_voice_list_call_finish() to get the result of the operation. * You can then call mm_modem_voice_list_calls_finish() to get the result of the operation.
* *
* See mm_modem_voice_list_call_sync() for the synchronous, blocking version of this method. * See mm_modem_voice_list_calls_sync() for the synchronous, blocking version of this method.
*/ */
void void
mm_modem_voice_list_call (MMModemVoice *self, mm_modem_voice_list_calls (MMModemVoice *self,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
ListCallContext *ctx; ListCallsContext *ctx;
g_return_if_fail (MM_IS_MODEM_VOICE (self)); g_return_if_fail (MM_IS_MODEM_VOICE (self));
ctx = g_slice_new0 (ListCallContext); ctx = g_slice_new0 (ListCallsContext);
ctx->self = g_object_ref (self); ctx->self = g_object_ref (self);
ctx->result = g_simple_async_result_new (G_OBJECT (self), ctx->result = g_simple_async_result_new (G_OBJECT (self),
callback, callback,
user_data, user_data,
mm_modem_voice_list_call); mm_modem_voice_list_calls);
if (cancellable) if (cancellable)
ctx->cancellable = g_object_ref (cancellable); ctx->cancellable = g_object_ref (cancellable);
@@ -244,20 +244,20 @@ mm_modem_voice_list_call (MMModemVoice *self,
} }
/** /**
* mm_modem_voice_list_call_sync: * mm_modem_voice_list_calls_sync:
* @self: A #MMModemVoice. * @self: A #MMModemVoice.
* @cancellable: (allow-none): A #GCancellable or %NULL. * @cancellable: (allow-none): A #GCancellable or %NULL.
* @error: Return location for error or %NULL. * @error: Return location for error or %NULL.
* *
* Synchronously lists the #MMCall objects in the modem. * Synchronously lists the #MMCall objects in the modem.
* *
* The calling thread is blocked until a reply is received. See mm_modem_voice_list_call() * The calling thread is blocked until a reply is received. See mm_modem_voice_list_calls()
* for the asynchronous version of this method. * for the asynchronous version of this method.
* *
* Returns: (element-type MMCall) (transfer full): A list of #MMCall objects, or #NULL if either not found or @error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as #GDestroyNotify function. * Returns: (element-type MMCall) (transfer full): A list of #MMCall objects, or #NULL if either not found or @error is set. The returned value should be freed with g_list_free_full() using g_object_unref() as #GDestroyNotify function.
*/ */
GList * GList *
mm_modem_voice_list_call_sync (MMModemVoice *self, mm_modem_voice_list_calls_sync (MMModemVoice *self,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
@@ -429,7 +429,7 @@ mm_modem_voice_create_call (MMModemVoice *self,
if (cancellable) if (cancellable)
ctx->cancellable = g_object_ref (cancellable); ctx->cancellable = g_object_ref (cancellable);
dictionary = (mm_call_properties_get_dictionary (properties)); dictionary = mm_call_properties_get_dictionary (properties);
mm_gdbus_modem_voice_call_create_call ( mm_gdbus_modem_voice_call_create_call (
MM_GDBUS_MODEM_VOICE (self), MM_GDBUS_MODEM_VOICE (self),
dictionary, dictionary,
@@ -466,7 +466,7 @@ mm_modem_voice_create_call_sync (MMModemVoice *self,
g_return_val_if_fail (MM_IS_MODEM_VOICE (self), NULL); g_return_val_if_fail (MM_IS_MODEM_VOICE (self), NULL);
dictionary = (mm_call_properties_get_dictionary (properties)); dictionary = mm_call_properties_get_dictionary (properties);
mm_gdbus_modem_voice_call_create_call_sync (MM_GDBUS_MODEM_VOICE (self), mm_gdbus_modem_voice_call_create_call_sync (MM_GDBUS_MODEM_VOICE (self),
dictionary, dictionary,
&call_path, &call_path,

View File

@@ -82,14 +82,14 @@ MMCall *mm_modem_voice_create_call_sync (MMModemVoice *self,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
void mm_modem_voice_list_call (MMModemVoice *self, void mm_modem_voice_list_calls (MMModemVoice *self,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data); gpointer user_data);
GList *mm_modem_voice_list_call_finish (MMModemVoice *self, GList *mm_modem_voice_list_calls_finish (MMModemVoice *self,
GAsyncResult *res, GAsyncResult *res,
GError **error); GError **error);
GList *mm_modem_voice_list_call_sync (MMModemVoice *self, GList *mm_modem_voice_list_calls_sync (MMModemVoice *self,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);