evolution-mapi r110 - trunk/src/calendar



Author: mcrha
Date: Mon Feb  9 13:41:23 2009
New Revision: 110
URL: http://svn.gnome.org/viewvc/evolution-mapi?rev=110&view=rev

Log:
2009-02-09  Milan Crha  <mcrha redhat com>

	** Fix for bug #567860

	* e-cal-backend-mapi.c: (e_cal_backend_mapi_create_object),
	(e_cal_backend_mapi_modify_object):
	Set CREATED/LAST-MODIFIED times properly.

	* e-cal-backend-mapi.c: (e_cal_backend_mapi_set_mode):
	Do not require authentication when isn't reopening.



Modified:
   trunk/src/calendar/ChangeLog
   trunk/src/calendar/e-cal-backend-mapi.c

Modified: trunk/src/calendar/e-cal-backend-mapi.c
==============================================================================
--- trunk/src/calendar/e-cal-backend-mapi.c	(original)
+++ trunk/src/calendar/e-cal-backend-mapi.c	Mon Feb  9 13:41:23 2009
@@ -1302,6 +1302,7 @@
 	GSList *streams = NULL;
 	struct cbdata cbdata;
 	struct Binary_r globalid;
+	struct icaltimetype current;
 
 	cbmapi = E_CAL_BACKEND_MAPI (backend);
 	priv = cbmapi->priv;
@@ -1326,6 +1327,10 @@
 	comp = e_cal_component_new ();
 	e_cal_component_set_icalcomponent (comp, icalcomp);
 
+	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
+ 	e_cal_component_set_created (comp, &current);
+ 	e_cal_component_set_last_modified (comp, &current);
+
 	/* FIXME: [WIP] Add support for recurrences */
 	if (e_cal_component_has_recurrences (comp)) {
 		GByteArray *ba = exchange_mapi_cal_util_rrule_to_bin (comp, NULL); 
@@ -1488,7 +1493,8 @@
 	GSList *attachments = NULL;
 	struct cbdata cbdata;
 	gboolean no_increment = FALSE;
-	icalproperty *prop; 
+	icalproperty *prop;
+	struct icaltimetype current;
 
 	*old_object = *new_object = NULL;
 	cbmapi = E_CAL_BACKEND_MAPI (backend);
@@ -1524,6 +1530,9 @@
 	comp = e_cal_component_new ();
 	e_cal_component_set_icalcomponent (comp, icalcomp);
 
+	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
+ 	e_cal_component_set_last_modified (comp, &current);
+
 	/* FIXME: [WIP] Add support for recurrences */
 	if (e_cal_component_has_recurrences (comp)) {
 		GByteArray *ba = exchange_mapi_cal_util_rrule_to_bin (comp, NULL); 
@@ -2234,6 +2243,7 @@
 {
 	ECalBackendMAPI *cbmapi;
 	ECalBackendMAPIPrivate *priv;
+	gboolean re_open = FALSE;
 
 	cbmapi = E_CAL_BACKEND_MAPI (backend);
 	priv = cbmapi->priv;
@@ -2246,6 +2256,8 @@
 
 	g_mutex_lock (priv->mutex);
 
+	re_open = priv->mode == CAL_MODE_LOCAL && mode == CAL_MODE_REMOTE;
+
 	priv->mode_changed = TRUE;
 	switch (mode) {
 		case CAL_MODE_REMOTE:
@@ -2254,7 +2266,7 @@
 			e_cal_backend_notify_mode (backend, GNOME_Evolution_Calendar_CalListener_MODE_SET,
 					GNOME_Evolution_Calendar_MODE_REMOTE);
 			e_cal_backend_notify_readonly (backend, priv->read_only);
-			if (e_cal_backend_mapi_is_loaded (backend))
+			if (e_cal_backend_mapi_is_loaded (backend) && re_open)
 		              e_cal_backend_notify_auth_required(backend);
 			break;
 		case CAL_MODE_LOCAL:



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