[glib] Properly register the inactivity-timeout property



commit 013f862a03d11708bb08f2ec98c8612f245a8937
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 23 14:04:28 2010 +0200

    Properly register the inactivity-timeout property
    
    It is a uint, not a boolean, so register it as such.
    Also, only install the service timeout if we are actually registered
    as the primary instance.

 gio/gapplication.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gio/gapplication.c b/gio/gapplication.c
index f79302f..c2554c4 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -482,10 +482,11 @@ g_application_class_init (GApplicationClass *class)
                           FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (object_class, PROP_INACTIVITY_TIMEOUT,
-    g_param_spec_boolean ("inactivity-timeout",
-                          P_("Inactivity timeout"),
-                          P_("Iime (ms) to stay alive after becoming idle"),
-                          FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+    g_param_spec_uint ("inactivity-timeout",
+                       P_("Inactivity timeout"),
+                       P_("Iime (ms) to stay alive after becoming idle"),
+                       0, G_MAXUINT, 0,
+                       G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (object_class, PROP_ACTION_GROUP,
     g_param_spec_object ("action-group",
@@ -1159,6 +1160,7 @@ g_application_run (GApplication  *application,
   g_strfreev (arguments);
 
   if (application->priv->flags & G_APPLICATION_IS_SERVICE &&
+      application->priv->is_registered &&
       !application->priv->use_count &&
       !application->priv->inactivity_timeout_id)
     {



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