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 629727 - CellLayout get_cells() empty list not undef
CellLayout get_cells() empty list not undef
Status: RESOLVED WONTFIX
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2010-09-15 00:22 UTC by Kevin Ryde
Modified: 2011-10-03 15:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch and test case (2.27 KB, patch)
2010-09-15 00:22 UTC, Kevin Ryde
none Details | Review
tests (1.34 KB, patch)
2010-09-21 00:20 UTC, Kevin Ryde
none Details | Review

Description Kevin Ryde 2010-09-15 00:22:48 UTC
Created attachment 170309 [details] [review]
patch and test case

When a CellLayout interfaced widget has no renderers I think get_cells() should return an empty list, not an undef.  An undef return is rather inconvenient if doing a foreach ($viewer->get_cells).  Perhaps per attached.
Comment 1 Torsten Schoenfeld 2010-09-19 16:05:43 UTC
I agree that (undef) for no cells is definitely very inconvenient, and your patch corrects that.  (And git puts the blame on me. :-/)  But I worry about backwards compatibility.  Is it conceivable that someone somewhere relies on (undef) signaling "no cells"?
Comment 2 Kevin Ryde 2010-09-21 00:19:44 UTC
As a boolean it's unchanged (new .t diff attached), if that helps.

It seems unlikely that getting back a non-cell from get_cells could do anyone much good.  My guess would be that nobody has done an empty get_cells before now and that returning undef instead of empty may be rated a bug.
Comment 3 Kevin Ryde 2010-09-21 00:20:38 UTC
Created attachment 170727 [details] [review]
tests
Comment 4 Torsten Schoenfeld 2011-10-03 15:08:15 UTC
I just pushed a patch to master that documents the unusual current return
semantics of get_cells().  I feel that changing it like you proposed would be
too risky.  I'll try to make sure that Gtk3 gets this right.