Make 4 incompatible changes to the GAction API
authorRyan Lortie <desrt@desrt.ca>
Wed, 29 Jun 2011 09:11:59 +0000 (10:11 +0100)
committerSebastien Bacher <seb128@ubuntu.com>
Wed, 29 Jun 2011 10:38:21 +0000 (11:38 +0100)
commit5ff65d869543587d10d78c123698e47effc5fb8c
tree257baaabf7ae964c0249a54ce6e99645c6e40b3d
parentd1e26c51c8298db782d253e0a5ff794b197270bf
Make 4 incompatible changes to the GAction API

This commit represents an API break to GAction in the following ways:

  - the 'set_state' entry in the GActionInterface vtable has been
    renamed to 'change_state'.  The number and order of vtable items has
    not otherwise changed.

  - g_action_set_state() has been renamed to g_action_change_state() to
    match the updated vtable entry.

  - the "state" property of the GAction interface has been changed to
    read-only to reflect the fact that g_action_set_state() no longer
    exists.

  - GSimpleActionClass has been hidden.  GSimpleAction can no longer be
    subclassed.

>> Rationale

g_action_set_state() has never been a true setter in the sense that
calling it will update the value of the "state" property.  It has always
been closer to "request 'state' to be changed to this value" with
semantics defined by the implementor of the interface.  This is why the
equivalent method in GActionGroup had its name changed from 'set' to
'change'.  This change makes the two interfaces more consistent and
removes any implication about the effect that calling set_state() should
have on the 'state' property.

>> Impact

This incompatible API break was undertaken only because I strongly
suspect that it will go entirely unnoticed.  If the break actually
affects anybody, then we will accommodate them (possibly going as far as
to revert this commit entirely).

The virtual table change only impacts implementors of GAction.  I
strongly suspect that this is nobody (except for GSimpleAction).

The hiding of GSimpleActionClass only impacts impacts subclasses of
GSimpleAction.  I strongly suspect that none of these exist.

The changing of the property to be read-only only affects people who
were trying to change the state by using GObject properties.  I strongly
suspect that this is nobody at all.

The removal of the g_action_set_state() call is the most dangerous, but
I still suspect that it will impact nobody outside of GLib.  If anybody
is impacted by this change then, at their request, I will reintroduce
the API as a deprecated alias for g_action_change_state().
docs/reference/gio/gio-sections.txt
gio/gaction.c
gio/gaction.h
gio/gio.symbols
gio/gsimpleaction.c
gio/gsimpleaction.h
gio/gsimpleactiongroup.c
gio/tests/actions.c
gio/tests/gapplication-example-actions.c