[tracker/clientapi] libtracker-client: Fix timeout min range and don't allow 0



commit 293659fa63682f5fb709023c4691e2a32357f2e0
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Jan 13 14:38:14 2010 +0000

    libtracker-client: Fix timeout min range and don't allow 0
    
    Also added g_object_notify() for all properties upon set.

 src/libtracker-client/tracker.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-client/tracker.c b/src/libtracker-client/tracker.c
index 2ff5ae9..2af79d4 100644
--- a/src/libtracker-client/tracker.c
+++ b/src/libtracker-client/tracker.c
@@ -211,7 +211,7 @@ tracker_client_class_init (TrackerClientClass *klass)
 	                                 g_param_spec_int ("timeout",
 	                                                   "Timeout",
 	                                                   "Timeout",
-	                                                   G_MININT,
+	                                                   -1,
 	                                                   G_MAXINT,
 	                                                   -1,
 	                                                   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
@@ -258,14 +258,26 @@ client_set_property (GObject      *object,
 	switch (prop_id) {
 	case PROP_ENABLE_WARNINGS:
 		private->enable_warnings = g_value_get_boolean (value);
+		g_object_notify (object, "enable_warnings");
 		break;
 	case PROP_TIMEOUT:
 		private->timeout = g_value_get_int (value);
 
+		/* Sanity check timeout */
+		if (private->timeout == 0) {
+			/* Can't use 0, no D-Bus calls are ever quick
+			 * enough :) which is quite funny.
+			 */
+			private->timeout = -1;
+		}
+
 		if (private->is_constructed) {
 			dbus_g_proxy_set_default_timeout (private->proxy_resources, 
 			                                  private->timeout);
 		}
+
+		g_object_notify (object, "timeout");
+
 		break;
 	default:
 



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