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 548793 - funny pattern for iterating GtkTreeModel
funny pattern for iterating GtkTreeModel
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Documentation
2.12.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-08-21 07:01 UTC by Danielle Madeley
Modified: 2012-11-22 21:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
improve GtkTreeModel iteration pattern in documentation (1.43 KB, patch)
2012-11-22 17:47 UTC, David King
committed Details | Review

Description Danielle Madeley 2008-08-21 07:01:02 UTC
The docs for GtkTreeModel suggest iterating through the model using a while() loop, which makes the use of 'continue;' more error prone.

Perhaps the documentation should be updated with this pattern:

        gboolean valid;                
        for (valid = gtk_tree_model_get_iter_first (model, &iter);
             valid;
             valid = gtk_tree_model_iter_next (model, &iter))
        {
          ...
        }
Comment 1 David King 2012-11-22 17:47:50 UTC
Created attachment 229649 [details] [review]
improve GtkTreeModel iteration pattern in documentation
Comment 2 Matthias Clasen 2012-11-22 21:27:18 UTC
Review of attachment 229649 [details] [review]:

looks ok
Comment 3 David King 2012-11-22 21:39:01 UTC
Comment on attachment 229649 [details] [review]
improve GtkTreeModel iteration pattern in documentation

Thanks, pushed to master and gtk-3-6 as commits c627b221264ff93f5bb4e172fb875a57ec7e5959 and 1bad36ae1db1006b4f2f06f3fb3828efc0130a45.