changeset 27447:9e916fd25f48

Hopefully provide better debug logs when gevolution plugin can't open the addressbook for whatever reason.
author Stu Tomlinson <stu@nosnilmot.com>
date Fri, 10 Jul 2009 02:47:09 +0000
parents 036d94041e09
children 60d128c6413a
files pidgin/plugins/gevolution/add_buddy_dialog.c pidgin/plugins/gevolution/assoc-buddy.c pidgin/plugins/gevolution/eds-utils.c pidgin/plugins/gevolution/gevo-util.c pidgin/plugins/gevolution/gevolution.c
diffstat 5 files changed, 26 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/plugins/gevolution/add_buddy_dialog.c	Fri Jul 10 02:26:37 2009 +0000
+++ b/pidgin/plugins/gevolution/add_buddy_dialog.c	Fri Jul 10 02:47:09 2009 +0000
@@ -234,6 +234,7 @@
 	EBook *book;
 	gboolean status;
 	GList *cards, *c;
+	GError *err = NULL;
 
 	if (dialog->book != NULL)
 	{
@@ -250,10 +251,11 @@
 
 	gtk_list_store_clear(dialog->model);
 
-	if (!gevo_load_addressbook(uri, &book, NULL))
+	if (!gevo_load_addressbook(uri, &book, &err))
 	{
 		purple_debug_error("evolution",
-						 "Error retrieving default addressbook\n");
+						 "Error retrieving default addressbook: %s\n", err->message);
+		g_error_free(err);
 
 		return;
 	}
--- a/pidgin/plugins/gevolution/assoc-buddy.c	Fri Jul 10 02:26:37 2009 +0000
+++ b/pidgin/plugins/gevolution/assoc-buddy.c	Fri Jul 10 02:47:09 2009 +0000
@@ -138,6 +138,7 @@
 	const char *prpl_id;
 	gboolean status;
 	GList *cards, *c;
+	GError *err = NULL;
 
 	if (dialog->book != NULL)
 	{
@@ -154,10 +155,11 @@
 
 	gtk_list_store_clear(dialog->model);
 
-	if (!gevo_load_addressbook(uri, &book, NULL))
+	if (!gevo_load_addressbook(uri, &book, &err))
 	{
 		purple_debug_error("evolution",
-						 "Error retrieving addressbook\n");
+						 "Error retrieving addressbook: %s\n", err->message);
+		g_error_free(err);
 
 		return;
 	}
--- a/pidgin/plugins/gevolution/eds-utils.c	Fri Jul 10 02:26:37 2009 +0000
+++ b/pidgin/plugins/gevolution/eds-utils.c	Fri Jul 10 02:47:09 2009 +0000
@@ -119,11 +119,13 @@
 	EBook *book;
 	gboolean status;
 	GList *cards;
+	GError *err = NULL;
 
-	if (!gevo_load_addressbook(uri, &book, NULL))
+	if (!gevo_load_addressbook(uri, &book, &err))
 	{
 		purple_debug_error("evolution",
-						 "Error retrieving addressbook\n");
+						 "Error retrieving addressbook: %s\n", err->message);
+		g_error_free(err);
 		return NULL;
 	}
 
--- a/pidgin/plugins/gevolution/gevo-util.c	Fri Jul 10 02:26:37 2009 +0000
+++ b/pidgin/plugins/gevolution/gevo-util.c	Fri Jul 10 02:47:09 2009 +0000
@@ -143,11 +143,16 @@
 	g_return_val_if_fail(book != NULL, FALSE);
 
 	if (uri == NULL)
-		*book = e_book_new_system_addressbook(NULL);
+		*book = e_book_new_system_addressbook(error);
 	else
 		*book = e_book_new_from_uri(uri, error);
 
-	result = e_book_open(*book, FALSE, NULL);
+	if (*book == NULL)
+		return FALSE;
+
+	*error = NULL;
+
+	result = e_book_open(*book, FALSE, error);
 
 	if (!result && *book != NULL)
 	{
--- a/pidgin/plugins/gevolution/gevolution.c	Fri Jul 10 02:26:37 2009 +0000
+++ b/pidgin/plugins/gevolution/gevolution.c	Fri Jul 10 02:47:09 2009 +0000
@@ -298,12 +298,18 @@
 {
 	PurplePlugin *plugin = (PurplePlugin *)data;
 	EBookQuery *query;
+	GError *err = NULL;
 
 	timer = 0;
 
 	/* Maybe this is it? */
-	if (!gevo_load_addressbook(NULL, &book, NULL))
+	if (!gevo_load_addressbook(NULL, &book, &err))
+	{
+		purple_debug_error("evolution",
+						 "Error retrieving addressbook: %s\n", err->message);
+		g_error_free(err);
 		return FALSE;
+	}
 
 	query = e_book_query_any_field_contains("");