Re: [evolution-patches] calendar, mail and exchange: patch for bug #231968



Hi,

Sending one modified patch (exchange part). Please review it.

Thanks,
Shakti


On Wed, 2005-07-27 at 19:04 +0530, Sarfraaz Ahmed wrote:
> Hmm, found some more things which i should have pointed out in my 
> earlier review :)
> 

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/ChangeLog,v
retrieving revision 1.35
diff -u -p -r1.35 ChangeLog
--- ChangeLog	27 Jul 2005 09:12:38 -0000	1.35
+++ ChangeLog	28 Jul 2005 12:28:17 -0000
@@ -1,3 +1,14 @@
+2005-07-26  Shakti Sen <shprasad novell com>
+
+	* Makefile.am: Included 'calendar' in INCLUDES and some .la in 
+	'liborg_gnome_exchange_operations_la_LIBADD'
+	* exchange-folder-permission.c: Added the functionality for 
+	'File->Permissions' menu-item for Calendar, Tasks and Contacts.
+	* exchange-permissions-dialog.c (exchange_permissions_dialog_new):
+	Takes care of 'folder' is not-null.
+
+	Fixes bug #231968.
+
 2005-07-27  Harry Lu  <harry lu sun com>
 
 	Only show the unsubscribe menu if it is an exchange folder.
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/Makefile.am,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile.am
--- Makefile.am	25 Jul 2005 07:37:03 -0000	1.12
+++ Makefile.am	28 Jul 2005 12:28:18 -0000
@@ -1,6 +1,7 @@
 INCLUDES = -I .						\
 	-I$(top_srcdir)	                                \
 	-I$(top_srcdir)/widgets				\
+	-I$(top_srcdir)/calendar			\
 	$(EVOLUTION_MAIL_CFLAGS) 			\
 	$(CAMEL_EXCHANGE_CFLAGS)                        \
 	$(CAMEL_CFLAGS)					\
@@ -47,10 +48,13 @@ liborg_gnome_exchange_operations_la_SOUR
 	exchange-folder.c
 
 liborg_gnome_exchange_operations_la_LIBADD = 		\
+	$(EVOLUTION_MAIL_LIBS)				\
+	$(CAMEL_EXCHANGE_LIBS)				\
 	$(top_builddir)/e-util/libeutil.la 			\
 	$(top_builddir)/widgets/misc/libemiscwidgets.la		\
-	$(CAMEL_LIBS)						\
-	$(CAMEL_EXCHANGE_LIBS)
+	$(top_builddir)/calendar/gui/libevolution-calendar.la 	\
+	$(top_builddir)/mail/libevolution-mail.la 		\
+	$(top_builddir)/addressbook/gui/component/libevolution-addressbook.la
 
 liborg_gnome_exchange_operations_la_LDFLAGS = -module -avoid-version
 
Index: exchange-folder-permission.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-folder-permission.c,v
retrieving revision 1.5
diff -u -p -r1.5 exchange-folder-permission.c
--- exchange-folder-permission.c	25 Jul 2005 07:37:03 -0000	1.5
+++ exchange-folder-permission.c	28 Jul 2005 12:28:18 -0000
@@ -34,6 +34,7 @@
 #include <libedataserverui/e-source-selector.h>
 #include <mail/em-popup.h>
 #include <mail/em-menu.h>
+#include <libebook/e-book.h>
 #include "exchange-config-listener.h"
 #include "exchange-operations.h"
 #include "exchange-permissions-dialog.h"
@@ -227,37 +228,88 @@ org_gnome_exchange_menu_folder_permissio
 void
 org_gnome_exchange_menu_cal_permissions (EPlugin *ep, ECalMenuTargetSelect *target)
 {
-#if 0
 	ExchangeAccount *account = NULL;
 	EFolder *folder = NULL;
-	ECalModel *model = target->model;
-	ECal *ecal;
-	ecal = e_cal_model_get_default_client (model);
-	gchar *uri = e_cal_get_uri (ecal);
-	
-
-	if (target == NULL)
-		return;
+	ECalModel *model = NULL;
+	ECal *ecal = NULL;
+	gchar *uri = NULL;
 
 	account = exchange_operations_get_exchange_account ();
 
 	if (!account)
 		return;
 
-	//folder = exchange_account_get_folder (account, target->target->uri);
-	//if (folder)
-	//	exchange_permissions_dialog_new (account, folder, NULL);
-#endif
+	if (!target)
+		return;
+
+	if (target->model)
+		model = E_CAL_MODEL (target->model);
+
+	ecal = e_cal_model_get_default_client (model);
+	uri = (gchar *) e_cal_get_uri (ecal);
+
+	if (uri && !g_str_has_prefix (uri, "exchange://"))
+		return;
+
+	folder = exchange_account_get_folder (account, uri);
+	exchange_permissions_dialog_new (account, folder, NULL);
 }
 
 void
 org_gnome_exchange_menu_tasks_permissions (EPlugin *ep, ECalMenuTargetSelect *target)
 {
+	ExchangeAccount *account = NULL;
+	EFolder *folder = NULL;
+	ECalModel *model = NULL;
+	ECal *ecal = NULL;
+	gchar *uri = NULL;
+
+	account = exchange_operations_get_exchange_account ();
+
+	if (!account)
+		return;
+
+	if (!target)
+		return;
+
+	if (target->model)
+		model = E_CAL_MODEL (target->model);
+
+	ecal = e_cal_model_get_default_client (model);
+	uri = (gchar *) e_cal_get_uri (ecal);
+
+	if (uri && !g_str_has_prefix (uri, "exchange://"))
+		return;
+
+	folder = exchange_account_get_folder (account, uri);
+	exchange_permissions_dialog_new (account, folder, NULL);
 
 }
 
 void
 org_gnome_exchange_menu_ab_permissions (EPlugin *ep, EABMenuTargetSelect *target)
 {
+	ExchangeAccount *account = NULL;
+	EFolder *folder = NULL;
+	EBook *ebook = NULL;
+	gchar *uri = NULL;
+
+	if (!target)
+		return;
+
+	account = exchange_operations_get_exchange_account ();
+
+	if (!account)
+		return;
 
+	if (target->book)
+		ebook = E_BOOK (target->book);
+
+	uri = (gchar *) e_book_get_uri (ebook);
+
+	if (uri && !g_str_has_prefix (uri, "exchange://"))
+		return;
+
+	folder = exchange_account_get_folder (account, uri);
+	exchange_permissions_dialog_new (account, folder, NULL);
 }
Index: exchange-permissions-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-permissions-dialog.c,v
retrieving revision 1.7
diff -u -p -r1.7 exchange-permissions-dialog.c
--- exchange-permissions-dialog.c	25 Jul 2005 06:12:03 -0000	1.7
+++ exchange-permissions-dialog.c	28 Jul 2005 12:28:18 -0000
@@ -173,6 +173,8 @@ exchange_permissions_dialog_new (Exchang
 	xmlNode *xml_form;
 	GByteArray *binary_form;
 
+	g_return_if_fail (folder);
+
 	ctx = exchange_account_get_context (account);
 	g_return_if_fail (ctx);
 	xml = glade_xml_new (


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