Author: mlandres Date: Thu Jul 12 16:25:02 2007 New Revision: 5993 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5993&view=rev Log: Let ProgressData indicate "end of lifetime". Modified: branches/REFACTORING-10_3/libzypp/zypp/ProgressData.cc branches/REFACTORING-10_3/libzypp/zypp/ProgressData.h Modified: branches/REFACTORING-10_3/libzypp/zypp/ProgressData.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/ProgressData.cc?rev=5993&r1=5992&r2=5993&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/ProgressData.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/ProgressData.cc Thu Jul 12 16:25:02 2007 @@ -32,10 +32,6 @@ // bool ProgressData::report() { - // DISABLED to get DBG output from 'if ( doReport )' - //if ( ! _d->_receiver ) - // return true; - bool goOn = true; // continue per default bool doReport = false; @@ -134,14 +130,14 @@ _last_value(0), _pd(pd) { - + } - + bool CombinedProgressData::operator()( const ProgressData &progress ) - { + { if ( progress.reportAlive() || ( _weight == 0 ) ) return _pd.tick(); - + // factor [0,1] of increase in subtask ( ie: before 0,2 now 0.5 ) float increment = ((float)(progress.val() - _last_value))/(progress.max() - progress.min()); // how much the subtask affects the parent task ie: 0,1 @@ -151,7 +147,7 @@ _last_value = progress.val(); return _pd.incr( (int)( (_pd.max()-_pd.min()) * real_increment) ); } - + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/ProgressData.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/ProgressData.h?rev=5993&r1=5992&r2=5993&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/ProgressData.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/ProgressData.h Thu Jul 12 16:25:02 2007 @@ -277,6 +277,9 @@ //@} public: + /** \name Progress receiving. + */ + //@{ /** @return Current \c min value. */ value_type min() const { return _d->_min; } @@ -293,7 +296,6 @@ bool hasRange() const { return min() != max(); } - /** @return Wheter \ref reportValue will return a percent value. * Same as \ref hasRange. * \see \ref reportAlive @@ -322,6 +324,14 @@ const ReceiverFnc & receiver() const { return _d->_receiver; } + /** @return Retrun \c true if this the final report sent by the + * ProgressData dtor. + */ + bool finalReport() const + { return( _d->_state == END ); } + + //@} + private: /** Send report if necessary. */ bool report(); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org