evolution r36134 - branches/mail-dbus-remoting/mail



Author: sragavan
Date: Wed Aug 27 18:56:41 2008
New Revision: 36134
URL: http://svn.gnome.org/viewvc/evolution?rev=36134&view=rev

Log:
Add func to get folder info


Modified:
   branches/mail-dbus-remoting/mail/camel-store-remote-impl.c
   branches/mail-dbus-remoting/mail/camel-store-remote.c

Modified: branches/mail-dbus-remoting/mail/camel-store-remote-impl.c
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-store-remote-impl.c	(original)
+++ branches/mail-dbus-remoting/mail/camel-store-remote-impl.c	Wed Aug 27 18:56:41 2008
@@ -448,6 +448,28 @@
 		provider = camel_service_get_provider((CamelService *)store);
 		dbus_message_append_args(reply, DBUS_TYPE_INT32,
 					 &provider->url_flags, DBUS_TYPE_INVALID);
+	} else if (!g_strcmp0(method, "camel_store_get_folder_info")) {
+		char *store_hash_key;
+		CamelStore *store;
+		char *top, *err="";
+		CamelException ex;
+		guint32 flags;
+		CamelFolderInfo *info;
+
+		camel_exception_init (&ex);
+		dbus_message_get_args(message,
+				      NULL,
+				      DBUS_TYPE_STRING, &store_hash_key,
+				      DBUS_TYPE_STRING, &top,
+				      DBUS_TYPE_UINT32, &flags,
+				      DBUS_TYPE_INVALID);
+		
+		store = g_hash_table_lookup(store_hash, store_hash_key);
+		info = camel_store_get_folder_info (store, top, flags, &ex);
+		if (camel_exception_is_set(&ex))
+			err = camel_exception_get_description (&ex);	
+		dbus_message_append_args(reply, DBUS_TYPE_INT32, &info, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID);
+		camel_exception_clear (&ex);
 	} else if (strncmp (method, "camel_object", 12) == 0) {
 		return camel_object_store_signal_handler (connection, message, user_data);
 	} else

Modified: branches/mail-dbus-remoting/mail/camel-store-remote.c
==============================================================================
--- branches/mail-dbus-remoting/mail/camel-store-remote.c	(original)
+++ branches/mail-dbus-remoting/mail/camel-store-remote.c	Wed Aug 27 18:56:41 2008
@@ -416,3 +416,25 @@
 
 	return url_flags;
 }
+
+CamelFolderInfo * camel_store_get_folder_info_remote (CamelStoreRemote *store, const char *top, guint32 flags, CamelException *ex)
+{
+	gboolean ret;
+	DBusError error;
+	gpointer info;
+	int ptr;
+	char *err;
+
+	dbus_error_init(&error);
+
+	ret = dbind_context_method_call(evolution_dbus_peek_context(),
+					CAMEL_DBUS_NAME,
+					CAMEL_STORE_OBJECT_PATH,
+					CAMEL_STORE_INTERFACE,
+					"camel_store_get_folder_info",
+					&error, "ssu=>is", store->object_id, top ? top : "", flags, &ptr, &err);
+
+	info = (gpointer)ptr;
+
+	return info;
+}



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