KCalc-Bug can be easily fixed in kdelib

Klaus Niederkrueger kniederk at math.uni-koeln.de
Sun Dec 14 20:47:29 GMT 2003


>> There is a thing missing in kstatusbar that would fix the bug
>> immediately:
>> To my knowledge, there is no way to check, if an item already exists
>> (after insertItem was used). There is also no way to get a pointer to
>> such an item (or?).
>
> Adding an itemById() or so would be a good idea indeed.
>

Do you think I should/could add this now, before KDE 3.2 is released?
How should the function look like?

KStatusBarLabel const *find(int id);

It says that KStatusBarLabel is an internal class... Maybe

QLabel *find (id);

Or with "Const"? The problem is that it is probably quite bug prone to
allow the user to play around with the Label instead of using the
KStatusBar functions... Or?

>> I would like to ask you to add to "insertItem" something along the line
>> of
>>
>> insertItem (int id)
>> {
>> +if(id exists in statusbar)
>> +    removeItem(id);
>
> I'm afraid this might introduce some bugs, in case we have apps right now
> that insert stuff without caring much about the IDs. Sounds too late in
> the schedule to change the behavior of insertItem. I suggest to just add
> itemById() and call it from kcalc.

I would at least like to add some QASSERT or some debug message saying:

	Label-id already used.

Is this ok?

Klaus





More information about the kde-core-devel mailing list