summaryrefslogtreecommitdiffstats
path: root/src/kvilib/system/kvi_thread.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvilib/system/kvi_thread.cpp
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvilib/system/kvi_thread.cpp')
-rw-r--r--src/kvilib/system/kvi_thread.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/kvilib/system/kvi_thread.cpp b/src/kvilib/system/kvi_thread.cpp
index e9ec3ac5..b3cb7708 100644
--- a/src/kvilib/system/kvi_thread.cpp
+++ b/src/kvilib/system/kvi_thread.cpp
@@ -47,7 +47,7 @@
#include "kvi_error.h"
-#include <qapplication.h>
+#include <tqapplication.h>
static void kvi_threadIgnoreSigalarm()
@@ -58,7 +58,7 @@ static void kvi_threadIgnoreSigalarm()
// Funky hack for some Solaris machines (maybe others ?)
// For an obscure (at least to me) reason
// when using threads ,some part of the system
- // starts kidding us by sending a SIGALRM in apparently
+ // starts kidding us by sending a SIGALRM in aptqparently
// "random" circumstances. (Xlib ?) (XServer ?)
// The default action for SIGALRM is to exit the application.
// Could not guess more about this stuff...
@@ -152,7 +152,7 @@ static void kvi_threadInitialize()
// the maximum length of the slave->master queue
// over this length , the slave is forced to usleep()
-#define KVI_THREAD_MAX_EVENT_QUEUE_LENGTH 50
+#define KVI_THREAD_MAX_EVENT_TQUEUE_LENGTH 50
static KviThreadManager * g_pThreadManager = 0;
@@ -169,7 +169,7 @@ void KviThreadManager::globalDestroy()
}
KviThreadManager::KviThreadManager()
-: QObject()
+: TQObject()
{
if(g_pThreadManager)debug("Hey...what are ya doing ?");
@@ -189,21 +189,21 @@ KviThreadManager::KviThreadManager()
if(pipe(m_fd) != 0)
{
- debug("Ops...thread manager pipe creation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
+ debug("Ops...thread manager pipe creation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
}
if(fcntl(m_fd[KVI_THREAD_PIPE_SIDE_SLAVE],F_SETFL,O_NONBLOCK) == -1)
{
- debug("Ops...thread manager slave pipe initialisation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
+ debug("Ops...thread manager slave pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
}
if(fcntl(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],F_SETFL,O_NONBLOCK) == -1)
{
- debug("Ops...thread manager master pipe initialisation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
+ debug("Ops...thread manager master pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
}
- m_pSn = new QSocketNotifier(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],QSocketNotifier::Read);
- connect(m_pSn,SIGNAL(activated(int)),this,SLOT(eventsPending(int)));
+ m_pSn = new TQSocketNotifier(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],TQSocketNotifier::Read);
+ connect(m_pSn,TQT_SIGNAL(activated(int)),this,TQT_SLOT(eventsPending(int)));
m_pSn->setEnabled(true);
#endif
}
@@ -257,7 +257,7 @@ KviThreadManager::~KviThreadManager()
// byez :)
}
-void KviThreadManager::killPendingEvents(QObject * receiver)
+void KviThreadManager::killPendingEvents(TQObject * receiver)
{
#ifndef COMPILE_ON_WINDOWS
if(!g_pThreadManager)return;
@@ -265,7 +265,7 @@ void KviThreadManager::killPendingEvents(QObject * receiver)
#endif
}
-void KviThreadManager::killPendingEventsByReceiver(QObject * receiver)
+void KviThreadManager::killPendingEventsByReceiver(TQObject * receiver)
{
#ifndef COMPILE_ON_WINDOWS
KviPointerList<KviThreadPendingEvent> l;
@@ -298,10 +298,10 @@ void KviThreadManager::unregisterSlaveThread(KviThread *t)
m_pMutex->unlock();
}
-void KviThreadManager::postSlaveEvent(QObject *o,QEvent *e)
+void KviThreadManager::postSlaveEvent(TQObject *o,TQEvent *e)
{
#ifdef COMPILE_ON_WINDOWS
- QApplication::postEvent(o,e); // we believe this to be thread-safe
+ TQApplication::postEvent(o,e); // we believe this to be thread-safe
#else
KviThreadPendingEvent * ev = new KviThreadPendingEvent;
ev->o = o;
@@ -319,7 +319,7 @@ void KviThreadManager::postSlaveEvent(QObject *o,QEvent *e)
// on the main application thread we also can't artificially process the events.
// So the solution is to skip this algorithm when at least one
// thread is in waiting state.
- while((m_pEventQueue->count() > KVI_THREAD_MAX_EVENT_QUEUE_LENGTH) && (m_iWaitingThreads < 1))
+ while((m_pEventQueue->count() > KVI_THREAD_MAX_EVENT_TQUEUE_LENGTH) && (m_iWaitingThreads < 1))
{
// wait for the master to process the queue
@@ -379,7 +379,7 @@ void KviThreadManager::eventsPending(int fd)
m_pMutex->unlock();
// let the app process the event
// DANGER !
- QApplication::postEvent(ev->o,ev->e);
+ TQApplication::postEvent(ev->o,ev->e);
// jump out of the loop if we have been destroyed
if(!g_pThreadManager)return;
@@ -574,7 +574,7 @@ void KviThread::sleep(unsigned long sec)
#endif
}
-void KviThread::postEvent(QObject * o,QEvent *e)
+void KviThread::postEvent(TQObject * o,TQEvent *e)
{
// slave side
g_pThreadManager->postSlaveEvent(o,e);