Git commit c1627fde2acdbf4f4b0fb5047e7be37411336595 by Milian Wolff. Committed on 31/01/2016 at 22:51. Pushed by mwolff into branch '5.0'. Remove dead code for showing a busy indicator in the progress widget. We already set the maximum value to 0 in another position, which automatically triggers the busy indicator code path built-in to QProgressBar. No need to reinvent the wheel. M +2 -24 shell/progresswidget/statusbarprogresswidget.cpp M +0 -2 shell/progresswidget/statusbarprogresswidget.h http://commits.kde.org/kdevplatform/c1627fde2acdbf4f4b0fb5047e7be37411336595 diff --git a/shell/progresswidget/statusbarprogresswidget.cpp b/shell/progr= esswidget/statusbarprogresswidget.cpp index 070dd3c..ef02456 100644 --- a/shell/progresswidget/statusbarprogresswidget.cpp +++ b/shell/progresswidget/statusbarprogresswidget.cpp @@ -55,7 +55,7 @@ using namespace KDevelop; //------------------------------------------------------------------------= ----- StatusbarProgressWidget::StatusbarProgressWidget( ProgressDialog* progress= Dialog, QWidget* parent, bool button ) : QFrame( parent ), mCurrentItem( 0 ), mProgressDialog( progressDialog= ), - mDelayTimer( 0 ), mBusyTimer( 0 ), mCleanTimer( 0 ) + mDelayTimer( 0 ), mCleanTimer( 0 ) { m_bShowButton =3D button; int w =3D fontMetrics().width( QStringLiteral(" 999.9 kB/s 00:00:01 ")= ) + 8; @@ -130,18 +130,7 @@ StatusbarProgressWidget::StatusbarProgressWidget( Prog= ressDialog* progressDialog void StatusbarProgressWidget::updateBusyMode() { connectSingleItem(); // if going to 1 item - if ( mCurrentItem ) { // Exactly one item - delete mBusyTimer; - mBusyTimer =3D 0; - mDelayTimer->start( 1000 ); - } else { // N items - if ( !mBusyTimer ) { - mBusyTimer =3D new QTimer( this ); - connect( mBusyTimer, &QTimer::timeout, - this, &StatusbarProgressWidget::slotBusyIndicator ); - mDelayTimer->start( 1000 ); - } - } + mDelayTimer->start( 1000 ); } = void StatusbarProgressWidget::slotProgressItemAdded( ProgressItem *item ) @@ -166,8 +155,6 @@ void StatusbarProgressWidget::slotProgressItemCompleted= ( ProgressItem *item ) // Done. In 5s the progress-widget will close, then we can clean u= p the statusbar mCleanTimer->start( 5000 ); } else if ( mCurrentItem ) { // Exactly one item - delete mBusyTimer; - mBusyTimer =3D 0; activateSingleItemMode(); } } @@ -201,9 +188,6 @@ void StatusbarProgressWidget::slotShowItemDelayed() } else if ( !noItems ) { // N items m_pProgressBar->setMaximum( 0 ); m_pProgressBar->setTextVisible( false ); - Q_ASSERT( mBusyTimer ); - if ( mBusyTimer ) - mBusyTimer->start( 100 ); } = if ( !noItems && mode =3D=3D None ) { @@ -212,12 +196,6 @@ void StatusbarProgressWidget::slotShowItemDelayed() } } = -void StatusbarProgressWidget::slotBusyIndicator() -{ - int p =3D m_pProgressBar->value(); - m_pProgressBar->setValue( p + 10 ); -} - void StatusbarProgressWidget::slotProgressItemProgress( ProgressItem *item= , unsigned int value ) { Q_ASSERT( item =3D=3D mCurrentItem); // the only one we should be conn= ected to diff --git a/shell/progresswidget/statusbarprogresswidget.h b/shell/progres= swidget/statusbarprogresswidget.h index c1464a7..735e98e 100644 --- a/shell/progresswidget/statusbarprogresswidget.h +++ b/shell/progresswidget/statusbarprogresswidget.h @@ -61,7 +61,6 @@ public Q_SLOTS: protected Q_SLOTS: void slotProgressDialogVisible( bool ); void slotShowItemDelayed(); - void slotBusyIndicator(); void updateBusyMode(); = protected: @@ -86,7 +85,6 @@ private: ProgressItem *mCurrentItem; ProgressDialog* mProgressDialog; QTimer *mDelayTimer; - QTimer *mBusyTimer; QTimer *mCleanTimer; }; =