[gtkmm] FlowBox, ListBox: Replace unnecessary RefPtr<>::cast_static()



commit eb6ac6dbc7d8294db505333ed585c73d9d3f11c7
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Thu Dec 15 13:37:04 2016 +0100

    FlowBox, ListBox: Replace unnecessary RefPtr<>::cast_static()
    
    The g++ compiler detects some errors in a template function only when
    a call to the function is compiled. With these replacements for cast_static()
    gtkmm_documentation/examples/book/listmodel/example can still be built.

 gtk/src/flowbox.hg |    2 +-
 gtk/src/listbox.hg |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/src/flowbox.hg b/gtk/src/flowbox.hg
index a09242a..d6c1e09 100644
--- a/gtk/src/flowbox.hg
+++ b/gtk/src/flowbox.hg
@@ -319,7 +319,7 @@ void FlowBox::bind_list_store(const Glib::RefPtr<Gio::ListStore<T_item>>& store,
   auto slot_copy = new SlotCreateWidget<T_item>(std::forward<T_slot>(slot_create_widget));
 
   gtk_flow_box_bind_model(gobj(),
-    Glib::unwrap(Glib::RefPtr<Gio::ListModel>::cast_static(store)),
+    store ? store->Gio::ListModel::gobj() : nullptr,
     &proxy_bind_list_store_create_widget_callback<T_item>,
     slot_copy, &Glib::destroy_notify_delete<SlotCreateWidget<T_item>>);
 }
diff --git a/gtk/src/listbox.hg b/gtk/src/listbox.hg
index 0409c29..3911d30 100644
--- a/gtk/src/listbox.hg
+++ b/gtk/src/listbox.hg
@@ -349,7 +349,7 @@ void ListBox::bind_list_store(const Glib::RefPtr<Gio::ListStore<T_item>>& store,
   auto slot_copy = new SlotCreateWidget<T_item>(std::forward<T_slot>(slot_create_widget));
 
   gtk_list_box_bind_model(gobj(),
-    Glib::unwrap(Glib::RefPtr<Gio::ListModel>::cast_static(store)),
+    store ? store->Gio::ListModel::gobj() : nullptr,
     &proxy_bind_list_store_create_widget_callback<T_item>,
     slot_copy, &Glib::destroy_notify_delete<SlotCreateWidget<T_item>>);
 }


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