[glib/wip/gapplication] Some fixes



commit bce2ce7edee953f82536ae168f92f4a67809c3d1
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu May 20 17:17:09 2010 -0400

    Some fixes
    
    Fix default-exit<>default-quit confusion. It is 'quit' everywhere now.
    Also fix the introspection data for Quit to declare the timestamp
    argument.

 gio/gapplication.c     |   83 ++++++++++++++++++++++++-----------------------
 gio/gunixapplication.c |    4 +-
 2 files changed, 44 insertions(+), 43 deletions(-)
---
diff --git a/gio/gapplication.c b/gio/gapplication.c
index 88f502e..82fb91c 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -49,7 +49,7 @@ enum
   PROP_0,
 
   PROP_APPID,
-  PROP_DEFAULT_EXIT,
+  PROP_DEFAULT_QUIT,
   PROP_IS_REMOTE
 };
 
@@ -75,7 +75,7 @@ struct _GApplicationPrivate
   GHashTable *actions; /* name -> GApplicationAction */
   GMainLoop *mainloop;
 
-  gboolean default_exit : 1;
+  gboolean default_quit : 1;
   gboolean is_remote : 1;
 
   guint actions_changed_id;
@@ -92,9 +92,9 @@ static void     _g_application_platform_init                    (GApplication  *
 static gboolean _g_application_platform_acquire_single_instance (const char    *appid,
                                                                  GError       **error);
 static void     _g_application_platform_remote_invoke_action    (GApplication  *app,
-								 const char    *action,
-								 guint          timestamp);
-static void     _g_application_platform_default_exit            (void) G_GNUC_NORETURN;
+                                                                 const char    *action,
+                                                                 guint          timestamp);
+static void     _g_application_platform_default_quit            (void) G_GNUC_NORETURN;
 static void     _g_application_platform_on_actions_changed      (GApplication  *app);
 
 #ifdef G_OS_UNIX
