[gtkmm] Revert "FlowBox, ListBox: Remove unnecessary static cast."



commit 2a9cfa86e6b6157a6ffe45bb0376f2927b0232a3
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Mon Dec 12 18:55:53 2016 +0100

    Revert "FlowBox, ListBox: Remove unnecessary static cast."
    
    This reverts commit a1a75cff258797e61885a32600e13a9ffb282907.
    These static casts in template functions are necessary,
    but the compiler notices it only when the functions are
    called. Glib::unwrap() must unwrap to a GListModel.
    A GListStore won't do.

 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 ea8bf6f..a09242a 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(store),
+    Glib::unwrap(Glib::RefPtr<Gio::ListModel>::cast_static(store)),
     &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 8858434..0409c29 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(store),
+    Glib::unwrap(Glib::RefPtr<Gio::ListModel>::cast_static(store)),
     &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]