[evolution-activesync/for-master/folder-sync-hack: 1/2] eas-daemon: add eas_connection_forget_folders
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-activesync/for-master/folder-sync-hack: 1/2] eas-daemon: add eas_connection_forget_folders
- Date: Wed, 6 Mar 2013 10:26:51 +0000 (UTC)
commit 2ff9990dbafb4c5e1af11d87e75af0e850ed1728
Author: Graham R. Cobb <g+syncevolution cobb uk net>
Date: Tue Mar 5 17:33:11 2013 +0000
eas-daemon: add eas_connection_forget_folders
Add function to reset the folder list and cache and reset the
folder sync key to 0. This is necessary when the server has
lost sync state and demands we do a FolderSync from scratch.
eas-daemon/libeas/eas-connection.c | 21 +++++++++++++++++++++
eas-daemon/libeas/eas-connection.h | 3 +++
2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/eas-daemon/libeas/eas-connection.c b/eas-daemon/libeas/eas-connection.c
index 02841fe..1f6f576 100644
--- a/eas-daemon/libeas/eas-connection.c
+++ b/eas-daemon/libeas/eas-connection.c
@@ -2319,6 +2319,27 @@ eas_connection_get_multipartdata (EasConnection* self, guint partID)
}
void
+eas_connection_forget_folders (EasConnection *self, GError **error)
+{
+ GFile *file;
+
+ g_key_file_free(self->priv->folders);
+ self->priv->folders = g_key_file_new ();
+ if (!self->priv->folders) {
+ g_set_error (error,
+ EAS_CONNECTION_ERROR,
+ EAS_CONNECTION_ERROR_NOTENOUGHMEMORY,
+ "Could not reset folder list");
+ return;
+ }
+ g_key_file_set_string (self->priv->folders, "##storedata", "synckey", "0");
+
+ file = g_file_new_for_path (self->priv->folders_keyfile);
+ g_file_delete(file, NULL, error);
+ g_object_unref (file);
+}
+
+void
eas_connection_update_folders (void *self, const gchar *ret_sync_key,
GSList *added_folders, GSList *updated_folders,
GSList *deleted_folders, GError *error)
diff --git a/eas-daemon/libeas/eas-connection.h b/eas-daemon/libeas/eas-connection.h
index 41ac7ff..e40c54a 100644
--- a/eas-daemon/libeas/eas-connection.h
+++ b/eas-daemon/libeas/eas-connection.h
@@ -232,6 +232,9 @@ gchar*
eas_connection_get_multipartdata (EasConnection* self, guint partID);
void
+eas_connection_forget_folders (EasConnection *self, GError **error);
+
+void
eas_connection_update_folders (void *self, const gchar *ret_sync_key,
GSList *added_folders, GSList *updated_folders,
GSList *deleted_folders, GError *error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]