Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] (PR#2607) city report fields still don't sort perfectly
Home

[Freeciv-Dev] (PR#2607) city report fields still don't sort perfectly

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdwheeler42@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#2607) city report fields still don't sort perfectly
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 9 Sep 2003 08:56:26 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[jdorje - Tue Sep  9 15:39:33 2003]:

> Sorting is done numerically for numeric fields, and alphabetically for 
> text fields.  The problem is some fields are combination fields 
> (generally containing multiple numbers) that are sorted alphabetically.

OK, I take it back.

The combination field is the fundamental problem, but there's also a
problem in that only gui-gtk implements numerical comparisons.  Also, I
believe combination fields are sorted as numbers rather than text -
which is better but still not a real solution.

For those interested in porting this functionality, the relevant
function is cityrepfield_compare in client/cityrepdata.c.  This function
needs to be called to compare the two fields.  Something like the
attached patch might do it for gui-gtk-2.0 (although I cannot test this).

jason

Attachment: cityrepfield_compare.diff
Description: cityrepfield_compare.diff


[Prev in Thread] Current Thread [Next in Thread]