[glibmm/glibmm-2-52] Gio::SimpleAction: Make set_state() public



commit ed6981107dee22c985d2d011c38df6b032938804
Author: Daniel Boles <dboles src gnome org>
Date:   Mon Jan 30 20:58:03 2017 +0000

    Gio::SimpleAction: Make set_state() public
    
    This is needed to apply the requested state in a custom handler for
    signal_change_state(). It was protected on an assumption that when the C
    doc for g_simple_action_set_state() said “This should only be called by
    the implementor of the action”, it meant the implementor of a subclass.
    
    But the C docs for signal change-state are clear that it means the
    implementor of the signal handler. Without such a user being able to
    call set_state(), they can’t apply the new state, unless they subclass
    SimpleAction, which is a lot to require for such a simple case as this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777953

 gio/src/simpleaction.hg |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
---
diff --git a/gio/src/simpleaction.hg b/gio/src/simpleaction.hg
index 1c57541..c55fdf0 100644
--- a/gio/src/simpleaction.hg
+++ b/gio/src/simpleaction.hg
@@ -157,11 +157,7 @@ public:
   _WRAP_SIGNAL(void activate(const Glib::VariantBase& parameter), "activate", no_default_handler)
   _WRAP_SIGNAL(void change_state(const Glib::VariantBase& value), "change-state", no_default_handler)
 
-protected:
-
   //TODO: Add templated version of this, renaming this to set_state_variant(), like Action::change_state()?
-  //This is protected because the C docs say "This should only be called by the implementor of the action."
-  // though that is not entirely clear. We can make this public if somebody needs it.
   _WRAP_METHOD(void set_state(const Glib::VariantBase& value), g_simple_action_set_state)
 };
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]