[gnome-builder] jsonrpc: rename to send_notification()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] jsonrpc: rename to send_notification()
- Date: Tue, 1 Nov 2016 20:07:10 +0000 (UTC)
commit 05b51f94ef274566229198564fcd57405c0fcf58
Author: Christian Hergert <chergert redhat com>
Date: Tue Nov 1 13:02:58 2016 -0700
jsonrpc: rename to send_notification()
This fixes a warning that we had where there is a notification signal and
a method that aren't related, but share names. This is more explicit that
one is to send a notification to the peer and the signal is for an
incoming notification.
contrib/jsonrpc-glib/jsonrpc-client.c | 46 ++++++++++++++++----------------
contrib/jsonrpc-glib/jsonrpc-client.h | 28 ++++++++++----------
libide/langserv/ide-langserv-client.c | 14 +++++-----
3 files changed, 44 insertions(+), 44 deletions(-)
---
diff --git a/contrib/jsonrpc-glib/jsonrpc-client.c b/contrib/jsonrpc-glib/jsonrpc-client.c
index caea348..40415ee 100644
--- a/contrib/jsonrpc-glib/jsonrpc-client.c
+++ b/contrib/jsonrpc-glib/jsonrpc-client.c
@@ -928,9 +928,9 @@ jsonrpc_client_error_quark (void)
}
static void
-jsonrpc_client_notification_write_cb (GObject *object,
- GAsyncResult *result,
- gpointer user_data)
+jsonrpc_client_send_notification_write_cb (GObject *object,
+ GAsyncResult *result,
+ gpointer user_data)
{
JsonrpcOutputStream *stream = (JsonrpcOutputStream *)object;
g_autoptr(GTask) task = user_data;
@@ -947,7 +947,7 @@ jsonrpc_client_notification_write_cb (GObject *object,
}
/**
- * jsonrpc_client_notification:
+ * jsonrpc_client_send_notification:
* @self: A #JsonrpcClient
* @method: the name of the method to call
* @params: (transfer full) (nullable): A #JsonNode of parameters or %NULL
@@ -961,11 +961,11 @@ jsonrpc_client_notification_write_cb (GObject *object,
* Returns; %TRUE on success; otherwise %FALSE and @error is set.
*/
gboolean
-jsonrpc_client_notification (JsonrpcClient *self,
- const gchar *method,
- JsonNode *params,
- GCancellable *cancellable,
- GError **error)
+jsonrpc_client_send_notification (JsonrpcClient *self,
+ const gchar *method,
+ JsonNode *params,
+ GCancellable *cancellable,
+ GError **error)
{
JsonrpcClientPrivate *priv = jsonrpc_client_get_instance_private (self);
g_autoptr(JsonNode) message = NULL;
@@ -995,7 +995,7 @@ jsonrpc_client_notification (JsonrpcClient *self,
}
/**
- * jsonrpc_client_notification_async:
+ * jsonrpc_client_send_notification_async:
* @self: A #JsonrpcClient
* @method: the name of the method to call
* @params: (transfer full) (nullable): A #JsonNode of parameters or %NULL
@@ -1011,12 +1011,12 @@ jsonrpc_client_notification (JsonrpcClient *self,
* This function takes ownership of @params.
*/
void
-jsonrpc_client_notification_async (JsonrpcClient *self,
- const gchar *method,
- JsonNode *params,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+jsonrpc_client_send_notification_async (JsonrpcClient *self,
+ const gchar *method,
+ JsonNode *params,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
JsonrpcClientPrivate *priv = jsonrpc_client_get_instance_private (self);
g_autoptr(JsonNode) message = NULL;
@@ -1028,7 +1028,7 @@ jsonrpc_client_notification_async (JsonrpcClient *self,
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
task = g_task_new (self, cancellable, callback, user_data);
- g_task_set_source_tag (task, jsonrpc_client_notification_async);
+ g_task_set_source_tag (task, jsonrpc_client_send_notification_async);
if (!jsonrpc_client_check_ready (self, &error))
{
@@ -1048,17 +1048,17 @@ jsonrpc_client_notification_async (JsonrpcClient *self,
jsonrpc_output_stream_write_message_async (priv->output_stream,
message,
cancellable,
- jsonrpc_client_notification_write_cb,
+ jsonrpc_client_send_notification_write_cb,
g_steal_pointer (&task));
json_node_unref (params);
}
/**
- * jsonrpc_client_notification_finish:
+ * jsonrpc_client_send_notification_finish:
* @self: A #JsonrpcClient
*
- * Completes an asynchronous call to jsonrpc_client_notification_async().
+ * Completes an asynchronous call to jsonrpc_client_send_notification_async().
*
* Successful completion of this function only indicates that the request
* has been written to the underlying buffer, not that the peer has received
@@ -1068,9 +1068,9 @@ jsonrpc_client_notification_async (JsonrpcClient *self,
* %FALSE and @error is set.
*/
gboolean
-jsonrpc_client_notification_finish (JsonrpcClient *self,
- GAsyncResult *result,
- GError **error)
+jsonrpc_client_send_notification_finish (JsonrpcClient *self,
+ GAsyncResult *result,
+ GError **error)
{
g_return_val_if_fail (JSONRPC_IS_CLIENT (self), FALSE);
g_return_val_if_fail (G_IS_TASK (result), FALSE);
diff --git a/contrib/jsonrpc-glib/jsonrpc-client.h b/contrib/jsonrpc-glib/jsonrpc-client.h
index 1e58e20..52ce125 100644
--- a/contrib/jsonrpc-glib/jsonrpc-client.h
+++ b/contrib/jsonrpc-glib/jsonrpc-client.h
@@ -79,20 +79,20 @@ gboolean jsonrpc_client_call_finish (JsonrpcClient *self,
GAsyncResult *result,
JsonNode **return_value,
GError **error);
-gboolean jsonrpc_client_notification (JsonrpcClient *self,
- const gchar *method,
- JsonNode *params,
- GCancellable *cancellable,
- GError **error);
-void jsonrpc_client_notification_async (JsonrpcClient *self,
- const gchar *method,
- JsonNode *params,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-gboolean jsonrpc_client_notification_finish (JsonrpcClient *self,
- GAsyncResult *result,
- GError **error);
+gboolean jsonrpc_client_send_notification (JsonrpcClient *self,
+ const gchar *method,
+ JsonNode *params,
+ GCancellable *cancellable,
+ GError **error);
+void jsonrpc_client_send_notification_async (JsonrpcClient *self,
+ const gchar *method,
+ JsonNode *params,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean jsonrpc_client_send_notification_finish (JsonrpcClient *self,
+ GAsyncResult *result,
+ GError **error);
gboolean jsonrpc_client_reply (JsonrpcClient *self,
JsonNode *id,
JsonNode *result,
diff --git a/libide/langserv/ide-langserv-client.c b/libide/langserv/ide-langserv-client.c
index 03dea49..29d1b31 100644
--- a/libide/langserv/ide-langserv-client.c
+++ b/libide/langserv/ide-langserv-client.c
@@ -1092,7 +1092,7 @@ ide_langserv_client_notification_cb (GObject *object,
IDE_ENTRY;
- if (!jsonrpc_client_notification_finish (client, result, &error))
+ if (!jsonrpc_client_send_notification_finish (client, result, &error))
g_task_return_error (task, g_steal_pointer (&error));
else
g_task_return_boolean (task, TRUE);
@@ -1136,12 +1136,12 @@ ide_langserv_client_notification_async (IdeLangservClient *self,
IDE_EXIT;
}
- jsonrpc_client_notification_async (priv->rpc_client,
- method,
- params,
- cancellable,
- ide_langserv_client_notification_cb,
- g_steal_pointer (&task));
+ jsonrpc_client_send_notification_async (priv->rpc_client,
+ method,
+ params,
+ cancellable,
+ ide_langserv_client_notification_cb,
+ g_steal_pointer (&task));
IDE_EXIT;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]