Author: sh-sh-sh Date: Mon Oct 29 14:30:10 2007 New Revision: 41611 URL: http://svn.opensuse.org/viewcvs/yast?rev=41611&view=rev Log: Moved opaque 'data' void pointer from YTreeItem / YTableItem to YItem base class Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog branches/tmp/sh/mod-ui/core/libyui/src/YItem.h branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.cc branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.cc branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.h branches/tmp/sh/mod-ui/qt/src/QY2ListView.cc branches/tmp/sh/mod-ui/qt/src/QY2ListView.h Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog?rev=41611&r1=41610&r2=41611&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Mon Oct 29 14:30:10 2007 @@ -380,7 +380,7 @@ - Added YMenuEvent( YMenuEntry * ) constructor - Derived classes can use YMenuItem::index() as a unique ID - or use YMenuItem::data() and YMenuItem::setData() to store + or use YMenuItem::data() and YMenuItem::setData() to store a custom pointer to some other class. Look at YQMenuButton for a sample implementation. @@ -392,3 +392,10 @@ - Constructor now gets YTableHeader object - no more setHeader() and setAlignment functions - get rid of them - use columns(), header(), alignment() in the constructor to set up columns + + +2007-10-29 14:30 sh@suse.de + +* Moved opaque 'data' void pointer from YTreeItem / YTableItem + to YItem base class + Modified: branches/tmp/sh/mod-ui/core/libyui/src/YItem.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YItem.h?rev=41611&r1=41610&r2=41611&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YItem.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YItem.h Mon Oct 29 14:30:10 2007 @@ -46,6 +46,7 @@ : _label( label ) , _selected( selected ) , _index( -1 ) + , _data( 0 ) {} /** @@ -56,6 +57,7 @@ , _iconName( iconName ) , _selected( selected ) , _index( -1 ) + , _data( 0 ) {} /** @@ -111,6 +113,21 @@ **/ int index() const { return _index; } + /** + * Set the opaque data pointer for application use. + * + * Applications can use this to store the pointer to a counterpart of this + * tree item. It is the application's responsibility to watch for dangling + * pointers and possibliy deleting the data. All this class ever does with + * this pointer is to store it. + **/ + void setData( void * newData ) { _data = newData; } + + /** + * Return the opaque data pointer. + **/ + void * data() const { return _data; } + // // Children management stubs. // @@ -161,6 +178,7 @@ string _iconName; bool _selected; int _index; + void * _data; /** * Static children collection that is always empty so the children Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.cc?rev=41611&r1=41610&r2=41611&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.cc Mon Oct 29 14:30:10 2007 @@ -22,9 +22,8 @@ YTableItem::YTableItem() : YItem( "" ) - , _data( 0 ) { - + // NOP } @@ -39,7 +38,6 @@ const string & label_8, const string & label_9 ) : YItem( "" ) - , _data( 0 ) { vector<string> labels; labels.reserve(10); // slight optimization Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h?rev=41611&r1=41610&r2=41611&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h Mon Oct 29 14:30:10 2007 @@ -159,21 +159,6 @@ bool hasIconName( int index ) const; /** - * Set the opaque data pointer for application use. - * - * Applications can use this to store the pointer to a counterpart of this - * tree item. It is the application's responsibility to watch for dangling - * pointers and possibliy deleting the data. All this class ever does with - * this pointer is to store it. - **/ - void setData( void * newData ) { _data = newData; } - - /** - * Return the opaque data pointer. - **/ - void * data() const { return _data; } - - /** * Just for debugging. **/ string label() const { return label(0); } @@ -194,8 +179,7 @@ // Data members // - YTableCellCollection _cells; - void * _data; + YTableCellCollection _cells; }; Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.cc?rev=41611&r1=41610&r2=41611&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.cc Mon Oct 29 14:30:10 2007 @@ -24,7 +24,6 @@ : YItem( label ) , _parent( 0 ) , _isOpen( isOpen ) - , _data( 0 ) { } @@ -35,7 +34,6 @@ : YItem( label, iconName ) , _parent( 0 ) , _isOpen( isOpen ) - , _data( 0 ) { } @@ -46,7 +44,6 @@ : YItem( label ) , _parent( parent ) , _isOpen( isOpen ) - , _data( 0 ) { if ( parent ) parent->addChild( this ); @@ -60,7 +57,6 @@ : YItem( label, iconName ) , _parent( parent ) , _isOpen( isOpen ) - , _data( 0 ) { if ( parent ) parent->addChild( this ); Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.h?rev=41611&r1=41610&r2=41611&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YTreeItem.h Mon Oct 29 14:30:10 2007 @@ -119,27 +119,11 @@ **/ YTreeItem * parent() const { return _parent; } - /** - * Set the opaque data pointer for application use. - * - * Applications can use this to store the pointer to a counterpart of this - * tree item. It is the application's responsibility to watch for dangling - * pointers and possibliy deleting the data. All this class ever does with - * this pointer is to store it. - **/ - void setData( void * newData ) { _data = newData; } - - /** - * Return the opaque data pointer. - **/ - void * data() const { return _data; } - private: YTreeItem * _parent; YItemCollection _children; bool _isOpen; - void * _data; }; Modified: branches/tmp/sh/mod-ui/qt/src/QY2ListView.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/QY2ListView.cc?rev=41611&r1=41610&r2=41611&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/qt/src/QY2ListView.cc (original) +++ branches/tmp/sh/mod-ui/qt/src/QY2ListView.cc Mon Oct 29 14:30:10 2007 @@ -311,7 +311,7 @@ } -bool +void QY2ListView::setSortByInsertionSequence( bool sortByInsertionSequence ) { _sortByInsertionSequence = sortByInsertionSequence; Modified: branches/tmp/sh/mod-ui/qt/src/QY2ListView.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/QY2ListView.h?rev=41611&r1=41610&r2=41611&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/qt/src/QY2ListView.h (original) +++ branches/tmp/sh/mod-ui/qt/src/QY2ListView.h Mon Oct 29 14:30:10 2007 @@ -138,7 +138,7 @@ * Enforce sorting by item insertion order (true) or let user change * sorting by clicking on a column header (false). **/ - virtual bool setSortByInsertionSequence( bool sortByInsertionSequence ); + virtual void setSortByInsertionSequence( bool sortByInsertionSequence ); /** * Returns the next free serial number for items that want to be ordered in -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org