evolution r36198 - branches/mail-dbus-remoting/mail
- From: abharath svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36198 - branches/mail-dbus-remoting/mail
- Date: Fri, 29 Aug 2008 09:53:04 +0000 (UTC)
Author: abharath
Date: Fri Aug 29 09:53:04 2008
New Revision: 36198
URL: http://svn.gnome.org/viewvc/evolution?rev=36198&view=rev
Log:
The last set of funcs to be remoted I guess. Now lets move everything to
the remote funcs and Folder to Remote.
Modified:
branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c
branches/mail-dbus-remoting/mail/camel-folder-remote.c
branches/mail-dbus-remoting/mail/camel-folder-remote.h
Modified: branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c (original)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote-impl.c Fri Aug 29 09:53:04 2008
@@ -237,6 +237,51 @@
camel_folder_set_message_user_tag (folder, uid, name, user_tag);
dbus_message_append_args (return_val, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_expunge") == 0) {
+ gboolean ret;
+ char *err;
+ CamelException *ex;
+
+ ex = camel_exception_new ();
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ camel_folder_expunge (folder, ex);
+
+ if (camel_exception_is_set(ex))
+ err = g_strdup (camel_exception_get_description (ex));
+ else
+ err = g_strdup ("");
+
+ camel_exception_free (ex);
+
+ dbus_message_append_args (return_val, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_has_search_capability") == 0) {
+ gboolean ret, has_search;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ has_search = camel_folder_has_search_capability (folder);
+ dbus_message_append_args (return_val, DBUS_TYPE_INT32, &has_search, DBUS_TYPE_INVALID);
+ } else if (strcmp(method, "camel_folder_get_message_flags") == 0) {
+ gboolean ret;
+ const char *uid;
+ guint32 message_flags;
+
+ ret = dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &folder_hash_key,
+ DBUS_TYPE_STRING, &uid,
+ DBUS_TYPE_INVALID);
+ folder = g_hash_table_lookup (folder_hash, folder_hash_key);
+
+ message_flags = camel_folder_get_message_flags(folder, uid);
+ dbus_message_append_args (return_val, DBUS_TYPE_UINT32, &message_flags, DBUS_TYPE_INVALID);
} else if (strcmp (method, "camel_vee_folder_set_expression") == 0) {
gboolean ret;
const char *query;
Modified: branches/mail-dbus-remoting/mail/camel-folder-remote.c
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-folder-remote.c (original)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote.c Fri Aug 29 09:53:04 2008
@@ -399,6 +399,82 @@
d(printf("Camel folder set message user tag remotely\n"));
}
+void
+camel_folder_remote_expunge (CamelFolderRemote *folder, CamelException *ex)
+{
+ gboolean ret;
+ DBusError error;
+ char *err;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_expunge",
+ &error,
+ "s=>s", folder->object_id, &err);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder expunge: %s\n", error.message);
+ return;
+ }
+
+ d(printf("Camel folder expunge remotely\n"));
+}
+
+gboolean
+camel_folder_remote_has_search_capability (CamelFolderRemote *folder)
+{
+ gboolean ret, has_search;
+ DBusError error;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_has_search_capability",
+ &error,
+ "s=>i", folder->object_id, &has_search);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder checking for search capability: %s\n", error.message);
+ return 0;
+ }
+
+ d(printf("Camel folder checking for search capability remotely\n"));
+ return has_search;
+}
+
+guint32
+camel_folder_remote_get_message_flags (CamelFolderRemote *folder, const char *uid)
+{
+ gboolean ret;
+ DBusError error;
+ guint32 message_flags;
+
+ dbus_error_init (&error);
+ /* Invoke the appropriate dbind call to MailSessionRemoteImpl */
+ ret = dbind_context_method_call (evolution_dbus_peek_context(),
+ CAMEL_DBUS_NAME,
+ CAMEL_FOLDER_OBJECT_PATH,
+ CAMEL_FOLDER_INTERFACE,
+ "camel_folder_get_message_flags",
+ &error,
+ "ss=>u", folder->object_id, uid, &message_flags);
+
+ if (!ret) {
+ g_warning ("Error: Camel folder get message flags: %s\n", error.message);
+ return 0;
+ }
+
+ d(printf("Camel folder get message flags remotely\n"));
+
+ return message_flags;
+}
void
camel_folder_remote_set_vee_folder_expression (CamelFolderRemote *folder, const char *query)
Modified: branches/mail-dbus-remoting/mail/camel-folder-remote.h
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-folder-remote.h (original)
+++ branches/mail-dbus-remoting/mail/camel-folder-remote.h Fri Aug 29 09:53:04 2008
@@ -39,6 +39,15 @@
void camel_folder_remote_set_message_user_tag (CamelFolderRemote *folder, const char *uid, const char *name, const char *value);
+void camel_folder_remote_expunge (CamelFolderRemote *folder, CamelException *ex);
+
+gboolean camel_folder_remote_has_search_capability (CamelFolderRemote *folder);
+
+guint32 camel_folder_remote_get_message_flags (CamelFolderRemote *folder, const char *uid);
+
+#define camel_folder_remote_delete_message(folder, uid) \
+ camel_folder_remote_set_message_flags (folder, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN)
+
void camel_folder_remote_set_vee_folder_expression (CamelFolderRemote *folder, const char *query);
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]