diff options
author | Slávek Banko <[email protected]> | 2018-10-29 18:21:41 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2018-10-29 18:21:41 +0100 |
commit | 7cc4356bc2eceb5a66c2263bff44aa472d2ca290 (patch) | |
tree | 08047b60c477dc7026c7623e25770825b5ce7e5c /src/kvilib/system | |
parent | 3b217bbf505473102331a7e2ed274fe63a4c3457 (diff) | |
download | kvirc-7cc4356bc2eceb5a66c2263bff44aa472d2ca290.tar.gz kvirc-7cc4356bc2eceb5a66c2263bff44aa472d2ca290.zip |
Fix build with a clean TQt namespace.
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'src/kvilib/system')
-rw-r--r-- | src/kvilib/system/kvi_locale.cpp | 52 | ||||
-rw-r--r-- | src/kvilib/system/kvi_thread.cpp | 52 |
2 files changed, 52 insertions, 52 deletions
diff --git a/src/kvilib/system/kvi_locale.cpp b/src/kvilib/system/kvi_locale.cpp index 3ee2ef82..d4f89cc1 100644 --- a/src/kvilib/system/kvi_locale.cpp +++ b/src/kvilib/system/kvi_locale.cpp @@ -33,7 +33,7 @@ #define _KVI_LOCALE_CPP_ #include "kvi_locale.h" -#include <tqglobal.h> //for debug() +#include <tqglobal.h> //for tqDebug() #include <tqtextcodec.h> #include <tqdir.h> @@ -287,14 +287,14 @@ public: g_pUtf8TextCodec = TQTextCodec::codecForName("UTF-8"); if(!g_pUtf8TextCodec) { - debug("Can't find the global utf8 text codec!"); + tqDebug("Can't find the global utf8 text codec!"); g_pUtf8TextCodec = TQTextCodec::codecForLocale(); // try anything else... } } m_pRecvCodec = TQTextCodec::codecForName(szChildCodecName); if(!m_pRecvCodec) { - debug("Can't find the codec for name %s (composite codec creation)",szName); + tqDebug("Can't find the codec for name %s (composite codec creation)",szName); m_pRecvCodec = g_pUtf8TextCodec; } if(bSendInUtf8) @@ -495,7 +495,7 @@ bool KviMessageCatalogue::load(const TQString& name) KviFile f(szCatalogueFile); if(!f.openForReading()) { - debug("[KviLocale]: Failed to open the messages file %s: probably doesn't exist",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("[KviLocale]: Failed to open the messages file %s: probably doesn't exist",KviTQString::toUtf8(szCatalogueFile).data()); return false; } @@ -503,7 +503,7 @@ bool KviMessageCatalogue::load(const TQString& name) if(f.readBlock((char *)&hdr,sizeof(GnuMoFileHeader)) < (int)sizeof(GnuMoFileHeader)) { - debug("KviLocale: Failed to read header of %s",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("KviLocale: Failed to read header of %s",KviTQString::toUtf8(szCatalogueFile).data()); f.close(); return false; } @@ -514,10 +514,10 @@ bool KviMessageCatalogue::load(const TQString& name) { if(hdr.magic == KVI_LOCALE_MAGIC_SWAPPED) { - debug("KviLocale: Swapped magic for file %s: swapping data too",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("KviLocale: Swapped magic for file %s: swapping data too",KviTQString::toUtf8(szCatalogueFile).data()); bMustSwap = true; } else { - debug("KviLocale: Bad locale magic for file %s: not a *.mo file ?",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("KviLocale: Bad locale magic for file %s: not a *.mo file ?",KviTQString::toUtf8(szCatalogueFile).data()); f.close(); return false; } @@ -525,7 +525,7 @@ bool KviMessageCatalogue::load(const TQString& name) if(KVI_SWAP_IF_NEEDED(bMustSwap,hdr.revision) != MO_REVISION_NUMBER) { - debug("KviLocale: Invalid *.mo file revision number for file %s",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("KviLocale: Invalid *.mo file revision number for file %s",KviTQString::toUtf8(szCatalogueFile).data()); f.close(); return false; } @@ -534,14 +534,14 @@ bool KviMessageCatalogue::load(const TQString& name) if(numberOfStrings <= 0) { - debug("KviLocale: No translated messages found in file %s",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("KviLocale: No translated messages found in file %s",KviTQString::toUtf8(szCatalogueFile).data()); f.close(); return false; } if(numberOfStrings >= 9972) { - debug("Number of strings too big...sure that it is a KVIrc catalog file ?"); + tqDebug("Number of strings too big...sure that it is a KVIrc catalog file ?"); numberOfStrings = 9972; } @@ -554,7 +554,7 @@ bool KviMessageCatalogue::load(const TQString& name) // FIXME: maybe read it in blocks eh ? if(f.readBlock(buffer,fSize) < (int)fSize) { - debug("KviLocale: Error while reading the translation file %s",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("KviLocale: Error while reading the translation file %s",KviTQString::toUtf8(szCatalogueFile).data()); kvi_free(buffer); f.close(); return false; @@ -563,7 +563,7 @@ bool KviMessageCatalogue::load(const TQString& name) // Check for broken *.mo files if(fSize < (24 + (sizeof(GnuMoStringDescriptor) * numberOfStrings))) { - debug("KviLocale: Broken translation file %s (too small for all descriptors)",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("KviLocale: Broken translation file %s (too small for all descriptors)",KviTQString::toUtf8(szCatalogueFile).data()); kvi_free(buffer); f.close(); return false; @@ -578,7 +578,7 @@ bool KviMessageCatalogue::load(const TQString& name) if(fSize < (unsigned int)expectedFileSize) { - debug("KviLocale: Broken translation file %s (too small for all the message strings)",KviTQString::toUtf8(szCatalogueFile).data()); + tqDebug("KviLocale: Broken translation file %s (too small for all the message strings)",KviTQString::toUtf8(szCatalogueFile).data()); kvi_free(buffer); f.close(); return false; @@ -597,9 +597,9 @@ bool KviMessageCatalogue::load(const TQString& name) for(int i=0;i < numberOfStrings;i++) { // FIXME: "Check for NULL inside strings here ?" - //debug("original seems to be at %u and %u byttes long",KVI_SWAP_IF_NEEDED(bMustSwap,origDescriptor[i].offset), + //tqDebug("original seems to be at %u and %u byttes long",KVI_SWAP_IF_NEEDED(bMustSwap,origDescriptor[i].offset), // KVI_SWAP_IF_NEEDED(bMustSwap,origDescriptor[i].length)); - //debug("translated seems to be at %u and %u byttes long",KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].offset), + //tqDebug("translated seems to be at %u and %u byttes long",KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].offset), // KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].length)); KviTranslationEntry * e = new KviTranslationEntry( @@ -639,8 +639,8 @@ bool KviMessageCatalogue::load(const TQString& name) m_pTextCodec = KviLocale::codecForName(szHeader.ptr()); if(!m_pTextCodec) { - debug("Can't find the codec for charset=%s",szHeader.ptr()); - debug("Falling back to codecForLocale()"); + tqDebug("Can't find the codec for charset=%s",szHeader.ptr()); + tqDebug("Falling back to codecForLocale()"); m_pTextCodec = TQTextCodec::codecForLocale(); } } @@ -648,8 +648,8 @@ bool KviMessageCatalogue::load(const TQString& name) if(!m_pTextCodec) { - debug("The message catalogue does not have a \"charset\" header"); - debug("Assuming utf8"); // FIXME: or codecForLocale() ? + tqDebug("The message catalogue does not have a \"charset\" header"); + tqDebug("Assuming utf8"); // FIXME: or codecForLocale() ? m_pTextCodec = TQTextCodec::codecForName("UTF-8"); } @@ -871,7 +871,7 @@ namespace KviLocale bool loadCatalogue(const TQString &name,const TQString &szLocaleDir) { - //debug("Looking up catalogue %s",name); + //tqDebug("Looking up catalogue %s",name); if(g_pCatalogueDict->find(KviTQString::toUtf8(name).data()))return true; // already loaded TQString szBuffer; @@ -881,7 +881,7 @@ namespace KviLocale KviMessageCatalogue * c = new KviMessageCatalogue(); if(c->load(szBuffer)) { - //debug("KviLocale: loaded catalogue %s",name); + //tqDebug("KviLocale: loaded catalogue %s",name); g_pCatalogueDict->insert(KviTQString::toUtf8(name).data(),c); return true; } @@ -891,7 +891,7 @@ namespace KviLocale bool unloadCatalogue(const TQString &name) { - //debug("Unloading catalogue : %s",name); + //tqDebug("Unloading catalogue : %s",name); return g_pCatalogueDict->remove(KviTQString::toUtf8(name).data()); } @@ -1011,10 +1011,10 @@ namespace KviLocale kvi_strEqualCI(szTmp.ptr(),"posix"))) { // FIXME: THIS IS NO LONGER VALID!!! - debug("Can't find the catalogue for locale \"%s\" (%s)",g_szLang.ptr(),szTmp.ptr()); - debug("There is no such translation or the $LANG variable was incorrectly set"); - debug("You can use $KVIRC_LANG to override the catalogue name"); - debug("For example you can set KVIRC_LANG to it_IT to force usage of the it.mo catalogue"); + tqDebug("Can't find the catalogue for locale \"%s\" (%s)",g_szLang.ptr(),szTmp.ptr()); + tqDebug("There is no such translation or the $LANG variable was incorrectly set"); + tqDebug("You can use $KVIRC_LANG to override the catalogue name"); + tqDebug("For example you can set KVIRC_LANG to it_IT to force usage of the it.mo catalogue"); } } } diff --git a/src/kvilib/system/kvi_thread.cpp b/src/kvilib/system/kvi_thread.cpp index 02dcdc09..306f6c75 100644 --- a/src/kvilib/system/kvi_thread.cpp +++ b/src/kvilib/system/kvi_thread.cpp @@ -99,7 +99,7 @@ static void kvi_threadIgnoreSigalarm() ignr_act.sa_flags |= SA_RESTART; #endif - if(sigaction(SIGALRM,&ignr_act,0) == -1)debug("Failed to set SIG_IGN for SIGALRM."); + if(sigaction(SIGALRM,&ignr_act,0) == -1)tqDebug("Failed to set SIG_IGN for SIGALRM."); #endif #endif } @@ -108,7 +108,7 @@ static void kvi_threadIgnoreSigalarm() static void kvi_threadSigpipeHandler(int) { - debug("Thread ????: Caught SIGPIPE: ignoring."); + tqDebug("Thread ????: Caught SIGPIPE: ignoring."); } #endif @@ -133,7 +133,7 @@ static void kvi_threadCatchSigpipe() act.sa_flags |= SA_RESTART; #endif - if(sigaction(SIGPIPE,&act,0L) == -1)debug("Failed to set the handler for SIGPIPE."); + if(sigaction(SIGPIPE,&act,0L) == -1)tqDebug("Failed to set the handler for SIGPIPE."); #endif } @@ -171,7 +171,7 @@ void KviThreadManager::globalDestroy() KviThreadManager::KviThreadManager() : TQObject() { - if(g_pThreadManager)debug("Hey...what are ya doing ?"); + if(g_pThreadManager)tqDebug("Hey...what are ya doing ?"); m_pMutex = new KviMutex(); @@ -189,17 +189,17 @@ KviThreadManager::KviThreadManager() if(pipe(m_fd) != 0) { - debug("Ops...thread manager pipe creation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); + tqDebug("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)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); + tqDebug("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)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); + tqDebug("Ops...thread manager master pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); } m_pSn = new TQSocketNotifier(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],TQSocketNotifier::Read); @@ -349,7 +349,7 @@ void KviThreadManager::postSlaveEvent(TQObject *o,TQEvent *e) { // ops.. failed to write down the event.. // this is quite irritating now... - debug("Ops.. failed to write down the trigger"); + tqDebug("Ops.. failed to write down the trigger"); // FIXME: maybe a single shot timer ? } else { m_iTriggerCount++; @@ -421,7 +421,7 @@ void KviThreadManager::threadLeftWaitState() m_iWaitingThreads--; if(m_iWaitingThreads < 0) { - debug("Ops.. got a negative number of waiting threads ?"); + tqDebug("Ops.. got a negative number of waiting threads ?"); m_iWaitingThreads = 0; } m_pMutex->unlock(); @@ -462,11 +462,11 @@ KviThread::KviThread() KviThread::~KviThread() { -// debug(">> KviThread::~KviThread() : (this = %d)",this); +// tqDebug(">> KviThread::~KviThread() : (this = %d)",this); wait(); delete m_pRunningMutex; g_pThreadManager->unregisterSlaveThread(this); -// debug("<< KviThread::~KviThread() : (this = %d)",this); +// tqDebug("<< KviThread::~KviThread() : (this = %d)",this); } void KviThread::setRunning(bool bRunning) @@ -512,16 +512,16 @@ bool KviThread::start() void KviThread::wait() { // We're on the master side here...and we're waiting the slave to exit -// debug(">> KviThread::wait() (this=%d)",this); +// tqDebug(">> KviThread::wait() (this=%d)",this); while(isStartingUp())usleep(500); // sleep 500 microseconds -// debug("!! KviThread::wait() (this=%d)",this); +// tqDebug("!! KviThread::wait() (this=%d)",this); g_pThreadManager->threadEnteredWaitState(); while(isRunning()) { usleep(500); // sleep 500 microseconds } g_pThreadManager->threadLeftWaitState(); -// debug("<< KviThread::wait() (this=%d)",this); +// tqDebug("<< KviThread::wait() (this=%d)",this); } void KviThread::exit() @@ -534,13 +534,13 @@ void KviThread::exit() void KviThread::internalThreadRun_doNotTouchThis() { // we're on the slave thread here! -// debug(">> KviThread::internalRun (this=%d)",this); +// tqDebug(">> KviThread::internalRun (this=%d)",this); setRunning(true); setStartingUp(false); kvi_threadInitialize(); run(); setRunning(false); -// debug("<< KviThread::internalRun (this=%d",this); +// tqDebug("<< KviThread::internalRun (this=%d",this); } void KviThread::usleep(unsigned long usec) @@ -592,9 +592,9 @@ KviSensitiveThread::KviSensitiveThread() KviSensitiveThread::~KviSensitiveThread() { -// debug("Entering KviSensitiveThread::~KviSensitiveThread (this=%d)",this); +// tqDebug("Entering KviSensitiveThread::~KviSensitiveThread (this=%d)",this); terminate(); -// debug("KviSensitiveThread::~KviSensitiveThread : terminate called (This=%d)",this); +// tqDebug("KviSensitiveThread::~KviSensitiveThread : terminate called (This=%d)",this); m_pLocalEventQueueMutex->lock(); m_pLocalEventQueue->setAutoDelete(true); delete m_pLocalEventQueue; @@ -602,12 +602,12 @@ KviSensitiveThread::~KviSensitiveThread() m_pLocalEventQueueMutex->unlock(); delete m_pLocalEventQueueMutex; m_pLocalEventQueueMutex = 0; -// debug("Exiting KviSensitiveThread::~KviSensitiveThread (this=%d)",this); +// tqDebug("Exiting KviSensitiveThread::~KviSensitiveThread (this=%d)",this); } void KviSensitiveThread::enqueueEvent(KviThreadEvent *e) { -// debug(">>> KviSensitiveThread::enqueueEvent() (this=%d)",this); +// tqDebug(">>> KviSensitiveThread::enqueueEvent() (this=%d)",this); m_pLocalEventQueueMutex->lock(); if(!m_pLocalEventQueue) { @@ -618,27 +618,27 @@ void KviSensitiveThread::enqueueEvent(KviThreadEvent *e) } m_pLocalEventQueue->append(e); m_pLocalEventQueueMutex->unlock(); -// debug("<<< KviSensitiveThread::enqueueEvent() (this=%d)",this); +// tqDebug("<<< KviSensitiveThread::enqueueEvent() (this=%d)",this); } KviThreadEvent * KviSensitiveThread::dequeueEvent() { -// debug(">>> KviSensitiveThread::dequeueEvent() (this=%d)",this); +// tqDebug(">>> KviSensitiveThread::dequeueEvent() (this=%d)",this); KviThreadEvent * ret; m_pLocalEventQueueMutex->lock(); ret = m_pLocalEventQueue->first(); if(ret)m_pLocalEventQueue->removeFirst(); m_pLocalEventQueueMutex->unlock(); -// debug("<<< KviSensitiveThread::dequeueEvent() (this=%d)",this); +// tqDebug("<<< KviSensitiveThread::dequeueEvent() (this=%d)",this); return ret; } void KviSensitiveThread::terminate() { -// debug("Entering KviSensitiveThread::terminate (this=%d)",this); +// tqDebug("Entering KviSensitiveThread::terminate (this=%d)",this); enqueueEvent(new KviThreadEvent(KVI_THREAD_EVENT_TERMINATE)); -// debug("KviSensitiveThread::terminate() : event enqueued waiting (this=%d)",this); +// tqDebug("KviSensitiveThread::terminate() : event enqueued waiting (this=%d)",this); wait(); -// debug("Exiting KviSensitiveThread::terminate (this=%d)",this); +// tqDebug("Exiting KviSensitiveThread::terminate (this=%d)",this); } |