KCalc-Bug can be easily fixed in kdelib

Klaus Niederkrueger kniederk at math.uni-koeln.de
Mon Dec 8 23:26:09 GMT 2003


Hallo,

In the last months, I have been working on kcalc and there is a last
outstanding bug, which I would like to see fixed, before kde-3.2 is
released.

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

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);
+
....

}


This would fix the bug that bothers me in no time. Otherwise I have to
program a work-around in kcalc (which I started to do, but it was
horrible: I had to move initialization-functions around, to have them in
the right order or to use a variable to keep track for myself what labels
exist in the statusbar).

Changing kstatusbar.cpp on the other hand, would be just adding two lines
(and three lines for doxygen).


The bug in kcalc is easy to see: Start KCalc (for the first time).
Activate all the extra-buttons. On the statusbar, there are some labels
that appear. Now quit the program and restart it. Some of the labels
appear now twice, because "statustbar()->insertItem" is used several
times.


Thanks

	Klaus





More information about the kde-core-devel mailing list