[yast-commit] r45277 - in /trunk/libyui/src: YTreeItem.cc YTreeItem.h
Author: sh-sh-sh Date: Fri Mar 7 12:15:01 2008 New Revision: 45277 URL: http://svn.opensuse.org/viewcvs/yast?rev=45277&view=rev Log: don't report childless tree items as open Modified: trunk/libyui/src/YTreeItem.cc trunk/libyui/src/YTreeItem.h Modified: trunk/libyui/src/YTreeItem.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YTreeItem.cc?rev=45277&r1=45276&r2=45277&view=diff ============================================================================== --- trunk/libyui/src/YTreeItem.cc (original) +++ trunk/libyui/src/YTreeItem.cc Fri Mar 7 12:15:01 2008 @@ -88,3 +88,16 @@ _children.clear(); } + + +bool YTreeItem::isOpen() const +{ + return hasChildren() ? _isOpen : false; +} + + +void YTreeItem::setOpen( bool open ) +{ + _isOpen = open; +} + Modified: trunk/libyui/src/YTreeItem.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YTreeItem.h?rev=45277&r1=45276&r2=45277&view=diff ============================================================================== --- trunk/libyui/src/YTreeItem.h (original) +++ trunk/libyui/src/YTreeItem.h Fri Mar 7 12:15:01 2008 @@ -106,13 +106,16 @@ /** * Return 'true' if this tree item should be displayed open (with its * children visible) by default. + * + * Notice that this will always return 'false' for tree items without + * children. **/ - bool isOpen() const { return _isOpen; } + bool isOpen() const; /** * Change the 'isOpen' flag. **/ - void setOpen( bool open ) { _isOpen = open; } + void setOpen( bool open ); /** * Returns this item's parent item or 0 if it is a toplevel item. -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
sh-sh-sh@svn.opensuse.org