diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-09-08 00:31:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-09-08 07:08:54 +0800 |
commit | 3da4948c0fc1f2c21b163f0ec456b2d99c881258 (patch) | |
tree | 479d6153d31e03cb7a65990683b5271402e5ec29 /plugins/bbdb | |
parent | 2e5031cb4538b4819e5fce5d717668c3445df80a (diff) | |
download | gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.gz gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.bz2 gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.lz gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.xz gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.tar.zst gsoc2013-evolution-3da4948c0fc1f2c21b163f0ec456b2d99c881258.zip |
Miscellaneous cleanups.
Diffstat (limited to 'plugins/bbdb')
-rw-r--r-- | plugins/bbdb/bbdb.c | 22 | ||||
-rw-r--r-- | plugins/bbdb/gaimbuddies.c | 21 |
2 files changed, 29 insertions, 14 deletions
diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c index bfb6959047..31aebceff2 100644 --- a/plugins/bbdb/bbdb.c +++ b/plugins/bbdb/bbdb.c @@ -272,7 +272,7 @@ bbdb_do_it (EBookClient *client, const gchar *name, const gchar *email) { - gchar *query_string, *delim, *temp_name = NULL, *uid; + gchar *query_string, *delim, *temp_name = NULL; GSList *contacts = NULL; gboolean status; EContact *contact; @@ -334,8 +334,14 @@ bbdb_do_it (EBookClient *client, contact = (EContact *) contacts->data; add_email_to_contact (contact, email); - if (!e_book_client_modify_contact_sync (client, contact, NULL, &error)) { - g_warning ("bbdb: Could not modify contact: %s\n", error->message); + + e_book_client_modify_contact_sync ( + client, contact, NULL, &error); + + if (error != NULL) { + g_warning ( + "bbdb: Could not modify contact: %s\n", + error->message); g_error_free (error); } @@ -350,14 +356,16 @@ bbdb_do_it (EBookClient *client, add_email_to_contact (contact, email); g_free (temp_name); - uid = NULL; - if (!e_book_client_add_contact_sync (client, contact, &uid, NULL, &error)) { - g_warning ("bbdb: Failed to add new contact: %s", error->message); + e_book_client_add_contact_sync (client, contact, NULL, NULL, &error); + + if (error != NULL) { + g_warning ( + "bbdb: Failed to add new contact: %s", + error->message); g_error_free (error); } g_object_unref (contact); - g_free (uid); } EBookClient * diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c index 7f55c18fde..d0f2a066cf 100644 --- a/plugins/bbdb/gaimbuddies.c +++ b/plugins/bbdb/gaimbuddies.c @@ -224,7 +224,7 @@ bbdb_sync_buddy_list_in_thread (gpointer data) for (link = head; link != NULL; link = g_list_next (link)) { GaimBuddy *b = link->data; EBookQuery *query; - gchar *query_string, *uid; + gchar *query_string; GSList *contacts = NULL; EContact *c; @@ -268,8 +268,13 @@ bbdb_sync_buddy_list_in_thread (gpointer data) } /* Write it out to the addressbook */ - if (!e_book_client_modify_contact_sync (client, c, NULL, &error)) { - g_warning ("bbdb: Could not modify contact: %s", error->message); + e_book_client_modify_contact_sync ( + client, c, NULL, &error); + + if (error != NULL) { + g_warning ( + "bbdb: Could not modify contact: %s", + error->message); g_clear_error (&error); } @@ -287,15 +292,17 @@ bbdb_sync_buddy_list_in_thread (gpointer data) continue; } - uid = NULL; - if (!e_book_client_add_contact_sync (client, c, &uid, NULL, &error)) { - g_warning ("bbdb: Failed to add new contact: %s", error->message); + e_book_client_add_contact_sync (client, c, NULL, NULL, &error); + + if (error != NULL) { + g_warning ( + "bbdb: Failed to add new contact: %s", + error->message); g_clear_error (&error); goto exit; } g_object_unref (c); - g_free (uid); } g_idle_add (store_last_sync_idle_cb, NULL); |