evolution-exchange r1875 - in trunk: . calendar



Author: mcrha
Date: Mon Feb  9 12:48:50 2009
New Revision: 1875
URL: http://svn.gnome.org/viewvc/evolution-exchange?rev=1875&view=rev

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

	** Fix for bug #432885

	* calendar/e-cal-backend-exchange.c: (open_calendar): Rescan foreign
	hierarchy same as personal one, to get list of shared calendars before
	giving up opening of the foreign calendar.



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

Modified: trunk/calendar/e-cal-backend-exchange.c
==============================================================================
--- trunk/calendar/e-cal-backend-exchange.c	(original)
+++ trunk/calendar/e-cal-backend-exchange.c	Mon Feb  9 12:48:50 2009
@@ -427,6 +427,7 @@
 	if (!cbex->folder) {
 		ESource *source;
 		const char *foreign;
+		ExchangeHierarchy *hier_to_rescan = NULL;
 		/* FIXME: theoretically we should create it if
 		 * only_if_exists is FALSE.
 		 */
@@ -443,21 +444,30 @@
 			email = split_path [0];
 
 			exchange_account_scan_foreign_hierarchy (cbex->account, email);
+
 			cbex->folder = exchange_account_get_folder (cbex->account, uristr);
+			if (!cbex->folder) {
+				/* Folder is not known at the moment, thus try to rescan foreign
+				   folder, just in case we didn't scan it fully yet. */
+				hier_to_rescan = exchange_account_get_hierarchy_by_email (cbex->account, email);
+			}
 
 			g_strfreev (split_path);
 		} else {
 			/* Rescan to see if this is any new calendar */
-		        ExchangeHierarchy *hier;
-
-			hier = exchange_account_get_hierarchy_by_type (cbex->account, EXCHANGE_HIERARCHY_PERSONAL);
-			if (!hier)
+			hier_to_rescan = exchange_account_get_hierarchy_by_type (cbex->account, EXCHANGE_HIERARCHY_PERSONAL);
+			if (!hier_to_rescan) {
+				g_mutex_unlock (cbex->priv->open_lock);
 				return GNOME_Evolution_Calendar_RepositoryOffline;
-	       	       	g_object_ref (hier->toplevel);
-	       	       	e_folder_exchange_set_rescan_tree (hier->toplevel, TRUE);
-	               	exchange_hierarchy_scan_subtree (hier, hier->toplevel, ONLINE_MODE);
-	               	e_folder_exchange_set_rescan_tree (hier->toplevel, FALSE);
-	               	g_object_unref (hier->toplevel);
+			}
+		}
+
+		if (hier_to_rescan) {
+	       	       	g_object_ref (hier_to_rescan->toplevel);
+	       	       	e_folder_exchange_set_rescan_tree (hier_to_rescan->toplevel, TRUE);
+	               	exchange_hierarchy_scan_subtree (hier_to_rescan, hier_to_rescan->toplevel, ONLINE_MODE);
+	               	e_folder_exchange_set_rescan_tree (hier_to_rescan->toplevel, FALSE);
+	               	g_object_unref (hier_to_rescan->toplevel);
 
 	               	cbex->folder = exchange_account_get_folder (cbex->account, uristr);
 		 	if (!cbex->folder)



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