[evolution-activesync/for-master/folder-sync-hack: 3/3] eas-daemon: fix eas_connection_forget_folders



commit 79118cfa35aa6f87d38f8cbe79eb8e1f9f1afdc2
Author: Patrick Ohly <patrick ohly intel com>
Date:   Thu Mar 7 10:41:23 2013 -0800

    eas-daemon: fix eas_connection_forget_folders
    
    Dropping folders must also work when the key file has not been created
    yet. Setting up a fresh config failed otherwise after applying the
    "eas-daemon: workround folder sync when server loses state" patch.

 eas-daemon/libeas/eas-connection.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/eas-daemon/libeas/eas-connection.c b/eas-daemon/libeas/eas-connection.c
index 4e3e474..64dbaa2 100644
--- a/eas-daemon/libeas/eas-connection.c
+++ b/eas-daemon/libeas/eas-connection.c
@@ -2354,6 +2354,13 @@ eas_connection_forget_folders (EasConnection *self, GError **error)
        file = g_file_new_for_path (self->priv->folders_keyfile);
        g_file_delete(file, NULL, error);
        g_object_unref (file);
+
+       /*
+        * It is not an error when deleting fails because the file did
+        * not exist in the first place.
+        */
+       if (g_error_matches (*error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
+               g_clear_error (error);
 }
 
 void


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