After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 527587 - Glib::RefPtr<Gtk::RecentInfo> cannot be used in TreeStore
Glib::RefPtr<Gtk::RecentInfo> cannot be used in TreeStore
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: TreeView
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2008-04-11 17:37 UTC by Armin Burgmeier
Modified: 2008-04-11 17:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (1.46 KB, text/x-c++src)
2008-04-11 17:38 UTC, Armin Burgmeier
  Details
Proposed patch (1.85 KB, patch)
2008-04-11 17:40 UTC, Armin Burgmeier
committed Details | Review

Description Armin Burgmeier 2008-04-11 17:37:25 UTC
When attempting to add() a Gtk::TreeModelColumn<Glib::RefPtr<Gtk::RecentInfo> > to a Gtk::TreeModel::ColumnRecord derived class, a compile error occurs. Adding GtkRecentInfo* to a GtkListStore works perfectly in C, though.
Comment 1 Armin Burgmeier 2008-04-11 17:38:39 UTC
Created attachment 109066 [details]
Test case

This is a (rather) simple test case. It produces the following error:

/usr/include/glibmm-2.4/glibmm/value.h: In static member function ‘static GType Glib::Value<Glib::RefPtr<T_CppObject> >::value_type() [with T = Gtk::RecentInfo]’:
/usr/include/gtkmm-2.4/gtkmm/treemodelcolumn.h:140:   instantiated from ‘Gtk::TreeModelColumn<T>::TreeModelColumn() [with T = Glib::RefPtr<Gtk::RecentInfo>]’
20080411-openismus-recentinfo-value-testcase.cc:7:   instantiated from here
/usr/include/glibmm-2.4/glibmm/value.h:233: error: ‘get_base_type’ is not a member of ‘Gtk::RecentInfo’
/usr/include/glibmm-2.4/glibmm/value.h: In member function ‘void Glib::Value<Glib::RefPtr<T_CppObject> >::set(const Glib::RefPtr<T_CppObject>&) [with T = Gtk::RecentInfo]’:
/usr/include/gtkmm-2.4/gtkmm/treeiter.h:456:   instantiated from ‘void Gtk::TreeRow::set_value(const Gtk::TreeModelColumn<ColumnType>&, const ColumnType&) const [with ColumnType = Glib::RefPtr<Gtk::RecentInfo>]’
/usr/include/gtkmm-2.4/gtkmm/treeiter.h:429:   instantiated from ‘Gtk::TreeValueProxy<ColumnType>& Gtk::TreeValueProxy<ColumnType>::operator=(const ColumnType&) [with ColumnType = Glib::RefPtr<Gtk::RecentInfo>]’
20080411-openismus-recentinfo-value-testcase.cc:39:   instantiated from here
/usr/include/glibmm-2.4/glibmm/value.h:235: error: no matching function for call to ‘Glib::Value<Glib::RefPtr<Gtk::RecentInfo> >::set_object(Gtk::RecentInfo*)’
/usr/include/glibmm-2.4/glibmm/value.h:129: note: candidates are: void Glib::ValueBase_Object::set_object(Glib::ObjectBase*)
Comment 2 Armin Burgmeier 2008-04-11 17:40:14 UTC
Created attachment 109067 [details] [review]
Proposed patch

This patch fixes the problem by providing a specialization of Glib::Value<Glib::RefPtr<Gtk::RecentInfo> >.
Comment 3 Murray Cumming 2008-04-11 17:44:52 UTC
Yeah, please add that in gtkmm's svn trunk.

For the record, we could add a get_base_type() to Gtk::RecentInfo, but we don't want to make Gtk::RecentInfo derive from Glib::ObjectBase, so this is the best solution.
Comment 4 Armin Burgmeier 2008-04-11 17:52:11 UTC
Done. I also tried implementing get_base_type() in Gtk::RecentInfo first, but that's not enough to make it compile. Since Gtk::RecentInfo is a boxed type it cannot derive from Glib::ObjectBase anyway, I think.