mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 17:26:17 +01:00
GDBusObject{Proxy,Skeleton}: Prefix properties with g- to avoid collisions
Otherwise we might collide with an interface called Connection. https://bugzilla.gnome.org/show_bug.cgi?id=659699 This is for the same reason that GDBusProxy has its properties prefixed with g-. Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
parent
1f5262d2c9
commit
aabdb7e190
@ -2838,7 +2838,7 @@ class CodeGenerator:
|
|||||||
'{\n'
|
'{\n'
|
||||||
' g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);\n'
|
' g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);\n'
|
||||||
' g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);\n'
|
' g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);\n'
|
||||||
' return %sOBJECT_PROXY (g_object_new (%sTYPE_OBJECT_PROXY, "connection", connection, "object-path", object_path, NULL));\n'
|
' return %sOBJECT_PROXY (g_object_new (%sTYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));\n'
|
||||||
'}\n'
|
'}\n'
|
||||||
'\n'%(self.namespace, self.ns_lower, self.ns_upper, self.ns_upper))
|
'\n'%(self.namespace, self.ns_lower, self.ns_upper, self.ns_upper))
|
||||||
|
|
||||||
@ -2979,7 +2979,7 @@ class CodeGenerator:
|
|||||||
'%sobject_skeleton_new (const gchar *object_path)\n'
|
'%sobject_skeleton_new (const gchar *object_path)\n'
|
||||||
'{\n'
|
'{\n'
|
||||||
' g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);\n'
|
' g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);\n'
|
||||||
' return %sOBJECT_SKELETON (g_object_new (%sTYPE_OBJECT_SKELETON, "object-path", object_path, NULL));\n'
|
' return %sOBJECT_SKELETON (g_object_new (%sTYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));\n'
|
||||||
'}\n'
|
'}\n'
|
||||||
'\n'%(self.namespace, self.ns_lower, self.ns_upper, self.ns_upper))
|
'\n'%(self.namespace, self.ns_lower, self.ns_upper, self.ns_upper))
|
||||||
for i in self.ifaces:
|
for i in self.ifaces:
|
||||||
|
@ -1444,8 +1444,8 @@ add_interfaces (GDBusObjectManagerClient *manager,
|
|||||||
object_proxy_type = G_TYPE_DBUS_OBJECT_PROXY;
|
object_proxy_type = G_TYPE_DBUS_OBJECT_PROXY;
|
||||||
}
|
}
|
||||||
op = g_object_new (object_proxy_type,
|
op = g_object_new (object_proxy_type,
|
||||||
"connection", manager->priv->connection,
|
"g-connection", manager->priv->connection,
|
||||||
"object-path", object_path,
|
"g-object-path", object_path,
|
||||||
NULL);
|
NULL);
|
||||||
added = TRUE;
|
added = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -549,7 +549,7 @@ g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
|
|||||||
* Like g_dbus_object_manager_server_export() but appends a string of
|
* Like g_dbus_object_manager_server_export() but appends a string of
|
||||||
* the form <literal>_N</literal> (with N being a natural number) to
|
* the form <literal>_N</literal> (with N being a natural number) to
|
||||||
* @object<!-- -->'s object path if an object with the given path
|
* @object<!-- -->'s object path if an object with the given path
|
||||||
* already exists. As such, the #GDBusObjectProxy:object-path property
|
* already exists. As such, the #GDBusObjectProxy:g-object-path property
|
||||||
* of @object may be modified.
|
* of @object may be modified.
|
||||||
*
|
*
|
||||||
* Since: 2.30
|
* Since: 2.30
|
||||||
|
@ -55,8 +55,8 @@ struct _GDBusObjectProxyPrivate
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_OBJECT_PATH,
|
PROP_G_OBJECT_PATH,
|
||||||
PROP_CONNECTION
|
PROP_G_CONNECTION
|
||||||
};
|
};
|
||||||
|
|
||||||
static void dbus_object_interface_init (GDBusObjectIface *iface);
|
static void dbus_object_interface_init (GDBusObjectIface *iface);
|
||||||
@ -87,13 +87,13 @@ g_dbus_object_proxy_get_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_OBJECT_PATH:
|
case PROP_G_OBJECT_PATH:
|
||||||
g_mutex_lock (proxy->priv->lock);
|
g_mutex_lock (proxy->priv->lock);
|
||||||
g_value_set_string (value, proxy->priv->object_path);
|
g_value_set_string (value, proxy->priv->object_path);
|
||||||
g_mutex_unlock (proxy->priv->lock);
|
g_mutex_unlock (proxy->priv->lock);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_CONNECTION:
|
case PROP_G_CONNECTION:
|
||||||
g_value_set_object (value, g_dbus_object_proxy_get_connection (proxy));
|
g_value_set_object (value, g_dbus_object_proxy_get_connection (proxy));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -113,13 +113,13 @@ g_dbus_object_proxy_set_property (GObject *object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_OBJECT_PATH:
|
case PROP_G_OBJECT_PATH:
|
||||||
g_mutex_lock (proxy->priv->lock);
|
g_mutex_lock (proxy->priv->lock);
|
||||||
proxy->priv->object_path = g_value_dup_string (value);
|
proxy->priv->object_path = g_value_dup_string (value);
|
||||||
g_mutex_unlock (proxy->priv->lock);
|
g_mutex_unlock (proxy->priv->lock);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_CONNECTION:
|
case PROP_G_CONNECTION:
|
||||||
g_mutex_lock (proxy->priv->lock);
|
g_mutex_lock (proxy->priv->lock);
|
||||||
proxy->priv->connection = g_value_dup_object (value);
|
proxy->priv->connection = g_value_dup_object (value);
|
||||||
g_mutex_unlock (proxy->priv->lock);
|
g_mutex_unlock (proxy->priv->lock);
|
||||||
@ -141,15 +141,15 @@ g_dbus_object_proxy_class_init (GDBusObjectProxyClass *klass)
|
|||||||
gobject_class->get_property = g_dbus_object_proxy_get_property;
|
gobject_class->get_property = g_dbus_object_proxy_get_property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GDBusObjectProxy:object-path:
|
* GDBusObjectProxy:g-object-path:
|
||||||
*
|
*
|
||||||
* The object path of the proxy.
|
* The object path of the proxy.
|
||||||
*
|
*
|
||||||
* Since: 2.30
|
* Since: 2.30
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_OBJECT_PATH,
|
PROP_G_OBJECT_PATH,
|
||||||
g_param_spec_string ("object-path",
|
g_param_spec_string ("g-object-path",
|
||||||
"Object Path",
|
"Object Path",
|
||||||
"The object path of the proxy",
|
"The object path of the proxy",
|
||||||
NULL,
|
NULL,
|
||||||
@ -158,15 +158,15 @@ g_dbus_object_proxy_class_init (GDBusObjectProxyClass *klass)
|
|||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GDBusObjectProxy:connection:
|
* GDBusObjectProxy:g-connection:
|
||||||
*
|
*
|
||||||
* The connection of the proxy.
|
* The connection of the proxy.
|
||||||
*
|
*
|
||||||
* Since: 2.30
|
* Since: 2.30
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_CONNECTION,
|
PROP_G_CONNECTION,
|
||||||
g_param_spec_object ("connection",
|
g_param_spec_object ("g-connection",
|
||||||
"Connection",
|
"Connection",
|
||||||
"The connection of the proxy",
|
"The connection of the proxy",
|
||||||
G_TYPE_DBUS_CONNECTION,
|
G_TYPE_DBUS_CONNECTION,
|
||||||
@ -281,8 +281,8 @@ g_dbus_object_proxy_new (GDBusConnection *connection,
|
|||||||
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
|
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
|
||||||
g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
|
g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
|
||||||
return G_DBUS_OBJECT_PROXY (g_object_new (G_TYPE_DBUS_OBJECT_PROXY,
|
return G_DBUS_OBJECT_PROXY (g_object_new (G_TYPE_DBUS_OBJECT_PROXY,
|
||||||
"object-path", object_path,
|
"g-object-path", object_path,
|
||||||
"connection", connection,
|
"g-connection", connection,
|
||||||
NULL));
|
NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ struct _GDBusObjectSkeletonPrivate
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_OBJECT_PATH
|
PROP_G_OBJECT_PATH
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -96,7 +96,7 @@ g_dbus_object_skeleton_get_property (GObject *_object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_OBJECT_PATH:
|
case PROP_G_OBJECT_PATH:
|
||||||
g_mutex_lock (object->priv->lock);
|
g_mutex_lock (object->priv->lock);
|
||||||
g_value_take_string (value, object->priv->object_path);
|
g_value_take_string (value, object->priv->object_path);
|
||||||
g_mutex_unlock (object->priv->lock);
|
g_mutex_unlock (object->priv->lock);
|
||||||
@ -118,7 +118,7 @@ g_dbus_object_skeleton_set_property (GObject *_object,
|
|||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_OBJECT_PATH:
|
case PROP_G_OBJECT_PATH:
|
||||||
g_dbus_object_skeleton_set_object_path (object, g_value_get_string (value));
|
g_dbus_object_skeleton_set_object_path (object, g_value_get_string (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -148,15 +148,15 @@ g_dbus_object_skeleton_class_init (GDBusObjectSkeletonClass *klass)
|
|||||||
klass->authorize_method = g_dbus_object_skeleton_authorize_method_default;
|
klass->authorize_method = g_dbus_object_skeleton_authorize_method_default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GDBusObjectSkeleton:object-path:
|
* GDBusObjectSkeleton:g-object-path:
|
||||||
*
|
*
|
||||||
* The object path where the object is exported.
|
* The object path where the object is exported.
|
||||||
*
|
*
|
||||||
* Since: 2.30
|
* Since: 2.30
|
||||||
*/
|
*/
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_OBJECT_PATH,
|
PROP_G_OBJECT_PATH,
|
||||||
g_param_spec_string ("object-path",
|
g_param_spec_string ("g-object-path",
|
||||||
"Object Path",
|
"Object Path",
|
||||||
"The object path where the object is exported",
|
"The object path where the object is exported",
|
||||||
NULL,
|
NULL,
|
||||||
@ -226,7 +226,7 @@ g_dbus_object_skeleton_new (const gchar *object_path)
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
|
g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
|
||||||
return G_DBUS_OBJECT_SKELETON (g_object_new (G_TYPE_DBUS_OBJECT_SKELETON,
|
return G_DBUS_OBJECT_SKELETON (g_object_new (G_TYPE_DBUS_OBJECT_SKELETON,
|
||||||
"object-path", object_path,
|
"g-object-path", object_path,
|
||||||
NULL));
|
NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ g_dbus_object_skeleton_set_object_path (GDBusObjectSkeleton *object,
|
|||||||
g_free (object->priv->object_path);
|
g_free (object->priv->object_path);
|
||||||
object->priv->object_path = g_strdup (object_path);
|
object->priv->object_path = g_strdup (object_path);
|
||||||
g_mutex_unlock (object->priv->lock);
|
g_mutex_unlock (object->priv->lock);
|
||||||
g_object_notify (G_OBJECT (object), "object-path");
|
g_object_notify (G_OBJECT (object), "g-object-path");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user