libmm-glib,cli: Replaced 'list call' with 'list calls'
This commit is contained in:

committed by
Aleksander Morgado

parent
9f3801df3f
commit
2ac5d620c4
@@ -1134,7 +1134,7 @@ list_call_ready (MMModemVoice *modem,
|
||||
GList *call_list;
|
||||
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) {
|
||||
g_printerr ("error: couldn't list call at '%s': '%s'\n",
|
||||
mm_modem_voice_get_path (modem),
|
||||
@@ -1179,10 +1179,10 @@ look_for_call_in_modem (GetVoiceContext *ctx)
|
||||
g_debug ("Looking for call '%s' in modem '%s'...",
|
||||
ctx->call_path,
|
||||
mm_object_get_path (ctx->current));
|
||||
mm_modem_voice_list_call (modem,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)list_call_ready,
|
||||
ctx);
|
||||
mm_modem_voice_list_calls (modem,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)list_call_ready,
|
||||
ctx);
|
||||
g_object_unref (modem);
|
||||
return;
|
||||
}
|
||||
@@ -1308,7 +1308,7 @@ mmcli_get_call_sync (GDBusConnection *connection,
|
||||
if (!voice)
|
||||
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) {
|
||||
g_printerr ("error: couldn't list call at '%s': '%s'\n",
|
||||
mm_modem_voice_get_path (voice),
|
||||
|
@@ -51,8 +51,8 @@ static gchar *create_str;
|
||||
static gchar *delete_str;
|
||||
|
||||
static GOptionEntry entries[] = {
|
||||
{ "voice-list-call", 0, 0, G_OPTION_ARG_NONE, &list_flag,
|
||||
"List call available in a given modem",
|
||||
{ "voice-list-calls", 0, 0, G_OPTION_ARG_NONE, &list_flag,
|
||||
"List calls available in a given modem",
|
||||
NULL
|
||||
},
|
||||
{ "voice-create-call", 0, 0, G_OPTION_ARG_STRING, &create_str,
|
||||
@@ -203,7 +203,7 @@ list_ready (MMModemVoice *modem,
|
||||
GList *operation_result;
|
||||
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);
|
||||
|
||||
mmcli_async_operation_done ();
|
||||
@@ -305,11 +305,11 @@ get_modem_ready (GObject *source,
|
||||
|
||||
/* Request to list call? */
|
||||
if (list_flag) {
|
||||
g_debug ("Asynchronously listing call in modem...");
|
||||
mm_modem_voice_list_call (ctx->modem_voice,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)list_ready,
|
||||
NULL);
|
||||
g_debug ("Asynchronously listing calls in modem...");
|
||||
mm_modem_voice_list_calls (ctx->modem_voice,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)list_ready,
|
||||
NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ mmcli_modem_voice_run_synchronous (GDBusConnection *connection)
|
||||
GList *result;
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
@@ -90,7 +90,7 @@ typedef struct {
|
||||
gchar **call_paths;
|
||||
GList *call_objects;
|
||||
guint i;
|
||||
} ListCallContext;
|
||||
} ListCallsContext;
|
||||
|
||||
static void
|
||||
call_object_list_free (GList *list)
|
||||
@@ -99,7 +99,7 @@ call_object_list_free (GList *list)
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -109,23 +109,23 @@ list_call_context_complete_and_free (ListCallContext *ctx)
|
||||
if (ctx->cancellable)
|
||||
g_object_unref (ctx->cancellable);
|
||||
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.
|
||||
* @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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
GList *
|
||||
mm_modem_voice_list_call_finish (MMModemVoice *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
mm_modem_voice_list_calls_finish (MMModemVoice *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
@@ -142,12 +142,12 @@ mm_modem_voice_list_call_finish (MMModemVoice *self,
|
||||
return g_list_copy (list);
|
||||
}
|
||||
|
||||
static void create_next_call (ListCallContext *ctx);
|
||||
static void create_next_call (ListCallsContext *ctx);
|
||||
|
||||
static void
|
||||
list_build_object_ready (GDBusConnection *connection,
|
||||
GAsyncResult *res,
|
||||
ListCallContext *ctx)
|
||||
ListCallsContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GObject *call;
|
||||
@@ -181,7 +181,7 @@ list_build_object_ready (GDBusConnection *connection,
|
||||
}
|
||||
|
||||
static void
|
||||
create_next_call (ListCallContext *ctx)
|
||||
create_next_call (ListCallsContext *ctx)
|
||||
{
|
||||
g_async_initable_new_async (MM_TYPE_CALL,
|
||||
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.
|
||||
* @cancellable: (allow-none): A #GCancellable 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.
|
||||
*
|
||||
* 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
|
||||
mm_modem_voice_list_call (MMModemVoice *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
mm_modem_voice_list_calls (MMModemVoice *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
ListCallContext *ctx;
|
||||
ListCallsContext *ctx;
|
||||
|
||||
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->result = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
mm_modem_voice_list_call);
|
||||
mm_modem_voice_list_calls);
|
||||
if (cancellable)
|
||||
ctx->cancellable = g_object_ref (cancellable);
|
||||
|
||||
@@ -244,22 +244,22 @@ mm_modem_voice_list_call (MMModemVoice *self,
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_voice_list_call_sync:
|
||||
* mm_modem_voice_list_calls_sync:
|
||||
* @self: A #MMModemVoice.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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 *
|
||||
mm_modem_voice_list_call_sync (MMModemVoice *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
mm_modem_voice_list_calls_sync (MMModemVoice *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
GList *call_objects = NULL;
|
||||
gchar **call_paths = NULL;
|
||||
@@ -429,7 +429,7 @@ mm_modem_voice_create_call (MMModemVoice *self,
|
||||
if (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 (self),
|
||||
dictionary,
|
||||
@@ -466,7 +466,7 @@ mm_modem_voice_create_call_sync (MMModemVoice *self,
|
||||
|
||||
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),
|
||||
dictionary,
|
||||
&call_path,
|
||||
|
@@ -82,14 +82,14 @@ MMCall *mm_modem_voice_create_call_sync (MMModemVoice *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void mm_modem_voice_list_call (MMModemVoice *self,
|
||||
void mm_modem_voice_list_calls (MMModemVoice *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
GList *mm_modem_voice_list_call_finish (MMModemVoice *self,
|
||||
GList *mm_modem_voice_list_calls_finish (MMModemVoice *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
GList *mm_modem_voice_list_call_sync (MMModemVoice *self,
|
||||
GList *mm_modem_voice_list_calls_sync (MMModemVoice *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
|
Reference in New Issue
Block a user