From ceb523664a97fa091cf3adcb8c4358cd0f6c6003 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 27 Jun 2012 16:05:24 +0100 Subject: [PATCH] Avoid TP_ERRORS --- gabble/message-channel.c | 22 +++++++++++----------- gabble/status.c | 4 ++-- mission-control/mcp-account-manager-ytstenut.c | 2 +- plugin-base/channel-manager.c | 6 +++--- plugin-base/ytstenut.c | 2 +- salut/message-channel.c | 22 +++++++++++----------- salut/status.c | 4 ++-- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/gabble/message-channel.c b/gabble/message-channel.c index b20ce2b..1133969 100644 --- a/gabble/message-channel.c +++ b/gabble/message-channel.c @@ -576,14 +576,14 @@ ytst_message_channel_request (TpYtsSvcChannel *channel, /* Can't call this method from this side */ if (!tp_base_channel_is_requested (TP_BASE_CHANNEL (channel))) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Request() may not be called on the reply side of a channel"); goto done; } if (priv->requested) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Request() has already been called"); dbus_g_method_return_error (context, error); g_clear_error (&error); @@ -629,7 +629,7 @@ ytst_message_channel_reply (TpYtsSvcChannel *channel, /* Can't call this method from this side */ if (tp_base_channel_is_requested (TP_BASE_CHANNEL (channel))) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Reply() may not be called on the request side of a channel"); goto done; } @@ -698,7 +698,7 @@ ytst_message_channel_fail (TpYtsSvcChannel *channel, /* Can't call this method from this side */ if (tp_base_channel_is_requested (TP_BASE_CHANNEL (channel))) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Fail() may not be called on the request side of a channel"); goto done; } @@ -706,7 +706,7 @@ ytst_message_channel_fail (TpYtsSvcChannel *channel, /* Can't call this after a successful call */ if (priv->replied) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Fail() or Reply() has already been called"); goto done; } @@ -716,7 +716,7 @@ ytst_message_channel_fail (TpYtsSvcChannel *channel, ytst_message_error_type_to_wocky (error_type)); if (type == NULL) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "ErrorType is set to an invalid value."); goto done; } @@ -821,7 +821,7 @@ ytst_message_channel_build_request (GHashTable *request_props, sub_type = WOCKY_STANZA_SUB_TYPE_SET; break; default: - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The RequestType property is invalid."); return NULL; } @@ -830,14 +830,14 @@ ytst_message_channel_build_request (GHashTable *request_props, TP_YTS_IFACE_CHANNEL ".TargetService"); if (target_service == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The TargetService property must be set."); return NULL; } else if (!tp_dbus_check_valid_bus_name (target_service, TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The TargetService property has an invalid syntax."); return NULL; } @@ -846,7 +846,7 @@ ytst_message_channel_build_request (GHashTable *request_props, TP_YTS_IFACE_CHANNEL ".InitiatorService"); if (initiator_service == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The InitiatorService property must be set."); return NULL; } @@ -864,7 +864,7 @@ ytst_message_channel_build_request (GHashTable *request_props, if (!attributes && tp_asv_lookup (request_props, TP_YTS_IFACE_CHANNEL ".RequestAttributes")) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The RequestAttributes property is invalid."); return NULL; } diff --git a/gabble/status.c b/gabble/status.c index a0e445f..8b254f6 100644 --- a/gabble/status.c +++ b/gabble/status.c @@ -697,14 +697,14 @@ ytst_status_advertise_status (TpYtsSvcStatus *svc, if (tp_str_empty (capability)) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Capability argument must be set"); goto out; } if (tp_str_empty (service_name)) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Service name argument must be set"); goto out; } diff --git a/mission-control/mcp-account-manager-ytstenut.c b/mission-control/mcp-account-manager-ytstenut.c index 1e8a335..188f934 100644 --- a/mission-control/mcp-account-manager-ytstenut.c +++ b/mission-control/mcp-account-manager-ytstenut.c @@ -579,7 +579,7 @@ mcp_account_manager_ytstenut_release (TpYtsSvcAccountManager *manager, else { DEBUG ("Caller called Release() without Hold()"); - error = g_error_new_literal (TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + error = g_error_new_literal (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "The Hold() method must be called successfully by this caller before " "calling Release()."); dbus_g_method_return_error (context, error); diff --git a/plugin-base/channel-manager.c b/plugin-base/channel-manager.c index e92441b..a02b578 100644 --- a/plugin-base/channel-manager.c +++ b/plugin-base/channel-manager.c @@ -481,7 +481,7 @@ ytst_channel_manager_create_channel (TpChannelManager *manager, contact = wocky_contact_factory_lookup_ll_contact (factory, name); if (contact == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "%s is not online", name); goto error; } @@ -489,7 +489,7 @@ ytst_channel_manager_create_channel (TpChannelManager *manager, if (tp_asv_get_string (request_properties, TP_YTS_IFACE_CHANNEL ".TargetService") == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The TargetService property must be set."); goto error; } @@ -504,7 +504,7 @@ ytst_channel_manager_create_channel (TpChannelManager *manager, if (resource == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Cannot find appropriate resource for contact."); goto error; } diff --git a/plugin-base/ytstenut.c b/plugin-base/ytstenut.c index 1b75e11..c792574 100644 --- a/plugin-base/ytstenut.c +++ b/plugin-base/ytstenut.c @@ -108,7 +108,7 @@ ytstenut_plugin_create_sidecar_async ( } else { - g_simple_async_result_set_error (result, TP_ERRORS, + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' not implemented", sidecar_interface); } diff --git a/salut/message-channel.c b/salut/message-channel.c index 8313bda..31a9bcc 100644 --- a/salut/message-channel.c +++ b/salut/message-channel.c @@ -573,14 +573,14 @@ ytst_message_channel_request (TpYtsSvcChannel *channel, /* Can't call this method from this side */ if (!tp_base_channel_is_requested (TP_BASE_CHANNEL (channel))) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Request() may not be called on the reply side of a channel"); goto done; } if (priv->requested) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Request() has already been called"); dbus_g_method_return_error (context, error); g_clear_error (&error); @@ -626,7 +626,7 @@ ytst_message_channel_reply (TpYtsSvcChannel *channel, /* Can't call this method from this side */ if (tp_base_channel_is_requested (TP_BASE_CHANNEL (channel))) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Reply() may not be called on the request side of a channel"); goto done; } @@ -695,7 +695,7 @@ ytst_message_channel_fail (TpYtsSvcChannel *channel, /* Can't call this method from this side */ if (tp_base_channel_is_requested (TP_BASE_CHANNEL (channel))) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Fail() may not be called on the request side of a channel"); goto done; } @@ -703,7 +703,7 @@ ytst_message_channel_fail (TpYtsSvcChannel *channel, /* Can't call this after a successful call */ if (priv->replied) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Fail() or Reply() has already been called"); goto done; } @@ -713,7 +713,7 @@ ytst_message_channel_fail (TpYtsSvcChannel *channel, ytst_message_error_type_to_wocky (error_type)); if (type == NULL) { - g_set_error_literal (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error_literal (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "ErrorType is set to an invalid value."); goto done; } @@ -818,7 +818,7 @@ ytst_message_channel_build_request (GHashTable *request_props, sub_type = WOCKY_STANZA_SUB_TYPE_SET; break; default: - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The RequestType property is invalid."); return NULL; } @@ -827,14 +827,14 @@ ytst_message_channel_build_request (GHashTable *request_props, TP_YTS_IFACE_CHANNEL ".TargetService"); if (target_service == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The TargetService property must be set."); return NULL; } else if (!tp_dbus_check_valid_bus_name (target_service, TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The TargetService property has an invalid syntax."); return NULL; } @@ -843,7 +843,7 @@ ytst_message_channel_build_request (GHashTable *request_props, TP_YTS_IFACE_CHANNEL ".InitiatorService"); if (initiator_service == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The InitiatorService property must be set."); return NULL; } @@ -861,7 +861,7 @@ ytst_message_channel_build_request (GHashTable *request_props, if (!attributes && tp_asv_lookup (request_props, TP_YTS_IFACE_CHANNEL ".RequestAttributes")) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The RequestAttributes property is invalid."); return NULL; } diff --git a/salut/status.c b/salut/status.c index 5379685..d628308 100644 --- a/salut/status.c +++ b/salut/status.c @@ -664,14 +664,14 @@ ytst_status_advertise_status (TpYtsSvcStatus *svc, if (tp_str_empty (capability)) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Capability argument must be set"); goto out; } if (tp_str_empty (service_name)) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Service name argument must be set"); goto out; } -- 1.7.10.4