[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdevplatform/5.0] shell/progresswidget: Remove dead code for showing a busy indicator in the progre
From:       Milian Wolff <mail () milianw ! de>
Date:       2016-01-31 22:51:58
Message-ID: E1aQ0qc-0003JH-0S () scm ! kde ! org
[Download RAW message or body]

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/progresswidget/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* progressDialog, \
                QWidget* parent, bool button )
     : QFrame( parent ), mCurrentItem( 0 ), mProgressDialog( progressDialog ),
-      mDelayTimer( 0 ), mBusyTimer( 0 ), mCleanTimer( 0 )
+      mDelayTimer( 0 ), mCleanTimer( 0 )
 {
     m_bShowButton = button;
     int w = fontMetrics().width( QStringLiteral(" 999.9 kB/s 00:00:01 ") ) + 8;
@@ -130,18 +130,7 @@ StatusbarProgressWidget::StatusbarProgressWidget( \
ProgressDialog* progressDialog  void StatusbarProgressWidget::updateBusyMode()
 {
     connectSingleItem(); // if going to 1 item
-    if ( mCurrentItem ) { // Exactly one item
-        delete mBusyTimer;
-        mBusyTimer = 0;
-        mDelayTimer->start( 1000 );
-    } else { // N items
-        if ( !mBusyTimer ) {
-            mBusyTimer = 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 up the \
statusbar  mCleanTimer->start( 5000 );
     } else if ( mCurrentItem ) { // Exactly one item
-        delete mBusyTimer;
-        mBusyTimer = 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 == None ) {
@@ -212,12 +196,6 @@ void StatusbarProgressWidget::slotShowItemDelayed()
     }
 }
 
-void StatusbarProgressWidget::slotBusyIndicator()
-{
-    int p = m_pProgressBar->value();
-    m_pProgressBar->setValue( p + 10 );
-}
-
 void StatusbarProgressWidget::slotProgressItemProgress( ProgressItem *item, unsigned \
int value )  {
     Q_ASSERT( item == mCurrentItem); // the only one we should be connected to
diff --git a/shell/progresswidget/statusbarprogresswidget.h \
b/shell/progresswidget/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;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic