[glib/gdbus: 5/6] Rename GMessageBusType to GBusType



commit 8f60ff1499b412bf3ad67214018556dd3f8e69d4
Author: David Zeuthen <davidz redhat com>
Date:   Tue Apr 21 20:57:19 2009 -0400

    Rename GMessageBusType to GBusType
---
 docs/reference/gdbus/gdbus-sections.txt |    2 +-
 docs/reference/gdbus/gdbus.types        |    2 +-
 gdbus/gbusnameowner.c                   |    8 ++--
 gdbus/gbusnameowner.h                   |    2 +-
 gdbus/gbusnamewatcher.c                 |    8 ++--
 gdbus/gbusnamewatcher.h                 |    2 +-
 gdbus/gdbus.symbols                     |    2 +-
 gdbus/gdbusconnection.c                 |   84 +++++++++++++++---------------
 gdbus/gdbusconnection.h                 |    6 +-
 gdbus/gdbusenums.h                      |   20 ++++----
 gdbus/tests/connection.c                |   40 +++++++-------
 11 files changed, 88 insertions(+), 88 deletions(-)

diff --git a/docs/reference/gdbus/gdbus-sections.txt b/docs/reference/gdbus/gdbus-sections.txt
index 7149c28..d4dd5a1 100644
--- a/docs/reference/gdbus/gdbus-sections.txt
+++ b/docs/reference/gdbus/gdbus-sections.txt
@@ -48,7 +48,7 @@ G_BUS_NAME_WATCHER_GET_CLASS
 <SECTION>
 <FILE>gdbusconnection</FILE>
 <TITLE>GDBusConnection</TITLE>
-GMessageBusType
+GBusType
 GDBusConnection
 GDBusConnectionClass
 g_dbus_connection_bus_get
diff --git a/docs/reference/gdbus/gdbus.types b/docs/reference/gdbus/gdbus.types
index c57eda6..5052bf9 100644
--- a/docs/reference/gdbus/gdbus.types
+++ b/docs/reference/gdbus/gdbus.types
@@ -1,6 +1,6 @@
 g_dbus_connection_get_type
 g_bus_name_owner_get_type
 g_bus_name_watcher_get_type
-g_message_bus_type_get_type
+g_bus_type_get_type
 g_bus_name_owner_flags_get_type
 g_dbus_error_get_type
