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

List:       kde-commits
Subject:    koffice/libs/guiutils
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2009-04-08 19:13:28
Message-ID: 1239218008.119787.10368.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 951242 by rempt:

fix unittests on linux by making sure we update the gui even after the last update \
has arrived (this was a not-so-subtle timer issue)

 M  +6 -8      KoProgressUpdater.cpp  


--- trunk/koffice/libs/guiutils/KoProgressUpdater.cpp #951241:951242
@@ -66,6 +66,7 @@
 
 KoProgressUpdater::~KoProgressUpdater()
 {
+    d->progressBar->setValue(d->progressBar->maximum());
     qDeleteAll(d->subtasks);
     d->subtasks.clear();
 
@@ -78,6 +79,7 @@
 void KoProgressUpdater::start(int range, const QString &text)
 {
     kDebug(30004) << "KoProgressUpdater::start " << range << ", " << text << " in " \
<< thread(); +    d->updateGuiTimer.start( 100 ); // 10 updates/second should be \
enough?  
     qDeleteAll(d->subtasks);
     d->subtasks.clear();
@@ -121,20 +123,12 @@
 void KoProgressUpdater::update()
 {
     d->updated = true;
-    if ( !d->updateGuiTimer.isActive() ) {
-        kDebug(30004) << "KoProgressUpdater::update(), starting timer in " << \
                thread();
-        d->updateGuiTimer.start( 100 ); // 10 updates/second should be enough?
-    }
-
-
 }
 
 void KoProgressUpdater::updateUi() {
 
     kDebug(30004) << "KoProgressUpdater::updateUi() in " << thread();
 
-    d->updateGuiTimer.stop(); // 10 upd ates/second should be enough?
-
     // This function runs in the app main thread. All the progress
     // updates arrive at the KoUpdaterPrivate instances through
     // queued connections, so until we relinguish control to the
@@ -178,6 +172,10 @@
     }
 
     kDebug(30004) << "\tsetting value!" << d->currentProgress;
+    if ( d->currentProgress >= d->progressBar->maximum()) {
+        // we're done
+        d->updateGuiTimer.stop(); // 10 upd ates/second should be enough?
+    }
     d->progressBar->setValue(d->currentProgress);
 }
 


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

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