KConfigXT: min/max checks in setters
Ingo Klöcker
kloecker at kde.org
Sun Feb 20 16:18:58 GMT 2005
On Saturday 19 February 2005 20:42, Aaron J. Seigo wrote:
> hi...
>
> in the past kicker has had problems with dealing with configuration
> values that were out of range. thankfully, the hand-written checks i
> did several releases ago are no longer necessary as KConfigXT manages
> that via things like min and max values.
>
> however, i was concerned to notice that in the generated setters that
> these min/max values are ignored. this is obviously suboptimal and
> can easily lead to errors.
>
> the attached patch resolves this issue. zack has had a quick look at
> it the other day and didn't immediately die from shock. this is a
> good thing.
>
> i do consider this a bug, and i'd like to get this in for 3.4 ...
> there is one thing to note however, now the headers defined as needed
> in the kcfg[c] files are now included in the generated header. this
> is to ensure that min/max checks that us enums defined elsewhere
> continue to work (as is the case in kicker).
>
> please review.
Do we really want kdebug output in the setters? Moreover, why don't you
set to the maximum/minimum if a too high/low value is passed to the
setter?
Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050220/f235e88d/attachment.sig>
More information about the kde-core-devel
mailing list