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 730740 - When defining a ListStore subclass, in Python, with a do_drag_data_get method, that method is called for all the ListStores
When defining a ListStore subclass, in Python, with a do_drag_data_get method...
Status: RESOLVED DUPLICATE of bug 566571
Product: pygobject
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-25 23:39 UTC by Alex Băluț
Modified: 2014-05-30 04:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
app illustrating the problem (1.04 KB, text/x-python)
2014-05-25 23:39 UTC, Alex Băluț
Details

Description Alex Băluț 2014-05-25 23:39:53 UTC
Created attachment 277164 [details]
app illustrating the problem

Create a class CustomStore(Gtk.ListStore) with a do_drag_data_get method. Notice that the method is called for all the Gtk.ListStore instances. It should be called only for the CustomStore instances.

See the attached app, drag and drop a row in the same treeview and notice in the console that the method is called even though it should not be called.
Comment 1 Simon Feltman 2014-05-26 00:29:39 UTC
This is probably a bug in pygobject. At a cursory glance, the Python vfunc is obviously clobbering the Gtk.ListStores implementation of the vfunc slot. We probably need to add more restrictions as to how vfunc implementations are resolved.

As a workaround, specifying the Gtk.TreeDragSource interface as a base seems to fix the problem:

class CustomStore(Gtk.ListStore, Gtk.TreeDragSource):
    ...

Although sub-classing Gtk.ListStore seems a bit strange to me in general...
Comment 2 Simon Feltman 2014-05-30 04:28:14 UTC
Turns out this is a dup of a very old bug.

*** This bug has been marked as a duplicate of bug 566571 ***