[evolution-data-server] camel_folder_synchronize_sync: Connect the CamelService first.



commit 5e614c4bca508370280318dff428f0861ec6f537
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jul 11 22:17:02 2013 -0400

    camel_folder_synchronize_sync: Connect the CamelService first.

 camel/camel-folder.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 3e017fb..51abe3d 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -4222,13 +4222,21 @@ camel_folder_synchronize_sync (CamelFolder *folder,
                                GError **error)
 {
        CamelFolderClass *class;
-       gboolean success = TRUE;
+       CamelStore *parent_store;
+       gboolean success;
 
        g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
 
        class = CAMEL_FOLDER_GET_CLASS (folder);
        g_return_val_if_fail (class->synchronize_sync != NULL, FALSE);
 
+       /* Need to connect the service before we can synchronize. */
+       parent_store = camel_folder_get_parent_store (folder);
+       success = camel_service_connect_sync (
+               CAMEL_SERVICE (parent_store), cancellable, error);
+       if (!success)
+               return FALSE;
+
        camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK);
 
        /* Check for cancellation after locking. */


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