Author: sh-sh-sh Date: Tue Oct 30 13:26:21 2007 New Revision: 41637 URL: http://svn.opensuse.org/viewcvs/yast?rev=41637&view=rev Log: added function for derived classes Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc branches/tmp/sh/mod-ui/core/libyui/src/YTable.h Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/... ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc Tue Oct 30 13:26:21 2007 @@ -64,6 +64,19 @@ } +void +YTable::setTableHeader( YTableHeader * newHeader ) +{ + YUI_CHECK_PTR( newHeader ); + + if ( priv->header->columns() != newHeader->columns() ) + deleteAllItems(); + + delete priv->header; + priv->header = newHeader; +} + + int YTable::columns() const { Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTable.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/... ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YTable.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YTable.h Tue Oct 30 13:26:21 2007 @@ -180,6 +180,17 @@ const char *userInputProperty() { return YUIProperty_CurrentItem; } +protected: + + /** + * Exchange the previous table header with a new one. This will delete the + * old YTableHeader object. + * + * If the new header has a different number of columns than the old one, + * all items will implicitly be deleted. + **/ + void setTableHeader( YTableHeader * newHeader ); + private: /** -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org