summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-10-03 12:21:26 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-10-03 12:21:26 +0000
commitb8c5cbc366cf86988fa749e5007a52e6437d49fa (patch)
tree8d9dd24bd17d00b101d10e477721cba4dcf7acd7 /tools
parentd7bb0c45b50074d21df756b615b42265dd4b873f (diff)
tools/glib-gtypes-generator.py: if array-name is explicitly set to an empty string, don't emit an array GType. Arrays of some Telepathy structs don't really make sense
Diffstat (limited to 'tools')
-rw-r--r--tools/glib-gtypes-generator.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/tools/glib-gtypes-generator.py b/tools/glib-gtypes-generator.py
index 1b34c081..5adbec6c 100644
--- a/tools/glib-gtypes-generator.py
+++ b/tools/glib-gtypes-generator.py
@@ -122,16 +122,19 @@ class GTypesGenerator(object):
self.header.write(' */\n')
self.header.write('#define %s (%s ())\n\n' % (name, impl))
- array_name = (struct.getAttribute('array-name')
- or (struct.getAttribute('name') + '_LIST'))
- array_name = (self.PREFIX_ + 'ARRAY_TYPE_' + array_name.upper())
- impl = self.prefix_ + 'type_dbus_array_' + esc_impl_sig
- self.header.write('/**\n * %s:\n\n' % array_name)
- self.header.write(' * An array of #%s.\n' % name)
- self.header.write(' * This macro expands to a call to a function\n')
- self.header.write(' * that returns a GType.\n')
- self.header.write(' */\n')
- self.header.write('#define %s (%s ())\n\n' % (array_name, impl))
+ if struct.hasAttribute('array-name'):
+ array_name = struct.getAttribute('array-name')
+ else:
+ array_name = struct.getAttribute('name') + '_LIST'
+ if array_name != '':
+ array_name = (self.PREFIX_ + 'ARRAY_TYPE_' + array_name.upper())
+ impl = self.prefix_ + 'type_dbus_array_' + esc_impl_sig
+ self.header.write('/**\n * %s:\n\n' % array_name)
+ self.header.write(' * An array of #%s.\n' % name)
+ self.header.write(' * This macro expands to a call to a function\n')
+ self.header.write(' * that returns a GType.\n')
+ self.header.write(' */\n')
+ self.header.write('#define %s (%s ())\n\n' % (array_name, impl))
self.need_structs[impl_sig] = esc_impl_sig