jana r732 - in trunk: . libjana-ecal



Author: rbradford
Date: Mon Jan 12 17:06:55 2009
New Revision: 732
URL: http://svn.gnome.org/viewvc/jana?rev=732&view=rev

Log:
2009-01-12  Rob Bradford  <rob linux intel com>

  * libjana-ecal/jana-ecal-store-view.c
  (jana_ecal_store_view_set_property), (store_view_set_range):
  Make jana_store_view_set_range () an atomic operation on
  JanaEcalStoreView. This avoids potential races when setting up the
  range on the ECalView.

Modified:
   trunk/ChangeLog
   trunk/libjana-ecal/jana-ecal-store-view.c

Modified: trunk/libjana-ecal/jana-ecal-store-view.c
==============================================================================
--- trunk/libjana-ecal/jana-ecal-store-view.c	(original)
+++ trunk/libjana-ecal/jana-ecal-store-view.c	Mon Jan 12 17:06:55 2009
@@ -136,7 +136,6 @@
 				   const GValue *value, GParamSpec *pspec)
 {
 	JanaEcalStoreViewPrivate *priv = STORE_VIEW_PRIVATE (object);
-	JanaTime *time;
 
 	switch (property_id) {
 	    case PROP_PARENT :
@@ -144,40 +143,14 @@
 		store_view_refresh_query (JANA_ECAL_STORE_VIEW (object));
 		break;
 	    case PROP_START :
-		if (priv->start) g_object_unref (priv->start);
-		time = JANA_TIME (g_value_get_object (value));
-		if (!time) {
-			priv->start = NULL;
-			break;
-		}
-		
-		if (JANA_ECAL_IS_TIME (time))
-			priv->start = JANA_ECAL_TIME (
-				jana_time_duplicate (time));
-		else
-			priv->start = JANA_ECAL_TIME (jana_utils_time_copy (
-				time, jana_ecal_time_new ()));
-
-		if (!priv->refresh_id) priv->refresh_id = g_idle_add (
-			(GSourceFunc)store_view_refresh_query, object);
+		jana_store_view_set_range (JANA_STORE_VIEW (object), 
+			JANA_TIME (g_value_get_object (value)),
+			JANA_TIME (priv->end));
 		break;
 	    case PROP_END :
-		if (priv->end) g_object_unref (priv->end);
-		time = JANA_TIME (g_value_get_object (value));
-		if (!time) {
-			priv->end = NULL;
-			break;
-		}
-		
-		if (JANA_ECAL_IS_TIME (time))
-			priv->end = JANA_ECAL_TIME (
-				jana_time_duplicate (time));
-		else
-			priv->end = JANA_ECAL_TIME (jana_utils_time_copy (
-				time, jana_ecal_time_new ()));
-
-		if (!priv->refresh_id) priv->refresh_id = g_idle_add (
-			(GSourceFunc)store_view_refresh_query, object);
+		jana_store_view_set_range (JANA_STORE_VIEW (object), 
+			JANA_TIME (priv->start), 
+			JANA_TIME (g_value_get_object (value)));
 		break;
 	    case PROP_TIMEOUT :
 		priv->timeout = g_value_get_uint (value);
@@ -687,9 +660,33 @@
 		      JanaTime *start,
 		      JanaTime *end)
 {
-	/*JanaEcalStoreViewPrivate *priv = STORE_VIEW_PRIVATE (self);*/
+	JanaEcalStoreViewPrivate *priv = STORE_VIEW_PRIVATE (self);
+
+	if (priv->start) g_object_unref (priv->start);
+	if (!start) {
+		priv->start = NULL;
+	} else {
+		if (JANA_ECAL_IS_TIME (start))
+			priv->start = JANA_ECAL_TIME (
+				jana_time_duplicate (start));
+		else
+			priv->start = JANA_ECAL_TIME (jana_utils_time_copy (
+				start, jana_ecal_time_new ()));
+	}
+
+	if (priv->end) g_object_unref (priv->end);
+	if (!end) {
+		priv->end = NULL;
+	} else {
+		if (JANA_ECAL_IS_TIME (end))
+			priv->end = JANA_ECAL_TIME (
+				jana_time_duplicate (end));
+		else
+			priv->end = JANA_ECAL_TIME (jana_utils_time_copy (
+				end, jana_ecal_time_new ()));
+	}
 
-	g_object_set (self, "start", start, "end", end, NULL);
+	store_view_refresh_query (JANA_ECAL_STORE_VIEW (self));
 }
 
 static JanaStoreViewMatch *



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