[glibmm] Gio::Action::get_state_bool(): Correction.



commit 02ff8d20d6d483359ea6f9c164d6681c2b21d3ca
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jul 30 11:31:38 2013 +0200

    Gio::Action::get_state_bool(): Correction.
    
    Use g_variant_type_equal() instead of comparing the pointers.

 gio/src/action.ccg |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gio/src/action.ccg b/gio/src/action.ccg
index dbc1279..496aa30 100644
--- a/gio/src/action.ccg
+++ b/gio/src/action.ccg
@@ -27,7 +27,7 @@ namespace Gio
 bool Action::get_state_bool() const
 {
   g_return_val_if_fail(
-    g_action_get_state_type(const_cast<GAction*>(gobj())) == G_VARIANT_TYPE_BOOLEAN,
+    g_variant_type_equal(g_action_get_state_type(const_cast<GAction*>(gobj())), G_VARIANT_TYPE_BOOLEAN),
     false);
 
   GVariant* state = g_action_get_state(const_cast<GAction*>(gobj()));
@@ -40,8 +40,7 @@ bool Action::get_state_bool() const
 void Action::change_state(bool value)
 {
   g_return_if_fail(
-    g_action_get_state_type(const_cast<GAction*>(gobj())) == G_VARIANT_TYPE_BOOLEAN);
-
+    g_variant_type_equal(g_action_get_state_type(const_cast<GAction*>(gobj())), G_VARIANT_TYPE_BOOLEAN));
   change_state(Glib::Variant<bool>::create(value));
 }
 


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