diff --git a/gdbus/gbusnameowner.c b/gdbus/gbusnameowner.c
index 0f4b3b7..c816c6e 100644
--- a/gdbus/gbusnameowner.c
+++ b/gdbus/gbusnameowner.c
@@ -1051,7 +1051,7 @@ on_notify_is_opening (GDBusConnection *connection,
 /* ---------------------------------------------------------------------------------------------------- */
 
 static GBusNameOwner *
-g_bus_name_owner_new_internal (GMessageBusType        bus_type,
+g_bus_name_owner_new_internal (GBusType               bus_type,
                                GDBusConnection       *given_connection,
                                const gchar           *name,
                                GBusNameOwnerFlags     flags,
@@ -1160,7 +1160,7 @@ g_bus_name_owner_new_internal (GMessageBusType        bus_type,
 
 /**
  * g_bus_name_owner_new:
- * @bus_type: A #GMessageBusType specifying what message bus to connect to.
+ * @bus_type: A #GBusType specifying what message bus to connect to.
  * @name: A well-known name to acquire.
  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
  * @cancellable: %NULL or a #GCancellable.
@@ -1193,7 +1193,7 @@ g_bus_name_owner_new_internal (GMessageBusType        bus_type,
  * Returns: A #GBusNameOwner object. Free with g_object_unref().
  **/
 GBusNameOwner *
-g_bus_name_owner_new (GMessageBusType        bus_type,
+g_bus_name_owner_new (GBusType               bus_type,
                       const gchar           *name,
                       GBusNameOwnerFlags     flags,
                       GCancellable          *cancellable,
@@ -1254,7 +1254,7 @@ g_bus_name_owner_new_for_connection (GDBusConnection       *connection,
                                      GAsyncReadyCallback    callback,
                                      gpointer               user_data)
 {
-  return g_bus_name_owner_new_internal (G_MESSAGE_BUS_TYPE_NONE,
+  return g_bus_name_owner_new_internal (G_BUS_TYPE_NONE,
                                         connection,
                                         name,
                                         flags,
diff --git a/gdbus/gbusnameowner.h b/gdbus/gbusnameowner.h
index 1927b49..b8d938f 100644
--- a/gdbus/gbusnameowner.h
+++ b/gdbus/gbusnameowner.h
@@ -86,7 +86,7 @@ struct _GBusNameOwnerClass
 };
 
 GType               g_bus_name_owner_get_type                  (void) G_GNUC_CONST;
-GBusNameOwner      *g_bus_name_owner_new                       (GMessageBusType        bus_type,
+GBusNameOwner      *g_bus_name_owner_new                       (GBusType               bus_type,
                                                                 const gchar           *name,
                                                                 GBusNameOwnerFlags     flags,
                                                                 GCancellable          *cancellable,
diff --git a/gdbus/gbusnamewatcher.c b/gdbus/gbusnamewatcher.c
index 9d63606..2a1a694 100644
--- a/gdbus/gbusnamewatcher.c
+++ b/gdbus/gbusnamewatcher.c
@@ -982,7 +982,7 @@ on_notify_is_opening (GDBusConnection *connection,
 }
 
 static GBusNameWatcher *
-g_bus_name_watcher_new_internal (GMessageBusType        bus_type,
+g_bus_name_watcher_new_internal (GBusType               bus_type,
                                  GDBusConnection       *given_connection,
                                  const gchar           *name,
                                  GCancellable          *cancellable,
@@ -1090,7 +1090,7 @@ g_bus_name_watcher_new_internal (GMessageBusType        bus_type,
 
 /**
  * g_bus_name_watcher_new:
- * @bus_type: A #GMessageBusType specifying what message bus to connect to.
+ * @bus_type: A #GBusType specifying what message bus to connect to.
  * @name: A bus name (well-known or unique).
  * @cancellable: %NULL or a #GCancellable.
  * @callback: The callback function to invoke when finished acquiring the name.
@@ -1119,7 +1119,7 @@ g_bus_name_watcher_new_internal (GMessageBusType        bus_type,
  * Returns: A #GBusNameWatcher object. Free with g_object_unref().
  **/
 GBusNameWatcher *
-g_bus_name_watcher_new (GMessageBusType        bus_type,
+g_bus_name_watcher_new (GBusType               bus_type,
                         const gchar           *name,
                         GCancellable          *cancellable,
                         GAsyncReadyCallback    callback,
@@ -1185,7 +1185,7 @@ g_bus_name_watcher_new_for_connection (GDBusConnection       *connection,
                                        GAsyncReadyCallback    callback,
                                        gpointer               user_data)
 {
-  return g_bus_name_watcher_new_internal (G_MESSAGE_BUS_TYPE_NONE,
+  return g_bus_name_watcher_new_internal (G_BUS_TYPE_NONE,
                                           connection,
                                           name,
                                           cancellable,
diff --git a/gdbus/gbusnamewatcher.h b/gdbus/gbusnamewatcher.h
index 90f58b9..f94d7f8 100644
--- a/gdbus/gbusnamewatcher.h
+++ b/gdbus/gbusnamewatcher.h
@@ -86,7 +86,7 @@ struct _GBusNameWatcherClass
 };
 
 GType               g_bus_name_watcher_get_type                  (void) G_GNUC_CONST;
-GBusNameWatcher    *g_bus_name_watcher_new                       (GMessageBusType        bus_type,
+GBusNameWatcher    *g_bus_name_watcher_new                       (GBusType               bus_type,
                                                                   const gchar           *name,
                                                                   GCancellable          *cancellable,
                                                                   GAsyncReadyCallback    callback,
diff --git a/gdbus/gdbus.symbols b/gdbus/gdbus.symbols
index c68b694..7d3ef6e 100644
--- a/gdbus/gdbus.symbols
+++ b/gdbus/gdbus.symbols
@@ -69,7 +69,7 @@ g_dbus_unintegrate_dbus_1_server
 #if IN_HEADER(__G_DBUS_ENUM_TYPES_H__)
 #if IN_FILE(__G_DBUS_ENUM_TYPES_C__)
 g_dbus_error_get_type G_GNUC_CONST
-g_message_bus_type_get_type G_GNUC_CONST
+g_bus_type_get_type G_GNUC_CONST
 g_bus_name_owner_flags_get_type
 #endif
 #endif
diff --git a/gdbus/gdbusconnection.c b/gdbus/gdbusconnection.c
index 939ac24..24edb83 100644
--- a/gdbus/gdbusconnection.c
+++ b/gdbus/gdbusconnection.c
@@ -52,7 +52,7 @@ struct _GDBusConnectionPrivate
 {
   DBusConnection *dbus_1_connection;
 
-  GMessageBusType bus_type;
+  GBusType bus_type;
 
   guint reconnect_timer_id;
 
@@ -238,13 +238,13 @@ g_dbus_connection_class_init (GDBusConnectionClass *klass)
    * GDBusConnection:bus-type:
    *
    * Type type of the message bus the connection is for or
-   * #G_MESSAGE_BUS_TYPE_NONE if the connection is not to a message
+   * #G_BUS_TYPE_NONE if the connection is not to a message
    * bus.
    *
-   * This property is never #G_MESSAGE_BUS_TYPE_STARTER. If
-   * #G_MESSAGE_BUS_TYPE_STARTER was passed to g_dbus_connection_get()
-   * then this property will be either #G_MESSAGE_BUS_TYPE_SESSION or
-   * #G_MESSAGE_BUS_TYPE_SYSTEM depending on what bus started the
+   * This property is never #G_BUS_TYPE_STARTER. If
+   * #G_BUS_TYPE_STARTER was passed to g_dbus_connection_get()
+   * then this property will be either #G_BUS_TYPE_SESSION or
+   * #G_BUS_TYPE_SYSTEM depending on what bus started the
    * process.
    */
   g_object_class_install_property (gobject_class,
@@ -252,8 +252,8 @@ g_dbus_connection_class_init (GDBusConnectionClass *klass)
                                    g_param_spec_enum ("bus-type",
                                                       _("bus-type"),
                                                       _("The type of message bus the connection is for"),
-                                                      G_TYPE_MESSAGE_BUS_TYPE,
-                                                      G_MESSAGE_BUS_TYPE_NONE,
+                                                      G_TYPE_BUS_TYPE,
+                                                      G_BUS_TYPE_NONE,
                                                       G_PARAM_READABLE |
                                                       G_PARAM_WRITABLE |
                                                       G_PARAM_CONSTRUCT_ONLY |
@@ -376,20 +376,20 @@ g_dbus_connection_init (GDBusConnection *connection)
  *
  * Gets the type of message bus connection, if any.
  *
- * This will never return #G_MESSAGE_BUS_TYPE_STARTER. If
- * #G_MESSAGE_BUS_TYPE_STARTER was passed to g_dbus_connection_get()
- * then the return value will be either #G_MESSAGE_BUS_TYPE_SESSION or
- * #G_MESSAGE_BUS_TYPE_SYSTEM depending on what bus started the
+ * This will never return #G_BUS_TYPE_STARTER. If
+ * #G_BUS_TYPE_STARTER was passed to g_dbus_connection_get()
+ * then the return value will be either #G_BUS_TYPE_SESSION or
+ * #G_BUS_TYPE_SYSTEM depending on what bus started the
  * process.
  *
  * Returns: Type type of the message bus the connection is for or
- * #G_MESSAGE_BUS_TYPE_NONE if the connection is not to a message
+ * #G_BUS_TYPE_NONE if the connection is not to a message
  * bus.
  **/
-GMessageBusType
+GBusType
 g_dbus_connection_get_bus_type (GDBusConnection *connection)
 {
-  g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), G_MESSAGE_BUS_TYPE_NONE);
+  g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), G_BUS_TYPE_NONE);
 
   return connection->priv->bus_type;
 }
@@ -464,7 +464,7 @@ attempt_connect (GDBusConnection  *connection,
   g_assert (connection->priv->dbus_1_connection == NULL);
 
   dbus_error_init (&dbus_error);
-  g_assert (connection->priv->bus_type != G_MESSAGE_BUS_TYPE_NONE); // until we have constructors with @address
+  g_assert (connection->priv->bus_type != G_BUS_TYPE_NONE); // until we have constructors with @address
   if (connection->priv->is_private)
     {
       dbus_1_connection = dbus_bus_get_private (connection->priv->bus_type,
@@ -695,11 +695,11 @@ open_bus_connection (gpointer user_data)
 }
 
 static GDBusConnection *
-g_dbus_connection_bus_get_internal (GMessageBusType                bus_type,
-                                    gboolean                       private,
-                                    GCancellable                  *cancellable,
-                                    GAsyncReadyCallback            callback,
-                                    gpointer                       user_data)
+g_dbus_connection_bus_get_internal (GBusType                bus_type,
+                                    gboolean                private,
+                                    GCancellable           *cancellable,
+                                    GAsyncReadyCallback     callback,
+                                    gpointer                user_data)
 {
   GDBusConnection *connection;
   GSimpleAsyncResult *simple;
@@ -716,29 +716,29 @@ g_dbus_connection_bus_get_internal (GMessageBusType                bus_type,
    * singleton so callbacks are fired at the right time.
    */
 
-  g_return_val_if_fail (bus_type != G_MESSAGE_BUS_TYPE_NONE, NULL);
+  g_return_val_if_fail (bus_type != G_BUS_TYPE_NONE, NULL);
 
   connection = NULL;
 
   /* TODO: use cancellable */
 
   /* handle starter bus */
-  if (bus_type == G_MESSAGE_BUS_TYPE_STARTER)
+  if (bus_type == G_BUS_TYPE_STARTER)
     {
       const gchar *starter_bus;
 
       starter_bus = g_getenv ("DBUS_STARTER_BUS_TYPE");
       if (g_strcmp0 (starter_bus, "session") == 0)
         {
-          bus_type = G_MESSAGE_BUS_TYPE_SESSION;
+          bus_type = G_BUS_TYPE_SESSION;
         }
       else if (g_strcmp0 (starter_bus, "system") == 0)
         {
-          bus_type = G_MESSAGE_BUS_TYPE_SYSTEM;
+          bus_type = G_BUS_TYPE_SYSTEM;
         }
       else
         {
-          g_critical ("Cannot construct a GDBusConnection object with bus_type G_MESSAGE_BUS_TYPE_STARTER "
+          g_critical ("Cannot construct a GDBusConnection object with bus_type G_BUS_TYPE_STARTER "
                       "because the DBUS_STARTER_BUS_TYPE environment variable is not set. "
                       "This is an error in the application.");
           goto out;
@@ -749,7 +749,7 @@ g_dbus_connection_bus_get_internal (GMessageBusType                bus_type,
   G_LOCK (connection_lock);
   if (!private)
     {
-      if (bus_type == G_MESSAGE_BUS_TYPE_SESSION && the_session_bus != NULL)
+      if (bus_type == G_BUS_TYPE_SESSION && the_session_bus != NULL)
         {
           connection = g_object_ref (the_session_bus);
           simple = g_simple_async_result_new (G_OBJECT (connection),
@@ -770,7 +770,7 @@ g_dbus_connection_bus_get_internal (GMessageBusType                bus_type,
           G_UNLOCK (connection_lock);
           goto out;
         }
-      else if (bus_type == G_MESSAGE_BUS_TYPE_SYSTEM && the_system_bus != NULL)
+      else if (bus_type == G_BUS_TYPE_SYSTEM && the_system_bus != NULL)
         {
           connection = g_object_ref (the_system_bus);
           simple = g_simple_async_result_new (G_OBJECT (connection),
@@ -801,11 +801,11 @@ g_dbus_connection_bus_get_internal (GMessageBusType                bus_type,
   if (!private)
     {
       /* singleton handling, part 2 */
-      if (bus_type == G_MESSAGE_BUS_TYPE_SESSION && the_session_bus == NULL)
+      if (bus_type == G_BUS_TYPE_SESSION && the_session_bus == NULL)
         {
           the_session_bus = connection;
         }
-      else if (bus_type == G_MESSAGE_BUS_TYPE_SYSTEM && the_system_bus == NULL)
+      else if (bus_type == G_BUS_TYPE_SYSTEM && the_system_bus == NULL)
         {
           the_system_bus = connection;
         }
@@ -830,7 +830,7 @@ g_dbus_connection_bus_get_internal (GMessageBusType                bus_type,
 
 /**
  * g_dbus_connection_bus_get:
- * @bus_type: The bus type (can't be #G_MESSAGE_BUS_TYPE_NONE).
+ * @bus_type: The bus type (can't be #G_BUS_TYPE_NONE).
  * @cancellable: A #GCancellable or %NULL.
  * @callback: The callback function to invoke when finished attempting opening a connection.
  * @user_data: User data to pass to @callback.
@@ -906,7 +906,7 @@ g_dbus_connection_bus_get_internal (GMessageBusType                bus_type,
  * void
  * some_routine (SomeObject *data)
  * {
- *   data->priv->session_bus = g_dbus_connection_bus_get (G_MESSAGE_BUS_TYPE_SESSION,
+ *   data->priv->session_bus = g_dbus_connection_bus_get (G_BUS_TYPE_SESSION,
  *                                                        NULL,
  *                                                        (GAsyncReadyCallback) get_bus_cb,
  *                                                        data);
@@ -923,10 +923,10 @@ g_dbus_connection_bus_get_internal (GMessageBusType                bus_type,
  * Returns: A #GDBusConnection object. Free with g_object_unref().
  */
 GDBusConnection *
-g_dbus_connection_bus_get (GMessageBusType                bus_type,
-                           GCancellable                  *cancellable,
-                           GAsyncReadyCallback            callback,
-                           gpointer                       user_data)
+g_dbus_connection_bus_get (GBusType                bus_type,
+                           GCancellable           *cancellable,
+                           GAsyncReadyCallback     callback,
+                           gpointer                user_data)
 {
   return g_dbus_connection_bus_get_internal (bus_type,
                                              FALSE,
@@ -937,7 +937,7 @@ g_dbus_connection_bus_get (GMessageBusType                bus_type,
 
 /**
  * g_dbus_connection_bus_get_private:
- * @bus_type: The bus type (can't be #G_MESSAGE_BUS_TYPE_NONE).
+ * @bus_type: The bus type (can't be #G_BUS_TYPE_NONE).
  * @cancellable: A #GCancellable or %NULL.
  * @callback: The callback function to invoke when finished attempting opening a connection.
  * @user_data: User data to pass to @callback.
@@ -948,10 +948,10 @@ g_dbus_connection_bus_get (GMessageBusType                bus_type,
  * Returns: A #GDBusConnection object. Free with g_object_unref().
  */
 GDBusConnection *
-g_dbus_connection_bus_get_private (GMessageBusType                bus_type,
-                                   GCancellable                  *cancellable,
-                                   GAsyncReadyCallback            callback,
-                                   gpointer                       user_data)
+g_dbus_connection_bus_get_private (GBusType                bus_type,
+                                   GCancellable           *cancellable,
+                                   GAsyncReadyCallback     callback,
+                                   gpointer                user_data)
 {
   return g_dbus_connection_bus_get_internal (bus_type,
                                              TRUE,
@@ -1059,7 +1059,7 @@ g_dbus_connection_get_unique_name (GDBusConnection *connection)
 {
   g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
 
-  if (connection->priv->bus_type == G_MESSAGE_BUS_TYPE_NONE)
+  if (connection->priv->bus_type == G_BUS_TYPE_NONE)
     return NULL;
 
   if (connection->priv->dbus_1_connection != NULL)
diff --git a/gdbus/gdbusconnection.h b/gdbus/gdbusconnection.h
index fe97ae7..6f00b2a 100644
--- a/gdbus/gdbusconnection.h
+++ b/gdbus/gdbusconnection.h
@@ -87,7 +87,7 @@ struct _GDBusConnectionClass
 
 GType            g_dbus_connection_get_type               (void) G_GNUC_CONST;
 
-GDBusConnection *g_dbus_connection_bus_get                (GMessageBusType      bus_type,
+GDBusConnection *g_dbus_connection_bus_get                (GBusType             bus_type,
                                                            GCancellable        *cancellable,
                                                            GAsyncReadyCallback  callback,
                                                            gpointer             user_data);
@@ -95,7 +95,7 @@ gboolean         g_dbus_connection_bus_get_finish         (GDBusConnection     *
                                                            GAsyncResult        *res,
                                                            GError             **error);
 
-GDBusConnection *g_dbus_connection_bus_get_private        (GMessageBusType      bus_type,
+GDBusConnection *g_dbus_connection_bus_get_private        (GBusType             bus_type,
                                                            GCancellable        *cancellable,
                                                            GAsyncReadyCallback  callback,
                                                            gpointer             user_data);
@@ -103,7 +103,7 @@ gboolean         g_dbus_connection_bus_get_private_finish (GDBusConnection     *
                                                            GAsyncResult        *res,
                                                            GError             **error);
 
-GMessageBusType  g_dbus_connection_get_bus_type           (GDBusConnection *connection);
+GBusType         g_dbus_connection_get_bus_type           (GDBusConnection *connection);
 gboolean         g_dbus_connection_get_is_open            (GDBusConnection *connection);
 gboolean         g_dbus_connection_get_is_opening         (GDBusConnection *connection);
 DBusConnection  *g_dbus_connection_get_dbus_1_connection  (GDBusConnection *connection);
diff --git a/gdbus/gdbusenums.h b/gdbus/gdbusenums.h
index 05af006..38a1b4c 100644
--- a/gdbus/gdbusenums.h
+++ b/gdbus/gdbusenums.h
@@ -34,21 +34,21 @@
 G_BEGIN_DECLS
 
 /**
- * GMessageBusType:
- * @G_MESSAGE_BUS_TYPE_NONE: Not a message bus connection.
- * @G_MESSAGE_BUS_TYPE_SESSION: The login session message bus.
- * @G_MESSAGE_BUS_TYPE_SYSTEM: The system-wide message bus.
- * @G_MESSAGE_BUS_TYPE_STARTER: Connect to the bus that activated the program.
+ * GBusType:
+ * @G_BUS_TYPE_NONE: Not a message bus connection.
+ * @G_BUS_TYPE_SESSION: The login session message bus.
+ * @G_BUS_TYPE_SYSTEM: The system-wide message bus.
+ * @G_BUS_TYPE_STARTER: Connect to the bus that activated the program.
  *
  * An enumeration to specify the type of a #GDBusConnection.
  */
 typedef enum
 {
-  G_MESSAGE_BUS_TYPE_NONE    = -1,
-  G_MESSAGE_BUS_TYPE_SESSION = DBUS_BUS_SESSION,
-  G_MESSAGE_BUS_TYPE_SYSTEM  = DBUS_BUS_SYSTEM,
-  G_MESSAGE_BUS_TYPE_STARTER = DBUS_BUS_STARTER,
-} GMessageBusType;
+  G_BUS_TYPE_NONE    = -1,
+  G_BUS_TYPE_SESSION = DBUS_BUS_SESSION,
+  G_BUS_TYPE_SYSTEM  = DBUS_BUS_SYSTEM,
+  G_BUS_TYPE_STARTER = DBUS_BUS_STARTER,
+} GBusType;
 
 /**
  * GBusNameOwnerFlags:
diff --git a/gdbus/tests/connection.c b/gdbus/tests/connection.c
index 0190275..5628429 100644
--- a/gdbus/tests/connection.c
+++ b/gdbus/tests/connection.c
@@ -527,7 +527,7 @@ test_message_bus_connections (void)
   guint counter;
 
   /* Check for correct behavior when no bus is present */
-  c = g_dbus_connection_bus_get (G_MESSAGE_BUS_TYPE_SESSION,
+  c = g_dbus_connection_bus_get (G_BUS_TYPE_SESSION,
                                  NULL,
                                  (GAsyncReadyCallback) get_connection_callback_no_bus_exists,
                                  NULL);
@@ -544,7 +544,7 @@ test_message_bus_connections (void)
    */
   session_bus_up ();
   val = FALSE;
-  c = g_dbus_connection_bus_get (G_MESSAGE_BUS_TYPE_SESSION,
+  c = g_dbus_connection_bus_get (G_BUS_TYPE_SESSION,
                                  NULL,                            /* cancellable */
                                  (GAsyncReadyCallback) get_connection_callback_bus_exists,
                                  &val);                           /* user_data */
@@ -574,7 +574,7 @@ test_message_bus_connections (void)
   g_assert (val);
 
   /* Check that singleton handling works, e.g. we get the same object for the same bus type */
-  c2 = g_dbus_connection_bus_get (G_MESSAGE_BUS_TYPE_SESSION,
+  c2 = g_dbus_connection_bus_get (G_BUS_TYPE_SESSION,
                                   NULL,                            /* cancellable */
                                   (GAsyncReadyCallback) get_connection_callback_singleton,
                                   NULL);                           /* user_data */
@@ -583,7 +583,7 @@ test_message_bus_connections (void)
   g_object_unref (c2);
 
   /* Check that we get a distinct connection, with a distinct unique name, for private connections */
-  c2 = g_dbus_connection_bus_get_private (G_MESSAGE_BUS_TYPE_SESSION,
+  c2 = g_dbus_connection_bus_get_private (G_BUS_TYPE_SESSION,
                                           NULL,                            /* cancellable */
                                           (GAsyncReadyCallback) get_connection_callback_private,
                                           NULL);                           /* user_data */
@@ -607,11 +607,11 @@ test_message_bus_connections (void)
 
   /* Check that the error paths are correct when using singletons */
   counter = 0;
-  c = g_dbus_connection_bus_get (G_MESSAGE_BUS_TYPE_SESSION,
+  c = g_dbus_connection_bus_get (G_BUS_TYPE_SESSION,
                                  NULL,
                                  (GAsyncReadyCallback) get_connection_callback_no_bus_exists_singleton,
                                  &counter);
-  c2 = g_dbus_connection_bus_get (G_MESSAGE_BUS_TYPE_SESSION,
+  c2 = g_dbus_connection_bus_get (G_BUS_TYPE_SESSION,
                                  NULL,
                                  (GAsyncReadyCallback) get_connection_callback_no_bus_exists_singleton,
                                  &counter);
@@ -813,7 +813,7 @@ test_bus_name_owner (void)
 
   /* first try to own a name when there is no bus */
   val = FALSE;
-  o = g_bus_name_owner_new (G_MESSAGE_BUS_TYPE_SESSION,
+  o = g_bus_name_owner_new (G_BUS_TYPE_SESSION,
                             "org.gtk.Test.Name1",
                             G_BUS_NAME_OWNER_FLAGS_NONE,
                             NULL,
@@ -829,7 +829,7 @@ test_bus_name_owner (void)
   session_bus_up ();
   val = FALSE;
   val2 = FALSE;
-  o = g_bus_name_owner_new (G_MESSAGE_BUS_TYPE_SESSION,
+  o = g_bus_name_owner_new (G_BUS_TYPE_SESSION,
                             "org.gtk.Test.Name1",
                             G_BUS_NAME_OWNER_FLAGS_NONE,
                             NULL,
@@ -844,7 +844,7 @@ test_bus_name_owner (void)
   /* try owning the same name again... this should not fail, we should get the same object
    * as o because of singleton handling
    */
-  o2 = g_bus_name_owner_new (G_MESSAGE_BUS_TYPE_SESSION,
+  o2 = g_bus_name_owner_new (G_BUS_TYPE_SESSION,
                              "org.gtk.Test.Name1",
                              G_BUS_NAME_OWNER_FLAGS_NONE,
                              NULL,
@@ -859,7 +859,7 @@ test_bus_name_owner (void)
   g_object_unref (o);
   val = FALSE;
   val2 = FALSE;
-  o = g_bus_name_owner_new (G_MESSAGE_BUS_TYPE_SESSION,
+  o = g_bus_name_owner_new (G_BUS_TYPE_SESSION,
                             "org.gtk.Test.Name1",
                             G_BUS_NAME_OWNER_FLAGS_NONE,
                             NULL,
@@ -893,7 +893,7 @@ test_bus_name_owner (void)
    * the name with _REPLACE and _ALLOW_REPLACEMENT. This should fail because o already owns the name
    * and didn't specify ALLOW_REPLACEMENT.
    */
-  private_connection = g_dbus_connection_bus_get_private (G_MESSAGE_BUS_TYPE_SESSION,
+  private_connection = g_dbus_connection_bus_get_private (G_BUS_TYPE_SESSION,
                                                           NULL,                            /* cancellable */
                                                           (GAsyncReadyCallback) get_connection_callback_private,
                                                           NULL);                           /* user_data */
@@ -924,7 +924,7 @@ test_bus_name_owner (void)
 
   /* Since o2 specified ALLOW_REPLACEMENT, check that o can claim the name only when using REPLACE */
   val = FALSE;
-  o = g_bus_name_owner_new (G_MESSAGE_BUS_TYPE_SESSION,
+  o = g_bus_name_owner_new (G_BUS_TYPE_SESSION,
                             "org.gtk.Test.Name1",
                             G_BUS_NAME_OWNER_FLAGS_NONE,
                             NULL,
@@ -937,7 +937,7 @@ test_bus_name_owner (void)
   g_object_unref (o);
   /* and now with REPLACE */
   val = FALSE;
-  o = g_bus_name_owner_new (G_MESSAGE_BUS_TYPE_SESSION,
+  o = g_bus_name_owner_new (G_BUS_TYPE_SESSION,
                             "org.gtk.Test.Name1",
                             G_BUS_NAME_OWNER_FLAGS_REPLACE,
                             NULL,
@@ -1104,7 +1104,7 @@ test_bus_name_watcher (void)
   gboolean val;
 
   /* if no session bus is available, expect the callback to expect an error */
-  w = g_bus_name_watcher_new (G_MESSAGE_BUS_TYPE_SESSION,
+  w = g_bus_name_watcher_new (G_BUS_TYPE_SESSION,
                               "org.gtk.Test.Name1",
                               NULL,
                               (GAsyncReadyCallback) bnw_cb_expect_error,
@@ -1115,7 +1115,7 @@ test_bus_name_watcher (void)
 
   /* if a session bus is available, expect the callback to fail */
   session_bus_up ();
-  w = g_bus_name_watcher_new (G_MESSAGE_BUS_TYPE_SESSION,
+  w = g_bus_name_watcher_new (G_BUS_TYPE_SESSION,
                               "org.gtk.Test.Name1",
                               NULL,
                               (GAsyncReadyCallback) bnw_cb_expect_null_owner,
@@ -1125,7 +1125,7 @@ test_bus_name_watcher (void)
   g_object_unref (w);
 
   /* now start owning a name */
-  o = g_bus_name_owner_new (G_MESSAGE_BUS_TYPE_SESSION,
+  o = g_bus_name_owner_new (G_BUS_TYPE_SESSION,
                             "org.gtk.Test.Name1",
                             G_BUS_NAME_OWNER_FLAGS_NONE,
                             NULL,
@@ -1134,7 +1134,7 @@ test_bus_name_watcher (void)
   g_main_loop_run (loop);
 
   /* now we should expect to get the name owner in the callback when constructing the watcher */
-  w = g_bus_name_watcher_new (G_MESSAGE_BUS_TYPE_SESSION,
+  w = g_bus_name_watcher_new (G_BUS_TYPE_SESSION,
                               "org.gtk.Test.Name1",
                               NULL,
                               (GAsyncReadyCallback) bnw_cb_expect_owner,
@@ -1151,7 +1151,7 @@ test_bus_name_watcher (void)
 
   /* start owning the name and check that the watcher emits the ::name-appeared signal */
   g_signal_connect (w, "name-appeared", G_CALLBACK (bnw_on_name_appeared), NULL);
-  o = g_bus_name_owner_new (G_MESSAGE_BUS_TYPE_SESSION,
+  o = g_bus_name_owner_new (G_BUS_TYPE_SESSION,
                             "org.gtk.Test.Name1",
                             G_BUS_NAME_OWNER_FLAGS_NONE,
                             NULL,
@@ -1181,7 +1181,7 @@ test_bus_name_watcher (void)
    * connection and name gives the same object
    */
   val = FALSE;
-  w2 = g_bus_name_watcher_new (G_MESSAGE_BUS_TYPE_SESSION,
+  w2 = g_bus_name_watcher_new (G_BUS_TYPE_SESSION,
                                "org.gtk.Test.Name1",
                                NULL,
                                (GAsyncReadyCallback) bnw_cb_singleton,
@@ -1191,7 +1191,7 @@ test_bus_name_watcher (void)
   g_main_loop_run (loop);
   g_assert (val);
   g_object_unref (w2);
-  w2 = g_bus_name_watcher_new (G_MESSAGE_BUS_TYPE_SESSION,
+  w2 = g_bus_name_watcher_new (G_BUS_TYPE_SESSION,
                                "org.gtk.Test.Name2",
                                NULL,
                                NULL,



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