[evolution-patches] GError patch to e-book.c



we were calling g_propagate_error (error, e) when error was NULL, which
generates console spew.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/ChangeLog,v
retrieving revision 1.174
diff -u -r1.174 ChangeLog
--- ChangeLog	12 Jul 2004 18:21:48 -0000	1.174
+++ ChangeLog	12 Jul 2004 19:01:18 -0000
@@ -1,3 +1,11 @@
+2004-07-12  Chris Toshok  <toshok ximian com>
+
+	* libebook/e-book.c (e_book_get_self): only propagate the GError
+	if @error != NULL.  Fixes some console warnings.
+	(e_book_set_default_source): same.
+	(e_book_new_system_addressbook): same.
+	(e_book_new_default_addressbook): same.
+
 2004-07-09  Chris Toshok  <toshok ximian com>
 
 	[ part of fix for #56520 ]
Index: libebook/e-book.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-book.c,v
retrieving revision 1.35
diff -u -r1.35 e-book.c
--- libebook/e-book.c	24 Jun 2004 01:20:40 -0000	1.35
+++ libebook/e-book.c	12 Jul 2004 19:01:20 -0000
@@ -2938,7 +2938,8 @@
 	*book = e_book_new_system_addressbook (&e);
 
 	if (!*book) {
-		g_propagate_error (error, e);
+		if (error)
+			g_propagate_error (error, e);
 		return FALSE;
 	}
 
@@ -2957,7 +2958,8 @@
 	if (!e_book_get_contact (*book, uid, contact, &e)) {
 		g_object_unref (*book);
 		*book = NULL;
-		g_propagate_error (error, e);
+		if (error)
+			g_propagate_error (error, e);
 		return FALSE;
 	}
 
@@ -3050,7 +3052,8 @@
 	uid = e_source_peek_uid (source);
 
 	if (!e_book_get_addressbooks (&sources, &err)) {
-		g_propagate_error (error, err);
+		if (error)
+			g_propagate_error (error, err);
 		return FALSE;
 	}
 
@@ -3078,7 +3081,8 @@
 	e_source_set_property (source, "default", "true");
 
 	if (!e_source_list_sync (sources, &err)) {
-		g_propagate_error (error, err);
+		if (error)
+			g_propagate_error (error, err);
 		return FALSE;
 	}
 
@@ -3228,7 +3232,8 @@
 	EBook *book;
 
 	if (!e_book_get_addressbooks (&sources, &err)) {
-		g_propagate_error (error, err);
+		if (error)
+			g_propagate_error (error, err);
 		return FALSE;
 	}
 
@@ -3267,8 +3272,10 @@
 		g_free (uri);
 	}
 
-	if (!book)
-		g_propagate_error (error, err);
+	if (!book) {
+		if (error)
+			g_propagate_error (error, err);
+	}
 
 	g_object_unref (sources);
 
@@ -3297,7 +3304,8 @@
 	EBook *book;
 
 	if (!e_book_get_addressbooks (&sources, &err)) {
-		g_propagate_error (error, err);
+		if (error)
+			g_propagate_error (error, err);
 		return FALSE;
 	}
 
@@ -3322,8 +3330,10 @@
 	else
 		book = e_book_new_system_addressbook (&err);
 
-	if (!book)
-		g_propagate_error (error, err);
+	if (!book) {
+		if (error)
+			g_propagate_error (error, err);
+	}
 
 	g_object_unref (sources);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]