@@ -276,7 +276,8 @@ g_application_remove_action (GApplication *application,
  * This function has different behavior depending on whether @application
  * is acting as a proxy for another process.  In the normal case where
  * the current process is hosting the application, and the specified
- * action exists and is enabled, the #GApplication::action signal will be emitted.
+ * action exists and is enabled, the #GApplication::action signal will
+ * be emitted.
  *
  * If @application is a proxy, then the specified action will be invoked
  * in the remote process.  It is not necessary to call g_application_add_action()
@@ -401,7 +402,7 @@ g_application_set_action_enabled (GApplication *application,
  */
 G_CONST_RETURN gchar *
 g_application_get_action_description (GApplication *application,
-				      const char   *name)
+                                      const char   *name)
 {
   GApplicationAction *action;
   
@@ -470,10 +471,10 @@ g_application_run (GApplication *application)
  * @app: a #GApplication
  * @timestamp: Platform-specific event timestamp, may be 0 for default
  *
- * Request the application exit.
+ * Request that the application quits.
  *
- * The default implementation will exit the main loop created by
- * g_application_run()
+ * The default implementation will quit the main loop created by
+ * g_application_run().
  *
  * Returns: %TRUE if the application accepted the request, %FALSE otherwise
  *
@@ -552,7 +553,7 @@ g_application_init (GApplication *app)
   app->priv->actions = g_hash_table_new_full (g_str_hash, g_str_equal,
                                               NULL,
                                               g_application_action_free);
-  app->priv->default_exit = TRUE;
+  app->priv->default_quit = TRUE;
   _g_application_platform_init (app);
 }
 
@@ -570,8 +571,8 @@ g_application_get_property (GObject    *object,
       g_value_set_string (value, g_application_get_id (app));
       break;
 
-    case PROP_DEFAULT_EXIT:
-      g_value_set_boolean (value, app->priv->default_exit);
+    case PROP_DEFAULT_QUIT:
+      g_value_set_boolean (value, app->priv->default_quit);
       break;
 
     case PROP_IS_REMOTE:
@@ -597,8 +598,8 @@ g_application_set_property (GObject      *object,
       app->priv->appid = g_value_dup_string (value);
       break;
 
-    case PROP_DEFAULT_EXIT:
-      app->priv->default_exit = g_value_get_boolean (value);
+    case PROP_DEFAULT_QUIT:
+      app->priv->default_quit = g_value_get_boolean (value);
       break;
 
     default:
@@ -622,9 +623,9 @@ g_application_constructor  (GType                  type,
     {
       GObjectConstructParam *param = &construct_params[i];
       if (strcmp (param->pspec->name, "appid") == 0)
-	appid = g_value_get_string (param->value);
+        appid = g_value_get_string (param->value);
       else if (strcmp (param->pspec->name, "default-quit") == 0)
-	default_quit = g_value_get_boolean (param->value);
+        default_quit = g_value_get_boolean (param->value);
     }
 
   if (appid == NULL)
@@ -637,9 +638,9 @@ g_application_constructor  (GType                  type,
   if (!_g_application_platform_acquire_single_instance (appid, NULL))
     {
       if (default_quit)
-	_g_application_platform_default_exit ();
+        _g_application_platform_default_quit ();
       else
-	is_remote = TRUE;
+        is_remote = TRUE;
     }
  
   app = application_for_appid (appid);
@@ -675,22 +676,22 @@ g_application_class_init (GApplicationClass *klass)
   
   application_signals[QUIT] =
     g_signal_new (g_intern_static_string ("quit"),
-		  G_OBJECT_CLASS_TYPE (klass),
-		  G_SIGNAL_RUN_LAST,
-		  G_STRUCT_OFFSET (GApplicationClass, quit),
+                  G_OBJECT_CLASS_TYPE (klass),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (GApplicationClass, quit),
                   g_signal_accumulator_true_handled, NULL,
-		  _gio_marshal_BOOLEAN__UINT,
-		  G_TYPE_BOOLEAN, 1,
+                  _gio_marshal_BOOLEAN__UINT,
+                  G_TYPE_BOOLEAN, 1,
                   G_TYPE_UINT);
 
   application_signals[ACTION] =
     g_signal_new (g_intern_static_string ("action"),
-		  G_OBJECT_CLASS_TYPE (klass),
-		  G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED,
-		  G_STRUCT_OFFSET (GApplicationClass, action),
+                  G_OBJECT_CLASS_TYPE (klass),
+                  G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED,
+                  G_STRUCT_OFFSET (GApplicationClass, action),
                   NULL, NULL,
                   _gio_marshal_VOID__STRING_INT,
-		  G_TYPE_NONE, 2,
+                  G_TYPE_NONE, 2,
                   G_TYPE_STRING,
                   G_TYPE_INT); 
  
@@ -714,7 +715,7 @@ g_application_class_init (GApplicationClass *klass)
                                                         G_PARAM_STATIC_STRINGS));
 
   /**
-   * GApplication:default-exit:
+   * GApplication:default-quit:
    *
    * By default, if a different process is running this application, the
    * process will be exited.  Set this property to %FALSE to allow custom
@@ -722,14 +723,14 @@ g_application_class_init (GApplicationClass *klass)
    *
    */
   g_object_class_install_property (gobject_class,
-                                   PROP_DEFAULT_EXIT,
-                                   g_param_spec_boolean ("default-exit",
-							 P_("Default Exit"),
-							 P_("Exit the process by default"),
-							 TRUE,
-							 G_PARAM_READWRITE |
-							 G_PARAM_CONSTRUCT_ONLY |
-							 G_PARAM_STATIC_STRINGS));
+                                   PROP_DEFAULT_QUIT,
+                                   g_param_spec_boolean ("default-quit",
+                                                         P_("Default Quit"),
+                                                         P_("Exit the process by default"),
+                                                         TRUE,
+                                                         G_PARAM_READWRITE |
+                                                         G_PARAM_CONSTRUCT_ONLY |
+                                                         G_PARAM_STATIC_STRINGS));
 
   /**
    * GApplication:is-remote:
@@ -741,10 +742,10 @@ g_application_class_init (GApplicationClass *klass)
   g_object_class_install_property (gobject_class,
                                    PROP_IS_REMOTE,
                                    g_param_spec_boolean ("is-remote",
-							 P_("Is Remote"),
-							 P_("Whether this application is a proxy for another process"),
-							 FALSE,
-							 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+                                                         P_("Is Remote"),
+                                                         P_("Whether this application is a proxy for another process"),
+                                                         FALSE,
+                                                         G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 }
 
 #define __G_APPLICATION_C__
diff --git a/gio/gunixapplication.c b/gio/gunixapplication.c
index 939def5..04984d2 100644
--- a/gio/gunixapplication.c
+++ b/gio/gunixapplication.c
@@ -156,7 +156,7 @@ static const GDBusMethodInfo application_quit_method_info =
 {
   -1,
   "Quit",
-  NULL,
+  (GDBusArgInfo **) &application_quit_in_args_p,
   NULL,
   NULL
 };
@@ -309,7 +309,7 @@ _g_application_platform_remote_invoke_action (GApplication  *app,
 }
 
 static void
-_g_application_platform_default_exit (void)
+_g_application_platform_default_quit (void)
 {
   exit (0);
 }



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