aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qtconcurrent
diff options
context:
space:
mode:
authorcon <[email protected]>2009-12-09 15:30:23 +0100
committercon <[email protected]>2009-12-09 15:31:01 +0100
commit3ab0a28cca0c20baa4b21a3d08223065a1e3be94 (patch)
tree2e3fabc7b0771aa279230e1001ae9345189441e3 /src/libs/qtconcurrent
parent9097149ceea07d96716ca9d3ddbb32ec1b933a61 (diff)
Less use of slow methods.
Diffstat (limited to 'src/libs/qtconcurrent')
-rw-r--r--src/libs/qtconcurrent/multitask.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libs/qtconcurrent/multitask.h b/src/libs/qtconcurrent/multitask.h
index 56349ee5da0..a867f2559f6 100644
--- a/src/libs/qtconcurrent/multitask.h
+++ b/src/libs/qtconcurrent/multitask.h
@@ -95,7 +95,7 @@ public:
loop->exec();
futureInterface.reportFinished();
QThreadPool::globalInstance()->reserveThread();
- qDeleteAll(watchers.values());
+ qDeleteAll(watchers);
delete selfWatcher;
delete loop;
}
@@ -113,8 +113,7 @@ protected:
if (finished.contains(watcher))
finished[watcher] = true;
bool allFinished = true;
- const QList<bool> finishedValues = finished.values();
- foreach (bool isFinished, finishedValues) {
+ foreach (bool isFinished, finished) {
if (!isFinished) {
allFinished = false;
break;
@@ -146,8 +145,7 @@ private:
void updateProgress()
{
int progressSum = 0;
- const QList<QFutureWatcher<R> *> watchersValues = watchers.values();
- foreach (QFutureWatcher<R> *watcher, watchersValues) {
+ foreach (QFutureWatcher<R> *watcher, watchers) {
if (watcher->progressMinimum() == watcher->progressMaximum()) {
if (watcher->future().isFinished() && !watcher->future().isCanceled())
progressSum += 100;
@@ -161,8 +159,7 @@ private:
void updateProgressText()
{
QString text;
- const QList<QFutureWatcher<R> *> watchersValues = watchers.values();
- foreach (QFutureWatcher<R> *watcher, watchersValues) {
+ foreach (QFutureWatcher<R> *watcher, watchers) {
if (!watcher->progressText().isEmpty())
text += watcher->progressText() + "\n";
}