Commit 0dfcfdac authored by Casper Boemann's avatar Casper Boemann

bye bye Q3*


svn path=/trunk/koffice/; revision=542296
parent 91c32ab0
......@@ -31,7 +31,6 @@
#include <QMap>
#include <QPainter>
#include <QPixmap>
#include <q3pointarray.h>
#include <QRect>
#include <QString>
#include <QVector>
......
......@@ -19,7 +19,6 @@
#define KIS_DATAMANAGER_H_
#include <qglobal.h>
#include <q3valuevector.h>
#include <QRect>
class KoStore;
......
......@@ -32,7 +32,6 @@
#include <QMap>
#include <QPainter>
#include <QPixmap>
#include <q3pointarray.h>
#include <QRect>
#include <QString>
......
......@@ -31,7 +31,6 @@
#include <QMap>
#include <QPainter>
#include <QPixmap>
#include <q3pointarray.h>
#include <QRect>
#include <QString>
......
......@@ -24,7 +24,6 @@
#include <QImage>
#include <QPainter>
#include <QSize>
#include <q3tl.h>
#include <QApplication>
#include <QThread>
#include <QDateTime>
......
......@@ -20,7 +20,6 @@
#include <QObject>
#include <QString>
#include <q3valuevector.h>
#include <QMutex>
#include <config.h>
......
......@@ -36,7 +36,6 @@
#include <QMap>
#include <QPainter>
#include <QPixmap>
#include <q3pointarray.h>
#include <QRect>
#include <QString>
......
......@@ -187,7 +187,7 @@ void KisSelection::paintUniformSelectionRegion(QImage img, const QRect& imageRec
if (!region.isEmpty()) {
QVector<QRect> rects = region.rects();
for (unsigned int i = 0; i < rects.count(); i++) {
for (int i = 0; i < rects.count(); i++) {
QRect r = rects[i];
for (qint32 y = 0; y < r.height(); ++y) {
......
......@@ -46,35 +46,38 @@ KisThreadPool::~KisThreadPool()
m_canceled = true;
m_runningThreads.setAutoDelete(true);
m_threads.setAutoDelete(true);
m_oldThreads.setAutoDelete(true);
KisThread * t;
for ( t = m_threads.first(); t; t = m_threads.next()) {
if (t) {
t->cancel();
t->wait();
m_threads.remove(t);
}
QMutableListIterator<KisThread *> i (m_threads);
while(i.hasNext())
{
t= i.next();
t->cancel();
t->wait();
i.remove();
delete t;
}
for ( t = m_runningThreads.first(); t; t = m_runningThreads.next()) {
if (t) {
t->cancel();
t->wait();
m_runningThreads.remove(t);
}
i = m_runningThreads;
while(i.hasNext())
{
t= i.next();
t->cancel();
t->wait();
i.remove();
delete t;
}
for ( t = m_oldThreads.first(); t; t = m_oldThreads.next()) {
if (t) {
t->cancel();
t->wait();
m_runningThreads.remove(t);
}
i = m_oldThreads;
while(i.hasNext())
{
t= i.next();
t->cancel();
t->wait();
i.remove();
delete t;
}
KisThreadPool::m_singleton = 0;
m_poolMutex.unlock();
......@@ -115,20 +118,20 @@ void KisThreadPool::dequeue(KisThread * thread)
m_poolMutex.lock();
int i = m_threads.findRef(thread);
int i = m_threads.indexOf(thread);
if (i >= 0) {
t = m_threads.take(i);
t = m_threads.takeAt(i);
m_numberOfQueuedThreads--;
} else {
i = m_runningThreads.findRef(thread);
i = m_runningThreads.indexOf(thread);
if (i >= 0) {
t = m_runningThreads.take(i);
t = m_runningThreads.takeAt(i);
m_numberOfRunningThreads--;
}
else {
i = m_oldThreads.findRef(thread);
i = m_oldThreads.indexOf(thread);
if (i >= 0) {
t = m_oldThreads.take(i);
t = m_oldThreads.takeAt(i);
}
}
}
......@@ -152,7 +155,7 @@ void KisThreadPool::run()
KisThread * thread = 0;
m_poolMutex.lock();
if (m_threads.count() > 0) {
thread = m_threads.take();
thread = m_threads.takeFirst();
m_numberOfQueuedThreads--;
}
if (thread) {
......@@ -165,10 +168,13 @@ void KisThreadPool::run()
else {
msleep(m_wait);
m_poolMutex.lock();
for ( KisThread * t = m_runningThreads.first(); t; t = m_runningThreads.next()) {
QMutableListIterator<KisThread *> i (m_runningThreads);
while(i.hasNext())
{
KisThread *t = i.next();
if (t) {
if (t->isFinished()) {
m_runningThreads.remove(t);
i.remove();
m_numberOfRunningThreads--;
m_oldThreads.append(t);
}
......
......@@ -20,7 +20,7 @@
#define KIS_THREAD_POOL_
#include <QThread>
#include <q3ptrlist.h>
#include <QList>
#include <QMutex>
#include "kis_thread.h"
......@@ -59,9 +59,9 @@ private:
int m_numberOfQueuedThreads;
int m_maxThreads;
int m_wait;
Q3PtrList<KisThread> m_threads;
Q3PtrList<KisThread> m_runningThreads;
Q3PtrList<KisThread> m_oldThreads;
QList<KisThread *> m_threads;
QList<KisThread *> m_runningThreads;
QList<KisThread *> m_oldThreads;
static KisThreadPool * m_singleton;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment