[evolution-data-server] EDataBook: Add argument guards where needed.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] EDataBook: Add argument guards where needed.
- Date: Fri, 25 Jan 2013 13:57:32 +0000 (UTC)
commit 08fd74bcd53288624f9e5e4333d48c7f6486e5ed
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Jan 25 08:48:11 2013 -0500
EDataBook: Add argument guards where needed.
addressbook/libedata-book/e-data-book.c | 30 ++++++++++++++++++++++++++----
1 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 161a9c8..4b08945 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -835,6 +835,8 @@ e_data_book_respond_open (EDataBook *book,
guint opid,
GError *error)
{
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
op_complete (book, opid);
/* Translators: This is prefix to a detailed error message */
@@ -877,6 +879,8 @@ e_data_book_respond_refresh (EDataBook *book,
guint32 opid,
GError *error)
{
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
op_complete (book, opid);
/* Translators: This is prefix to a detailed error message */
@@ -903,6 +907,8 @@ e_data_book_respond_get_backend_property (EDataBook *book,
{
gchar *gdbus_prop_value = NULL;
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
op_complete (book, opid);
/* Translators: This is prefix to a detailed error message */
@@ -928,6 +934,8 @@ e_data_book_respond_set_backend_property (EDataBook *book,
guint32 opid,
GError *error)
{
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
op_complete (book, opid);
/* Translators: This is prefix to a detailed error message */
@@ -947,6 +955,8 @@ e_data_book_respond_get_contact (EDataBook *book,
{
gchar *gdbus_vcard = NULL;
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
op_complete (book, opid);
/* Translators: This is prefix to a detailed error message */
@@ -966,6 +976,8 @@ e_data_book_respond_get_contact_list (EDataBook *book,
GError *error,
const GSList *cards)
{
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
if (error) {
/* Translators: This is prefix to a detailed error message */
g_prefix_error (&error, "%s", _("Cannot get contact list: "));
@@ -1000,6 +1012,8 @@ e_data_book_respond_get_contact_list_uids (EDataBook *book,
GError *error,
const GSList *uids)
{
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
if (error) {
/* Translators: This is prefix to a detailed error message */
g_prefix_error (&error, "%s", _("Cannot get contact list uids: "));
@@ -1038,6 +1052,8 @@ e_data_book_respond_create_contacts (EDataBook *book,
const GSList *l;
gint i = 0;
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
op_complete (book, opid);
array = g_new0 (gchar *, g_slist_length ((GSList *) contacts) + 1);
@@ -1079,6 +1095,8 @@ e_data_book_respond_modify_contacts (EDataBook *book,
GError *error,
const GSList *contacts)
{
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
op_complete (book, opid);
/* Translators: This is prefix to a detailed error message */
@@ -1104,6 +1122,8 @@ e_data_book_respond_remove_contacts (EDataBook *book,
GError *error,
const GSList *ids)
{
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
op_complete (book, opid);
/* Translators: This is prefix to a detailed error message */
@@ -1135,7 +1155,7 @@ void
e_data_book_report_error (EDataBook *book,
const gchar *message)
{
- g_return_if_fail (book != NULL);
+ g_return_if_fail (E_IS_DATA_BOOK (book));
g_return_if_fail (message != NULL);
e_gdbus_book_emit_backend_error (book->priv->dbus_interface, message);
@@ -1152,7 +1172,7 @@ void
e_data_book_report_readonly (EDataBook *book,
gboolean readonly)
{
- g_return_if_fail (book != NULL);
+ g_return_if_fail (E_IS_DATA_BOOK (book));
e_gdbus_book_emit_readonly (book->priv->dbus_interface, readonly);
}
@@ -1168,7 +1188,7 @@ void
e_data_book_report_online (EDataBook *book,
gboolean is_online)
{
- g_return_if_fail (book != NULL);
+ g_return_if_fail (E_IS_DATA_BOOK (book));
e_gdbus_book_emit_online (book->priv->dbus_interface, is_online);
}
@@ -1189,6 +1209,8 @@ e_data_book_report_opened (EDataBook *book,
{
gchar **strv_error;
+ g_return_if_fail (E_IS_DATA_BOOK (book));
+
strv_error = e_gdbus_templates_encode_error (error);
e_gdbus_book_emit_opened (book->priv->dbus_interface, (const gchar * const *) strv_error);
@@ -1212,7 +1234,7 @@ e_data_book_report_backend_property_changed (EDataBook *book,
/* Notifies client about certain property value change */
- g_return_if_fail (book != NULL);
+ g_return_if_fail (E_IS_DATA_BOOK (book));
g_return_if_fail (prop_name != NULL);
g_return_if_fail (*prop_name != '\0');
g_return_if_fail (prop_value != NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]