After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755797 - Add G_DEFINE_AUTO_* to gdbus-codegen
Add G_DEFINE_AUTO_* to gdbus-codegen
Status: RESOLVED DUPLICATE of bug 763379
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-09-29 16:02 UTC by Emmanuele Bassi (:ebassi)
Modified: 2016-03-11 15:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdbus-codegen: Add G_DEFINE_AUTO_* to headers (3.92 KB, patch)
2016-01-21 18:41 UTC, Rui Matos
none Details | Review

Description Emmanuele Bassi (:ebassi) 2015-09-29 16:02:36 UTC
The autogenerated code should provide g_auto* magic — whether in the form of using G_DECLARE_* macros, or by using G_DEFINE_AUTO* directly.
Comment 1 Rui Matos 2016-01-21 18:41:15 UTC
Created attachment 319518 [details] [review]
gdbus-codegen: Add G_DEFINE_AUTO_* to headers
Comment 2 Rui Matos 2016-03-11 15:01:39 UTC
A better patch was pushed in bug 763379

*** This bug has been marked as a duplicate of bug 763379 ***
Comment 3 Rui Matos 2016-03-11 15:02:05 UTC
Comment on attachment 319518 [details] [review]
gdbus-codegen: Add G_DEFINE_AUTO_* to headers

>From 9f7569a502565e0a668f42db6172ad3c73258c81 Mon Sep 17 00:00:00 2001
>From: Rui Matos <tiagomatos@gmail.com>
>Date: Thu, 21 Jan 2016 19:38:19 +0100
>Subject: [PATCH] gdbus-codegen: Add G_DEFINE_AUTO_* to headers
>
>https://bugzilla.gnome.org/show_bug.cgi?id=755797
>---
> gio/gdbus-2.0/codegen/codegen.py | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/gio/gdbus-2.0/codegen/codegen.py b/gio/gdbus-2.0/codegen/codegen.py
>index 3858bcf..56464e7 100644
>--- a/gio/gdbus-2.0/codegen/codegen.py
>+++ b/gio/gdbus-2.0/codegen/codegen.py
>@@ -308,6 +308,7 @@ class CodeGenerator:
>             self.h.write('};\n')
>             self.h.write('\n')
>             self.h.write('GType %s_get_type (void) G_GNUC_CONST;\n'%(i.name_lower))
>+            self.h.write('G_DEFINE_AUTOPTR_CLEANUP_FUNC(%s, g_object_unref)\n'%(i.camel_name))
>             self.h.write('\n')
>             self.h.write('GDBusInterfaceInfo *%s_interface_info (void);\n'%(i.name_lower))
>             self.h.write('guint %s_override_properties (GObjectClass *klass, guint property_id_begin);\n'%(i.name_lower))
>@@ -450,6 +451,7 @@ class CodeGenerator:
>             self.h.write('};\n')
>             self.h.write('\n')
>             self.h.write('GType %s_proxy_get_type (void) G_GNUC_CONST;\n'%(i.name_lower))
>+            self.h.write('G_DEFINE_AUTOPTR_CLEANUP_FUNC(%sProxy, g_object_unref)\n'%(i.camel_name))
> 
>             self.h.write('\n')
>             if i.deprecated:
>@@ -537,6 +539,7 @@ class CodeGenerator:
>             self.h.write('};\n')
>             self.h.write('\n')
>             self.h.write('GType %s_skeleton_get_type (void) G_GNUC_CONST;\n'%(i.name_lower))
>+            self.h.write('G_DEFINE_AUTOPTR_CLEANUP_FUNC(%sSkeleton, g_object_unref)\n'%(i.camel_name))
>             self.h.write('\n')
>             if i.deprecated:
>                 self.h.write('G_GNUC_DEPRECATED ')
>@@ -566,6 +569,7 @@ class CodeGenerator:
>             self.h.write('GType %sobject_get_type (void) G_GNUC_CONST;\n'
>                          '\n'
>                          %(self.ns_lower))
>+            self.h.write('G_DEFINE_AUTOPTR_CLEANUP_FUNC(%sObject, g_object_unref)\n'%(self.namespace))
>             for i in self.ifaces:
>                 if i.deprecated:
>                     self.h.write('G_GNUC_DEPRECATED ')
>@@ -601,6 +605,7 @@ class CodeGenerator:
>             self.h.write('};\n')
>             self.h.write('\n')
>             self.h.write('GType %sobject_proxy_get_type (void) G_GNUC_CONST;\n'%(self.ns_lower))
>+            self.h.write('G_DEFINE_AUTOPTR_CLEANUP_FUNC(%sObjectProxy, g_object_unref)\n'%(self.namespace))
>             self.h.write('%sObjectProxy *%sobject_proxy_new (GDBusConnection *connection, const gchar *object_path);\n'%(self.namespace, self.ns_lower))
>             self.h.write('\n')
>             self.h.write('#define %sTYPE_OBJECT_SKELETON (%sobject_skeleton_get_type ())\n'%(self.ns_upper, self.ns_lower))
>@@ -627,6 +632,7 @@ class CodeGenerator:
>             self.h.write('};\n')
>             self.h.write('\n')
>             self.h.write('GType %sobject_skeleton_get_type (void) G_GNUC_CONST;\n'%(self.ns_lower))
>+            self.h.write('G_DEFINE_AUTOPTR_CLEANUP_FUNC(%sObjectSkeleton, g_object_unref)\n'%(self.namespace))
>             self.h.write('%sObjectSkeleton *%sobject_skeleton_new (const gchar *object_path);\n'
>                          %(self.namespace, self.ns_lower))
>             for i in self.ifaces:
>@@ -662,6 +668,7 @@ class CodeGenerator:
>             self.h.write('};\n')
>             self.h.write('\n')
>             self.h.write('GType %sobject_manager_client_get_type (void) G_GNUC_CONST;\n'%(self.ns_lower))
>+            self.h.write('G_DEFINE_AUTOPTR_CLEANUP_FUNC(%sObjectManagerClient, g_object_unref)\n'%(self.namespace))
>             self.h.write('\n')
>             self.h.write('GType %sobject_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);\n'%(self.ns_lower))
>             self.h.write('\n')
>-- 
>2.5.0