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



commit a33c12c78b23ddebde07db2d7021b472e2d4fd53
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 1f6f576..ff2aa7c 100644
--- a/eas-daemon/libeas/eas-connection.c
+++ b/eas-daemon/libeas/eas-connection.c
@@ -2337,6 +2337,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]