[Kde-games-devel] Kolf: Rumours of its death have been much exaggerated

Ian Wadham ianw2 at optusnet.com.au
Sun Jul 5 21:37:34 CEST 2009


On Sun, 5 Jul 2009 10:24:13 pm Stefan Majewsky wrote:
> I'm forwarding the following mail to k-c-d and release-team on request of
> its author:
>
Thanks, Stefan.  I just wanted you to halt any action that might be
in progress to kill Kolf, but I hope it will not hurt to forward all the
gory details ... :-)

> Am Sonntag 05 Juli 2009 03:16:17 schrieb Ian Wadham:
> > In KDE 4.2, the KConfig::groupList() functions delivers
> > group names in sorted order in a QStringList, but in KDE 4.3
> > the names are not sorted, even if they were in the actual file,
> > as is the case in Kolf's Course files.
>
> There have been some changes in KConfig::groupList between KDE 4.2 and 4.3:
> [1] does not look suspicious (does not change the iteration order), but [2]
> changes the temporary result storage from QStringList to QSet<QString>,
> which is most probably the cause of problems.
>
> [1]http://websvn.kde.org/?view=rev&revision=874147
> [2]http://websvn.kde.org/?view=rev&revision=931254
>
Aha!  QSet is hashed: that would do it, right enough ... :-)

> > In Qt 4.4, QStringList::sort() returns another QStringList,
> > whereas in Qt 4.5 it is VOID.  I thought that kind of thing is
> > not supposed to happen in Qt.  With the Qt 4.5 ::sort(), I am
> > assuming that it sorts the current QStringList in situ, but the
> > doco does not actually spell that out ...
>
> QStringList::sort() has always been void, see for evidence:
>   http://doc.trolltech.com/4.4/qstringlist.html#sort
>   http://doc.trolltech.com/4.5/qstringlist.html#sort
>
Apologies to Qt, my mistake ... :-(

> I think the main problem here is the unexpected usage: No library developer
> ever intended that important information be encoded into the group names.
>
That should not matter.  At the library level, bytes are bytes, regardless
of semantics in the application.  And unexpected usage is a hazard of
writing libraries (or any general-purpose software).  That's one reason
why I no longer write such software, now that I am retired ... :-)

> I've also found the course file format of Kolf 1 quite quirky, and made the
> Kolf 2 course file format cleaner in that regard (see
> playground/games/kolf-ng/courses), with extensive use of nested groups.
>
Very nice.  And I really hope you will be converting the existing courses to
the new format.  Let's not throw out the baby with the bath water ... :-)

In fairness to the Kolf 1 author, he would not have had nested groups as
an option ... but he could have stopped at encoding just a hole-number
and an object ID into the group name.

All the best, Ian W.




More information about the kde-games-devel mailing list