aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-20 11:27:39 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-12-20 11:27:39 +0800
commit987fb91d5ec4b61d1283acdb9cf02960cc47b74d (patch)
tree5e9dc4fa1e10995f0217b068daff2ca6b77cf461 /mail/em-utils.c
parentda67edd2a675481fb90b8f5fcbeb3eaf5dc427ea (diff)
downloadgsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.gz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.bz2
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.lz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.xz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.zst
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.zip
Reduce diff noise with account-mgmt branch.
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 8246fe3f24..bb6625671e 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1665,13 +1665,17 @@ search_address_in_addressbooks (const gchar *address,
EBookClient *book_client = NULL;
GHook *hook_stop;
gboolean cached_book = FALSE;
+ const gchar *display_name;
+ const gchar *uid;
GError *err = NULL;
+ uid = e_source_peek_uid (source);
+ display_name = e_source_peek_name (source);
+
/* failed to load this book last time, skip it now */
- if (g_hash_table_lookup (emu_broken_books_hash,
- e_source_peek_uid (source)) != NULL) {
+ if (g_hash_table_lookup (emu_broken_books_hash, uid) != NULL) {
d(printf ("%s: skipping broken book '%s'\n",
- G_STRFUNC, e_source_peek_name (source)));
+ G_STRFUNC, display_name));
continue;
}
@@ -1679,7 +1683,7 @@ search_address_in_addressbooks (const gchar *address,
hook_stop = mail_cancel_hook_add (emu_addr_cancel_stop, &stop);
- book_client = g_hash_table_lookup (emu_books_hash, e_source_peek_uid (source));
+ book_client = g_hash_table_lookup (emu_books_hash, uid);
if (!book_client) {
book_client = e_book_client_new (source, &err);
@@ -1690,8 +1694,7 @@ search_address_in_addressbooks (const gchar *address,
} else if (err) {
gchar *source_uid;
- source_uid = g_strdup (
- e_source_peek_uid (source));
+ source_uid = g_strdup (uid);
g_hash_table_insert (
emu_broken_books_hash,
@@ -1700,7 +1703,7 @@ search_address_in_addressbooks (const gchar *address,
g_warning (
"%s: Unable to create addressbook '%s': %s",
G_STRFUNC,
- e_source_peek_name (source),
+ display_name,
err->message);
}
g_clear_error (&err);
@@ -1714,8 +1717,7 @@ search_address_in_addressbooks (const gchar *address,
} else if (err) {
gchar *source_uid;
- source_uid = g_strdup (
- e_source_peek_uid (source));
+ source_uid = g_strdup (uid);
g_hash_table_insert (
emu_broken_books_hash,
@@ -1724,7 +1726,7 @@ search_address_in_addressbooks (const gchar *address,
g_warning (
"%s: Unable to open addressbook '%s': %s",
G_STRFUNC,
- e_source_peek_name (source),
+ display_name,
err->message);
}
g_clear_error (&err);
@@ -1760,13 +1762,14 @@ search_address_in_addressbooks (const gchar *address,
(g_error_matches (err, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)));
if (err && !stop) {
- gchar *source_uid = g_strdup (e_source_peek_uid (source));
+ gchar *source_uid = g_strdup (uid);
g_hash_table_insert (emu_broken_books_hash, source_uid, source_uid);
g_warning (
"%s: Can't get contacts from '%s': %s",
- G_STRFUNC, e_source_peek_name (source),
+ G_STRFUNC,
+ display_name,
err->message);
}
g_clear_error (&err);
@@ -1778,16 +1781,14 @@ search_address_in_addressbooks (const gchar *address,
g_object_unref (book_client);
} else if (!stop && book_client && !cached_book) {
g_hash_table_insert (
- emu_books_hash, g_strdup (
- e_source_peek_uid (source)), book_client);
+ emu_books_hash, g_strdup (uid), book_client);
}
}
mail_cancel_hook_remove (hook_cancellable);
g_object_unref (cancellable);
- g_slist_foreach (addr_sources, (GFunc) g_object_unref, NULL);
- g_slist_free (addr_sources);
+ g_slist_free_full (addr_sources, (GDestroyNotify) g_object_unref);
g_free (query);