![](https://seccdn.libravatar.org/avatar/1221572c74a1df78a3aa2625b979eb21.jpg?s=120&d=mm&r=g)
Author: gs Date: Thu Feb 24 13:10:19 2011 New Revision: 63465 URL: http://svn.opensuse.org/viewcvs/yast?rev=63465&view=rev Log: deselectAllItems added (bug-fix for bnc#673801) 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=63465&r1=63464&r2=63465&view=diff ============================================================================== --- trunk/ncurses/src/NCTree.cc (original) +++ trunk/ncurses/src/NCTree.cc Thu Feb 24 13:10:19 2011 @@ -344,7 +344,20 @@ return yitem; } +void NCTree::deselectAllItems() +{ + if ( multiSel) + { + YItemCollection selectedItems = YTree::selectedItems(); + + for ( YItemConstIterator it = selectedItems.begin(); it != selectedItems.end(); ++it ) + { + selectItem( *it, false ); + } + } + YTree::deselectAllItems(); +} // Set current item (under the cursor) to selected @@ -352,7 +365,7 @@ { if ( !myPad() ) return; - + YTreeItem * treeItem = dynamic_cast<YTreeItem *>( item ); YUI_CHECK_PTR( treeItem ); YTreeItem *citem = getCurrentItem(); @@ -372,9 +385,9 @@ } } - if ( !selected && ( treeItem == citem ) ) + if ( !selected ) { - if ( !multiSel ) + if ( !multiSel && (treeItem == citem) ) { YTree::deselectAllItems(); } @@ -483,7 +496,7 @@ { if ( !myPad() ) { - yuiWarning() << "PadWidget not valid" << endl; + yuiWarning() << "PadWidget not yet created" << endl; return; } Modified: trunk/ncurses/src/NCTree.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCTree.h?rev=63465&r1=63464&r2=63465&view=diff ============================================================================== --- trunk/ncurses/src/NCTree.h (original) +++ trunk/ncurses/src/NCTree.h Thu Feb 24 13:10:19 2011 @@ -74,6 +74,8 @@ virtual YTreeItem * getCurrentItem() const; virtual YTreeItem * currentItem(); + + virtual void deselectAllItems(); virtual void selectItem( YItem *item, bool selected ); virtual void selectItem( int index ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org