KCalc-Bug can be easily fixed in kdelib

David Faure faure at kde.org
Mon Dec 15 09:22:40 GMT 2003


> 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?
You are correct. Better add something that simply tells whether such an
item is known.
bool hasItem( int id ) const;

> >> 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?

OK.

-- 
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list