From 80429426af17f23670f54e0f52a71887451b2a28 Mon Sep 17 00:00:00 2001 From: Tommi Komulainen Date: Fri, 17 Oct 2008 14:57:38 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20556732=20=E2=80=93=20generate=20gir=20fil?= =?UTF-8?q?es=20consistently?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-10-17 Tommi Komulainen Bug 556732 – generate gir files consistently * giscanner/girwriter.py (_write_property): write properties 'construct' attribute if set * tools/generate.c (write_property_info): write properties 'readable' and 'writable' attributes only if non-default * tests/object.gir: add writable="0" * tests/scanner/foo-1.0-expected.gir: add construct="1" svn path=/trunk/; revision=742 --- girepository/tools/generate.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/girepository/tools/generate.c b/girepository/tools/generate.c index 0e286fb9a..729583f30 100644 --- a/girepository/tools/generate.c +++ b/girepository/tools/generate.c @@ -841,16 +841,12 @@ write_property_info (const gchar *namespace, if (deprecated) xml_printf (file, " deprecated=\"1\""); - - if (flags & G_PARAM_READABLE) - xml_printf (file, " readable=\"1\""); - else - xml_printf (file, " readable=\"0\""); + /* Properties are assumed to be read-only (see also girwriter.py) */ + if (!(flags & G_PARAM_READABLE)) + xml_printf (file, " readable=\"0\""); if (flags & G_PARAM_WRITABLE) xml_printf (file, " writable=\"1\""); - else - xml_printf (file, " writable=\"0\""); if (flags & G_PARAM_CONSTRUCT) xml_printf (file, " construct=\"1\"");