Author: kmachalkova Date: Mon Dec 15 13:15:48 2008 New Revision: 54114 URL: http://svn.opensuse.org/viewcvs/yast?rev=54114&view=rev Log: Static indexing of tree items is stupid - default item is then wrongly selected instead of the correct one (#459068) Modified: trunk/ncurses/src/NCTree.cc trunk/ncurses/src/NCTree.h Modified: trunk/ncurses/src/NCTree.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCTree.cc?rev=54114&r1=54113&r2=54114&view=diff ============================================================================== --- trunk/ncurses/src/NCTree.cc (original) +++ trunk/ncurses/src/NCTree.cc Mon Dec 15 13:15:48 2008 @@ -415,8 +415,6 @@ // (called recursively for each child of an item) void NCTree::CreateTreeLines( NCTreeLine * parentLine, NCTreePad * pad, YItem * item ) { - //static index counter - static int idx = 0; //set item index explicitely, it is set to -1 by default //which makes selecting items painful item->setIndex( idx++ ); @@ -447,12 +445,14 @@ return; } + idx = 0; // YItemIterator iterates over the toplevel items for ( YItemIterator it = itemsBegin(); it < itemsEnd(); ++it ) { CreateTreeLines( 0, myPad(), *it ); } + idx = 0; NCPadWidget::DrawPad(); } Modified: trunk/ncurses/src/NCTree.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCTree.h?rev=54114&r1=54113&r2=54114&view=diff ============================================================================== --- trunk/ncurses/src/NCTree.h (original) +++ trunk/ncurses/src/NCTree.h Mon Dec 15 13:15:48 2008 @@ -36,6 +36,7 @@ NCTree & operator=( const NCTree & ); NCTree( const NCTree & ); + int idx; void CreateTreeLines( NCTreeLine * p, NCTreePad * pad, YItem * item ); protected: -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org