diff options
Diffstat (limited to 'libkdepim/weaver.cpp')
-rw-r--r-- | libkdepim/weaver.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/libkdepim/weaver.cpp b/libkdepim/weaver.cpp index fa3ea03ca..20e44df42 100644 --- a/libkdepim/weaver.cpp +++ b/libkdepim/weaver.cpp @@ -17,8 +17,8 @@ extern "C" { #include <signal.h> } -#include <qevent.h> -#include <qapplication.h> +#include <tqevent.h> +#include <tqapplication.h> #include "weaver.h" @@ -28,10 +28,10 @@ namespace ThreadWeaver { bool Debug = true; int DebugLevel = 2; - Job::Job (QObject* parent, const char* name) - : QObject (parent, name), + Job::Job (TQObject* parent, const char* name) + : TQObject (parent, name), m_finished (false), - m_mutex (new QMutex (true) ), + m_mutex (new TQMutex (true) ), m_thread (0) { } @@ -66,19 +66,19 @@ namespace ThreadWeaver { Thread *Job::thread () { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); return m_thread; } bool Job::isFinished() const { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); return m_finished; } void Job::setFinished(bool status) { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); m_finished = status; } @@ -132,7 +132,7 @@ namespace ThreadWeaver { void Job::wakeAPR () { - QMutexLocker l(m_mutex); + TQMutexLocker l(m_mutex); if ( m_wc!=0 ) { m_wc->wakeOne (); @@ -141,10 +141,10 @@ namespace ThreadWeaver { } } - const int Event::Type = QEvent::User + 1000; + const int Event::Type = TQEvent::User + 1000; Event::Event ( Action action, Thread *thread, Job *job) - : QCustomEvent ( type () ), + : TQCustomEvent ( type () ), m_action (action), m_thread (thread), m_job (job) @@ -179,7 +179,7 @@ namespace ThreadWeaver { unsigned int Thread::sm_Id; Thread::Thread (Weaver *parent) - : QThread (), + : TQThread (), m_parent ( parent ), m_id ( makeId() ) { @@ -191,8 +191,8 @@ namespace ThreadWeaver { unsigned int Thread::makeId() { - static QMutex mutex; - QMutexLocker l (&mutex); + static TQMutex mutex; + TQMutexLocker l (&mutex); return ++sm_Id; } @@ -234,19 +234,19 @@ namespace ThreadWeaver { void Thread::msleep(unsigned long msec) { - QThread::msleep(msec); + TQThread::msleep(msec); } - Weaver::Weaver(QObject* parent, const char* name, + Weaver::Weaver(TQObject* parent, const char* name, int inventoryMin, int inventoryMax) - : QObject(parent, name), + : TQObject(parent, name), m_active(0), m_inventoryMin(inventoryMin), m_inventoryMax(inventoryMax), m_shuttingDown(false), m_running (false), m_suspend (false), - m_mutex ( new QMutex(true) ) + m_mutex ( new TQMutex(true) ) { lock(); @@ -320,7 +320,7 @@ namespace ThreadWeaver { int Weaver::threads () const { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); return m_inventory.count (); } @@ -336,7 +336,7 @@ namespace ThreadWeaver { assignJobs(); } - void Weaver::enqueue (QPtrList <Job> jobs) + void Weaver::enqueue (TQPtrList <Job> jobs) { lock(); @@ -352,13 +352,13 @@ namespace ThreadWeaver { bool Weaver::dequeue ( Job* job ) { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); return m_assignments.remove (job); } void Weaver::dequeue () { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); m_assignments.clear(); } @@ -389,9 +389,9 @@ namespace ThreadWeaver { m_jobAvailable.wakeAll(); } - bool Weaver::event (QEvent *e ) + bool Weaver::event (TQEvent *e ) { - if ( e->type() >= QEvent::User ) + if ( e->type() >= TQEvent::User ) { if ( e->type() == Event::type() ) @@ -438,19 +438,19 @@ namespace ThreadWeaver { return true; } else { // others - please make sure we are a QObject! - return QObject::event ( e ); + return TQObject::event ( e ); } } void Weaver::post (Event::Action a, Thread* t, Job* j) { Event *e = new Event ( a, t, j); - QApplication::postEvent (this, e); + TQApplication::postEvent (this, e); } bool Weaver::isEmpty() const { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); return m_assignments.count()==0; } @@ -524,13 +524,13 @@ namespace ThreadWeaver { int Weaver::queueLength() { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); return m_assignments.count(); } bool Weaver::isIdle () const { - QMutexLocker l (m_mutex); + TQMutexLocker l (m_mutex); return isEmpty() && m_active == 0; } |