Author: aschnell Date: Thu Mar 19 15:47:31 2009 New Revision: 56242 URL: http://svn.opensuse.org/viewcvs/yast?rev=56242&view=rev Log: - added some const to commitAction Modified: trunk/storage/libstorage/src/Storage.cc trunk/storage/libstorage/src/Storage.h trunk/storage/libstorage/src/StorageTypes.h Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=56242&r1=56241&r2=56242&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Thu Mar 19 15:47:31 2009 @@ -3542,7 +3542,7 @@ { CommitInfo info; info.destructive = (*i)->destructive; - info.text = (*i)->descr; + info.text = (*i)->description; const Volume *v = (*i)->vol(); if( v && !v->getDescText().empty() ) { Modified: trunk/storage/libstorage/src/Storage.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.h?rev=56242&r1=56241&r2=56242&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.h (original) +++ trunk/storage/libstorage/src/Storage.h Thu Mar 19 15:47:31 2009 @@ -1762,8 +1762,8 @@ s << " name:" << a.co()->name(); else if( a.vol() ) s << " name:" << a.vol()->name(); - if( !a.descr.empty() ) - s << " desc:" << a.descr; + if( !a.description.empty() ) + s << " desc:" << a.description; return( s ); }; Modified: trunk/storage/libstorage/src/StorageTypes.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageTypes.h?rev=56242&r1=56241&r2=56242&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageTypes.h (original) +++ trunk/storage/libstorage/src/StorageTypes.h Thu Mar 19 15:47:31 2009 @@ -57,46 +57,63 @@ unsigned order; }; -typedef enum { DECREASE, INCREASE, FORMAT, MOUNT } CommitStage; -class Volume; -class Container; + typedef enum { DECREASE, INCREASE, FORMAT, MOUNT } CommitStage; -struct commitAction + class Volume; + class Container; + + struct commitAction { - commitAction( CommitStage s, CType t, const string& d, const Volume* v, - bool destr=false ) - { stage=s; type=t; descr=d; destructive=destr; container=false; - u.vol=v; } - commitAction( CommitStage s, CType t, const string& d, const Container* co, - bool destr=false ) - { stage=s; type=t; descr=d; destructive=destr; container=true; - u.co=co; } - commitAction( CommitStage s, CType t, const Volume* v ) - { stage=s; type=t; destructive=false; container=false; u.vol=v; } - commitAction( CommitStage s, CType t, const Container* c ) - { stage=s; type=t; destructive=false; container=true; u.co=c; } - CommitStage stage; - CType type; - string descr; - bool destructive; - bool container; - union + commitAction(CommitStage s, CType t, const string& d, const Volume* v, + bool destr = false) + : stage(s), type(t), description(d), destructive(destr), container(false), u(v) + { + } + + commitAction(CommitStage s, CType t, const string& d, const Container* c, + bool destr = false) + : stage(s), type(t), description(d), destructive(destr), container(true), u(c) + { + } + + commitAction(CommitStage s, CType t, const Volume* v) + : stage(s), type(t), destructive(false), container(false), u(v) + { + } + + commitAction(CommitStage s, CType t, const Container* c) + : stage(s), type(t), destructive(false), container(true), u(c) { - const Volume* vol; - const Container* co; + } + + const CommitStage stage; + const CType type; + const string description; + const bool destructive; + const bool container; + + const union U + { + U(const Volume* v) : vol(v) {} + U(const Container* c) : co(c) {} + + const Volume* vol; + const Container* co; } u; - const Container* co() const { return( container?u.co:NULL ); } - const Volume* vol() const { return( container?NULL:u.vol ); } - bool operator==( const commitAction& rhs ) const - { return( stage==rhs.stage && type==rhs.type ); } - bool operator<( const commitAction& rhs ) const; - bool operator<=( const commitAction& rhs ) const - { return( *this < rhs || *this == rhs ); } - bool operator>=( const commitAction& rhs ) const - { return( ! (*this < rhs) ); } - bool operator>( const commitAction& rhs ) const - { return( !(*this < rhs && *this == rhs) ); } + + const Container* co() const { return container ? u.co : NULL; } + const Volume* vol() const { return container ? NULL : u.vol; } + + bool operator==(const commitAction& rhs) const + { return stage == rhs.stage && type == rhs.type; } + bool operator<(const commitAction& rhs) const; + bool operator<=(const commitAction& rhs) const + { return *this < rhs || *this == rhs; } + bool operator>=(const commitAction& rhs) const + { return !(*this < rhs); } + bool operator>(const commitAction& rhs) const + { return !(*this < rhs && *this == rhs); } }; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org