[GSOC] Quail - Progress 11th July 2013

Ka-Hing Cheung khc at hxbc.us
Fri Jul 12 17:31:17 EDT 2013


On Thu, 2013-07-11 at 21:16 +0100, Phil Hannent wrote:
> On 11 July 2013 20:27, Ka-Hing Cheung <khc at hxbc.us> wrote:
>         On Thu, 2013-07-11 at 12:04 +0100, Phil Hannent wrote:
>         >       for (widget = widgets.first(), l = chatInfoList;
>         >                widget != NULL && l != NULL;
>         >                widget = widgets.next(), l = l->next)
>         >       {
>         >
>         >
>         > (widgets is a QList<QWidget*> and chatInfoList is a GList of
>         > PurplePluginProtocolInfo*)
>         
>         
>         Have you considered writing a generic wrapper that exposes
>         iterators for
>         QList and GList, so you can use modern c++ techniques like
>         foreach?
>         
> Thanks for the feedback. I have not considered writing a wrapper, I
> played with the QListIterator class that Qt has. However I am rushing
> to get some milestones ticked off, I am intending to come back and
> look at the GLib documentation to see how to best approach it.

Looks like gtkmm has a similar wrapper:

https://developer.gnome.org/glibmm/unstable/classGlib_1_1Container__Helpers_1_1ListIterator.html

It's not exactly what I was thinking of, but may make things slightly
easier for you.

-khc





More information about the Devel mailing list