[evolution-data-server] imapx_store_noop_sync: Don't return FALSE without setting a GError.



commit b025b3e56aefa280c25b027d2d4837dcfa62e3d9
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jun 18 16:01:27 2012 -0400

    imapx_store_noop_sync: Don't return FALSE without setting a GError.

 camel/camel-imapx-store.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c
index e847402..6601678 100644
--- a/camel/camel-imapx-store.c
+++ b/camel/camel-imapx-store.c
@@ -1545,23 +1545,24 @@ imapx_store_noop_sync (CamelStore *store,
                        GError **error)
 {
 	CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
-	GList *servers = NULL, *l;
-	gboolean success = FALSE;
+	GList *list, *link;
+	gboolean success = TRUE;
 
 	if (!camel_offline_store_get_online (CAMEL_OFFLINE_STORE (store)))
 		return TRUE;
 
-	servers = camel_imapx_conn_manager_get_connections (istore->con_man);
+	list = camel_imapx_conn_manager_get_connections (istore->con_man);
 
-	for (l = servers; l != NULL; l = g_list_next (l)) {
-		CamelIMAPXServer *server = CAMEL_IMAPX_SERVER (l->data);
+	for (link = list; link != NULL; link = g_list_next (link)) {
+		CamelIMAPXServer *server = CAMEL_IMAPX_SERVER (link->data);
 
 		/* we just return last noops value, technically not correct though */
 		success = camel_imapx_server_noop (server, NULL, cancellable, error);
-		g_object_unref (server);
+		if (!success)
+			break;
 	}
 
-	g_list_free (servers);
+	g_list_free_full (list, (GDestroyNotify) g_object_unref);
 
 	return success;
 }



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