[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-10 14:02:50
Message-ID: 1239372170.626615.1185.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 951883 by rempt:
use a local variable -- it's much faster
M +6 -17 KoUpdater.cpp
M +1 -0 KoUpdater.h
--- trunk/koffice/libs/guiutils/KoUpdater.cpp #951882:951883
@@ -23,15 +23,12 @@
#include <QApplication>
-#include <kdebug.h>
-
#include "KoProgressUpdater.h"
#include "KoUpdaterPrivate.h"
KoUpdater::KoUpdater(KoUpdaterPrivate *p)
+ : m_progressPercent(0)
{
- kDebug(30004) << "created KoUpdater in thread " << thread();
-
d = p;
Q_ASSERT(p);
Q_ASSERT(!d.isNull());
@@ -46,31 +43,24 @@
void KoUpdater::cancel()
{
- kDebug(30004) << "KoUpdater::cancel in " << thread();
emit sigCancel();
}
void KoUpdater::setProgress(int percent)
{
- if (progress() >= percent) {
+ if (m_progressPercent >= percent) {
return;
}
- kDebug(30004) << "KoUpdater::setProgress " << percent << " in " << thread();
+ m_progressPercent = percent;
+
emit sigProgress( percent );
- qApp->processEvents();
}
int KoUpdater::progress() const
{
- kDebug(30004) << "KoUpdater::progress in " << thread();
- if ( d.isNull() ) {
- kDebug(30004) << "\t Private is null!";
- return 100;
- }
-
- return d->progress();
+ return m_progressPercent;
}
bool KoUpdater::interrupted() const
@@ -85,11 +75,11 @@
void KoUpdater::setValue( int value )
{
- kDebug(30004) << "KoUpdater::setValue " << value << " in " << thread();
if ( value < min ) value = min;
if ( value > max ) value = max;
// Go from range to percent
+
setProgress( (100 * value ) / range + 1 );
}
@@ -108,7 +98,6 @@
void KoUpdater::interrupt()
{
- kDebug(30004) << "KoUpdater::interrupt() in " << thread();
m_interrupted = true;
}
--- trunk/koffice/libs/guiutils/KoUpdater.h #951882:951883
@@ -114,6 +114,7 @@
private:
bool m_interrupted;
+ int m_progressPercent;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic