[Development] Adding support for version number comparisons

Kobus Jaroslaw Jaroslaw.Kobus at digia.com
Thu Jul 10 15:50:10 CEST 2014


Just looking at the topic of that thread, I suggest to name it: QVersionNubmer. QVersion may suggest some more, like description of the version or provide an info about different set of features.
________________________________________
From: development-bounces+jaroslaw.kobus=digia.com at qt-project.org [development-bounces+jaroslaw.kobus=digia.com at qt-project.org] on behalf of Keith Gardner [kreios4004 at gmail.com]
Sent: 10 July 2014 14:53
To: Olivier Goffart
Cc: <development at qt-project.org>
Subject: Re: [Development] Adding support for version number comparisons

On Thu, Jul 10, 2014 at 7:31 AM, Olivier Goffart <olivier at woboq.com<mailto:olivier at woboq.com>> wrote:
On Monday 02 June 2014 13:24:55 Richard Moore wrote:
> On 2 June 2014 13:12, Keith Gardner <kreios4004 at gmail.com<mailto:kreios4004 at gmail.com>> wrote:
> > On Mon, Jun 2, 2014 at 2:36 AM, Simon Hausmann <simon.hausmann at digia.com<mailto:simon.hausmann at digia.com>>
> >
> > wrote:
> >> I suggest a name that is more centric towards the _function_ of the
> >> class,
> >> comparison of different software versions.
> >
> > QVersionInformation was also proposed as a name in the code review.  I
> > don't have a problem with changing the name other than it is really long
> > for a simple class.
>
> How about QVersionComparator?

How about qVersionCompare(const QString&, const QString&)?
Yes, that's a function. Is there really the need for a class to hold just a
version string?

And there could be an overload with a SuffixComparator.

(or is qCompareVersion an even better name?)

Currently, the QVersion::compare has an overload to pass a functor that performs the suffix comparison.  Are you suggesting having a "default" in the operators that can be overwritten?




More information about the Development mailing list