glib/gio/gdbus-codegen
David Zeuthen 6bccc46d15 gdbus-codegen: Don't send out PropertiesChanged if value ends up not changing
A fairly typical pattern is to have code that does

 foo_set_bar (object, "");
 if (some_condition)
   {
     foo_set_bar (object, "yes");
   }

where some_condition is often true every time @object is updated.

With this code, bar is essentially always "yes" but because of how
gdbus-codegen works, useless PropertiesChanged events got scheduled
and sent out. With this patch, we avoid that by always keeping the
original value around and comparing it only when we deem it's time to
send out the ::PropertiesChanged signal (typically in an idle but can
be forced by the user via flush()).

Also add a test case for this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 15:53:28 -04:00
..
__init__.py gdbus-codegen: Add copyright / license headers 2011-04-15 08:33:30 -04:00
codegen_docbook.py gdbus-codegen: Add support for the org.freedesktop.DBus.Deprecated annotation 2011-04-15 12:56:07 -04:00
codegen_main.py gdbus-codegen: Add copyright / license headers 2011-04-15 08:33:30 -04:00
codegen.py gdbus-codegen: Don't send out PropertiesChanged if value ends up not changing 2011-04-15 15:53:28 -04:00
config.py.in gdbus-codegen: Add copyright / license headers 2011-04-15 08:33:30 -04:00
dbustypes.py gdbus-codegen: Add support for the org.freedesktop.DBus.Deprecated annotation 2011-04-15 12:56:07 -04:00
gdbus-codegen.in gdbus-codegen: Add copyright / license headers 2011-04-15 08:33:30 -04:00
Makefile.am Add gdbus-codegen(1) command 2011-04-08 17:11:38 -04:00
parser.py gdbus-codegen: Add copyright / license headers 2011-04-15 08:33:30 -04:00
utils.py gdbus-codegen: Add copyright / license headers 2011-04-15 08:33:30 -04:00