evolution r36609 - in branches/gnome-2-24: calendar calendar/gui calendar/gui/dialogs plugins/mark-calendar-offline plugins/select-one-source



Author: msuman
Date: Mon Oct 13 10:23:51 2008
New Revision: 36609
URL: http://svn.gnome.org/viewvc/evolution?rev=36609&view=rev

Log:
Fix for bug #424818 (bugzilla.novell.com) - Use the correct properties while setting/deciding offline availability of calendars.

Modified:
   branches/gnome-2-24/calendar/ChangeLog
   branches/gnome-2-24/calendar/gui/dialogs/calendar-setup.c
   branches/gnome-2-24/calendar/gui/e-cal-popup.c
   branches/gnome-2-24/calendar/gui/tasks-component.c
   branches/gnome-2-24/plugins/mark-calendar-offline/ChangeLog
   branches/gnome-2-24/plugins/mark-calendar-offline/mark-calendar-offline.c
   branches/gnome-2-24/plugins/select-one-source/ChangeLog
   branches/gnome-2-24/plugins/select-one-source/mark-calendar-offline.c

Modified: branches/gnome-2-24/calendar/gui/dialogs/calendar-setup.c
==============================================================================
--- branches/gnome-2-24/calendar/gui/dialogs/calendar-setup.c	(original)
+++ branches/gnome-2-24/calendar/gui/dialogs/calendar-setup.c	Mon Oct 13 10:23:51 2008
@@ -259,7 +259,8 @@
 	GtkWidget *offline_setting = NULL;
 	const char *offline_sync;
 	int row;
-	gboolean is_local = g_str_has_prefix (e_source_group_peek_base_uri (sdialog->source_group), "file:");
+	const char *base_uri = e_source_group_peek_base_uri (sdialog->source_group); 
+	gboolean is_local = base_uri && (g_str_has_prefix (base_uri, "file://") || g_str_has_prefix (base_uri, "contacts://"));
 	offline_sync =  e_source_get_property (sdialog->source, "offline_sync");
 	if (old)
 		return old;

Modified: branches/gnome-2-24/calendar/gui/e-cal-popup.c
==============================================================================
--- branches/gnome-2-24/calendar/gui/e-cal-popup.c	(original)
+++ branches/gnome-2-24/calendar/gui/e-cal-popup.c	Mon Oct 13 10:23:51 2008
@@ -695,7 +695,7 @@
 {
 	ECalPopupTargetSource *t = e_popup_target_new(&eabp->popup, E_CAL_POPUP_TARGET_SOURCE, sizeof(*t));
 	guint32 mask = ~0;
-	const char *source_uri;
+	const char *relative_uri;
 	char *uri;
 	ESource *source;
 	const char *offline = NULL;
@@ -712,42 +712,32 @@
 		mask &= ~E_CAL_POPUP_SOURCE_PRIMARY;
 
 	/* FIXME Gross hack, should have a property or something */
-	source_uri = e_source_peek_relative_uri(source);
-	if (source_uri && !strcmp("system", source_uri))
+	relative_uri = e_source_peek_relative_uri(source);
+	if (relative_uri && !strcmp("system", relative_uri))
 		mask &= ~E_CAL_POPUP_SOURCE_SYSTEM;
 	else
 		mask &= ~E_CAL_POPUP_SOURCE_USER;
 
-	source = e_source_selector_peek_primary_selection (selector);
 	uri = e_source_get_uri (source);
 	if (!uri || (g_ascii_strncasecmp (uri, "file://", 7) && g_ascii_strncasecmp (uri, "contacts://", 11))) {
 		/* check for e_target_selector's offline_status property here */
-		offline = e_source_get_property (source, "offline");
-
-		if (offline  && strcmp (offline,"1") == 0) {
-			/* set the menu item to Mark Offline - */
-			mask &= ~E_CAL_POPUP_SOURCE_NO_OFFLINE;
-		} else {
+		offline = e_source_get_property (source, "offline_sync");
+		if (offline  && strcmp (offline, "1") == 0)
+			mask &= ~E_CAL_POPUP_SOURCE_NO_OFFLINE; 	/* set the menu item to Mark Offline */
+		else
 			mask &= ~E_CAL_POPUP_SOURCE_OFFLINE;
-		}
 	} else {
 		mask |= E_CAL_POPUP_SOURCE_NO_OFFLINE;
 		mask |= E_CAL_POPUP_SOURCE_OFFLINE;
 	}
 	g_free (uri);
 
-	source = e_source_selector_peek_primary_selection (selector);
-	/*check for delete_status property here*/
+	/* check for delete_status property here */
 	delete = e_source_get_property (source, "delete");
-
-	if (delete && strcmp (delete,"no") == 0) {
-		/*set the menu item to non deletable */
-		mask &= ~E_CAL_POPUP_SOURCE_NO_DELETE;
-	}
-	else {
+	if (delete && strcmp (delete, "no") == 0)
+		mask &= ~E_CAL_POPUP_SOURCE_NO_DELETE; 			/* set the menu item to non deletable */
+	else
 		mask &= ~E_CAL_POPUP_SOURCE_DELETE;
-	}
-
 
 	t->target.mask = mask;
 

Modified: branches/gnome-2-24/calendar/gui/tasks-component.c
==============================================================================
--- branches/gnome-2-24/calendar/gui/tasks-component.c	(original)
+++ branches/gnome-2-24/calendar/gui/tasks-component.c	Mon Oct 13 10:23:51 2008
@@ -134,7 +134,7 @@
 	personal_source = NULL;
 
 	if (!e_cal_get_sources (&source_list, E_CAL_SOURCE_TYPE_TODO, NULL)) {
-		g_warning ("Could not get addressbook source list from GConf!");
+		g_warning ("Could not get task source list from GConf!");
 		return;
 	}
 

Modified: branches/gnome-2-24/plugins/mark-calendar-offline/mark-calendar-offline.c
==============================================================================
--- branches/gnome-2-24/plugins/mark-calendar-offline/mark-calendar-offline.c	(original)
+++ branches/gnome-2-24/plugins/mark-calendar-offline/mark-calendar-offline.c	Mon Oct 13 10:23:51 2008
@@ -41,7 +41,7 @@
 	ESource *source;
 
 	source = e_source_selector_peek_primary_selection (target->selector);
-	e_source_set_property (source, "offline", "0");
+	e_source_set_property (source, "offline_sync", "0");
 }
 
 void
@@ -50,6 +50,6 @@
 	ESource *source;
 
 	source = e_source_selector_peek_primary_selection (target->selector);
-	e_source_set_property (source, "offline", "1");
+	e_source_set_property (source, "offline_sync", "1");
 }
 

Modified: branches/gnome-2-24/plugins/select-one-source/mark-calendar-offline.c
==============================================================================
--- branches/gnome-2-24/plugins/select-one-source/mark-calendar-offline.c	(original)
+++ branches/gnome-2-24/plugins/select-one-source/mark-calendar-offline.c	Mon Oct 13 10:23:51 2008
@@ -42,7 +42,7 @@
 	ESource *source;
 
 	source = e_source_selector_peek_primary_selection (target->selector);
-	e_source_set_property (source, "offline", "0");
+	e_source_set_property (source, "offline_sync", "0");
 }
 
 void
@@ -51,6 +51,6 @@
 	ESource *source;
 
 	source = e_source_selector_peek_primary_selection (target->selector);
-	e_source_set_property (source, "offline", "1");
+	e_source_set_property (source, "offline_sync", "1");
 }
 



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