From kde-devel Fri Mar 03 14:21:13 2000 From: Lotzi Boloni Date: Fri, 03 Mar 2000 14:21:13 +0000 To: kde-devel Subject: RE: SelectAction changes and questions, again X-MARC-Message: https://marc.info/?l=kde-devel&m=95209335303329 > > -I had to do it in QSelectAction - because the menu etc is a private > > variable there. This is a permission question: I have > > commited it anyhow. > > I don't think this is a problem - we own it for now. Ok. I therefore allow Troll tech to all my changes, etc, etc. :-) > > I get a menu with a separator in the middle. But selecting the pink > > beast, the selectAction->currentItem() now returns 1 (as the > > separator is not counted in the menu). > > > > This can be either handled at the application level, or it > > can be fixed in QSelectAction - but this would imply some further > > work on QSelectAction. > > Why is it a problem ? > Since you can't select a separator (can you?) why do you need it to have > an index ? Ok, the problem is that then you can not index directly back into your itemlist. You see: itemlist = {"Pink", "", "Blue"} and you got back i=selectAction->currentItem --- it is not going to work like: selectAction->itemList[i] But you should do something like: itemlist2 = {"Pink", "Blue"} // without the blanks, aka separators and itemlist2[i] will be correct. As I said, this can be done in the application, but you must take care of it. I handled it in konsole, but if we keep it this way we had to document it somewhere. Should I write it in kaction.h ? Lotzi