summaryrefslogtreecommitdiffstats
path: root/src/kvilib/system
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
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')
-rw-r--r--src/kvilib/system/kvi_locale.cpp206
-rw-r--r--src/kvilib/system/kvi_locale.h57
-rw-r--r--src/kvilib/system/kvi_process.h6
-rw-r--r--src/kvilib/system/kvi_stdarg.h2
-rw-r--r--src/kvilib/system/kvi_thread.cpp32
-rw-r--r--src/kvilib/system/kvi_thread.h35
-rw-r--r--src/kvilib/system/kvi_time.cpp18
-rw-r--r--src/kvilib/system/kvi_time.h4
-rw-r--r--src/kvilib/system/moc_kvi_locale.cpp80
-rw-r--r--src/kvilib/system/moc_kvi_thread.cpp92
10 files changed, 267 insertions, 265 deletions
diff --git a/src/kvilib/system/kvi_locale.cpp b/src/kvilib/system/kvi_locale.cpp
index f49eabe4..296db7be 100644
--- a/src/kvilib/system/kvi_locale.cpp
+++ b/src/kvilib/system/kvi_locale.cpp
@@ -33,12 +33,12 @@
#define _KVI_LOCALE_CPP_
#include "kvi_locale.h"
-#include <qglobal.h> //for debug()
-#include <qtextcodec.h>
-#include <qdir.h>
+#include <tqglobal.h> //for debug()
+#include <tqtextcodec.h>
+#include <tqdir.h>
#ifdef COMPILE_USE_QT4
- #include <qlocale.h>
+ #include <tqlocale.h>
#endif
#include "kvi_string.h"
@@ -53,7 +53,7 @@ KVILIB_API KviMessageCatalogue * g_pMainCatalogue = 0;
static KviStr g_szLang;
static KviTranslator * g_pTranslator = 0;
static KviPointerHashTable<const char *,KviMessageCatalogue> * g_pCatalogueDict = 0;
-static QTextCodec * g_pUtf8TextCodec = 0;
+static TQTextCodec * g_pUtf8TextCodec = 0;
/////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -271,27 +271,27 @@ static bool g_utf8_validate (const char *str,
///////////////////////////////////////////////////////////////////////////////////////////////
-class KviSmartTextCodec : public QTextCodec
+class KviSmartTextCodec : public TQTextCodec
{
protected:
- KviQCString m_szName;
- QTextCodec * m_pRecvCodec;
- QTextCodec * m_pSendCodec;
+ KviTQCString m_szName;
+ TQTextCodec * m_pRecvCodec;
+ TQTextCodec * m_pSendCodec;
public:
KviSmartTextCodec(const char * szName,const char * szChildCodecName,bool bSendInUtf8)
- : QTextCodec()
+ : TQTextCodec()
{
m_szName = szName;
if(!g_pUtf8TextCodec)
{
- g_pUtf8TextCodec = QTextCodec::codecForName("UTF-8");
+ g_pUtf8TextCodec = TQTextCodec::codecForName("UTF-8");
if(!g_pUtf8TextCodec)
{
debug("Can't find the global utf8 text codec!");
- g_pUtf8TextCodec = QTextCodec::codecForLocale(); // try anything else...
+ g_pUtf8TextCodec = TQTextCodec::codecForLocale(); // try anything else...
}
}
- m_pRecvCodec = QTextCodec::codecForName(szChildCodecName);
+ m_pRecvCodec = TQTextCodec::codecForName(szChildCodecName);
if(!m_pRecvCodec)
{
debug("Can't find the codec for name %s (composite codec creation)",szName);
@@ -308,13 +308,13 @@ public:
virtual int mibEnum () const { return 0; };
#ifdef COMPILE_USE_QT4
- virtual QByteArray name() const { return m_szName; };
+ virtual TQByteArray name() const { return m_szName; };
protected:
- virtual QByteArray convertFromUnicode(const QChar * input,int number,ConverterState * state) const
+ virtual TQByteArray convertFromUnicode(const TQChar * input,int number,ConverterState * state) const
{
return m_pSendCodec->fromUnicode(input,number,state);
}
- virtual QString convertToUnicode(const char * chars,int len,ConverterState * state) const
+ virtual TQString convertToUnicode(const char * chars,int len,ConverterState * state) const
{
if(g_utf8_validate(chars,len,NULL))return g_pUtf8TextCodec->toUnicode(chars,len,state);
return m_pRecvCodec->toUnicode(chars,len,state);
@@ -323,43 +323,43 @@ protected:
public:
virtual const char * mimeName () const { return m_pRecvCodec->mimeName(); };
virtual const char * name () const { return m_szName.data(); };
- virtual QTextDecoder * makeDecoder () const { return m_pRecvCodec->makeDecoder(); };
- virtual QTextEncoder * makeEncoder () const { return m_pSendCodec->makeEncoder(); };
- QCString fromUnicode (const QString & uc) const { return m_pSendCodec->fromUnicode(uc); };
- virtual QCString fromUnicode (const QString & uc,int & lenInOut) const { return m_pSendCodec->fromUnicode(uc,lenInOut); };
- QString toUnicode(const char * chars) const
+ virtual TQTextDecoder * makeDecoder () const { return m_pRecvCodec->makeDecoder(); };
+ virtual TQTextEncoder * makeEncoder () const { return m_pSendCodec->makeEncoder(); };
+ TQCString fromUnicode (const TQString & uc) const { return m_pSendCodec->fromUnicode(uc); };
+ virtual TQCString fromUnicode (const TQString & uc,int & lenInOut) const { return m_pSendCodec->fromUnicode(uc,lenInOut); };
+ TQString toUnicode(const char * chars) const
{
if(g_utf8_validate(chars,-1,NULL))return g_pUtf8TextCodec->toUnicode(chars);
return m_pRecvCodec->toUnicode(chars);
};
- virtual QString toUnicode(const char * chars,int len) const
+ virtual TQString toUnicode(const char * chars,int len) const
{
if(g_utf8_validate(chars,len,NULL))return g_pUtf8TextCodec->toUnicode(chars,len);
return m_pRecvCodec->toUnicode(chars,len);
};
- QString toUnicode(const QByteArray & a,int len) const
+ TQString toUnicode(const TQByteArray & a,int len) const
{
if(g_utf8_validate(a.data(),len,NULL))return g_pUtf8TextCodec->toUnicode(a,len);
return m_pRecvCodec->toUnicode(a,len);
};
- QString toUnicode(const QByteArray & a) const
+ TQString toUnicode(const TQByteArray & a) const
{
if(g_utf8_validate(a.data(),a.size(),NULL))return g_pUtf8TextCodec->toUnicode(a);
return m_pRecvCodec->toUnicode(a);
};
- QString toUnicode(const QCString & a,int len) const
+ TQString toUnicode(const TQCString & a,int len) const
{
if(g_utf8_validate(a.data(),len,NULL))return g_pUtf8TextCodec->toUnicode(a,len);
return m_pRecvCodec->toUnicode(a,len);
};
- QString toUnicode(const QCString & a) const
+ TQString toUnicode(const TQCString & a) const
{
if(g_utf8_validate(a.data(),-1,NULL))return g_pUtf8TextCodec->toUnicode(a);
return m_pRecvCodec->toUnicode(a);
};
- virtual bool canEncode(QChar ch) const { return m_pSendCodec->canEncode(ch); };
- virtual bool canEncode(const QString &s) const { return m_pSendCodec->canEncode(s); };
+ virtual bool canEncode(TQChar ch) const { return m_pSendCodec->canEncode(ch); };
+ virtual bool canEncode(const TQString &s) const { return m_pSendCodec->canEncode(s); };
virtual int heuristicContentMatch(const char * chars,int len) const
{
int iii = g_pUtf8TextCodec->heuristicContentMatch(chars,len);
@@ -474,7 +474,7 @@ int kvi_getFirstBiggerPrime(int number)
KviMessageCatalogue::KviMessageCatalogue()
{
//m_uEncoding = 0;
- m_pTextCodec = QTextCodec::codecForLocale();
+ m_pTextCodec = TQTextCodec::codecForLocale();
//m_pMessages = new KviPointerHashTable<const char *,KviTranslationEntry>(1123,true,false); // dictSize, case sensitive , don't copy keys
m_pMessages = new KviPointerHashTable<const char *,KviTranslationEntry>(32,true,false); // dictSize, case sensitive , don't copy keys
@@ -487,15 +487,15 @@ KviMessageCatalogue::~KviMessageCatalogue()
delete m_pMessages;
}
-bool KviMessageCatalogue::load(const QString& name)
+bool KviMessageCatalogue::load(const TQString& name)
{
- QString szCatalogueFile(name);
+ TQString szCatalogueFile(name);
// Try to load the header
KviFile f(szCatalogueFile);
if(!f.openForReading())
{
- debug("[KviLocale]: Failed to open the messages file %s: probably doesn't exist",KviQString::toUtf8(szCatalogueFile).data());
+ debug("[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 QString& name)
if(f.readBlock((char *)&hdr,sizeof(GnuMoFileHeader)) < (int)sizeof(GnuMoFileHeader))
{
- debug("KviLocale: Failed to read header of %s",KviQString::toUtf8(szCatalogueFile).data());
+ debug("KviLocale: Failed to read header of %s",KviTQString::toUtf8(szCatalogueFile).data());
f.close();
return false;
}
@@ -514,10 +514,10 @@ bool KviMessageCatalogue::load(const QString& name)
{
if(hdr.magic == KVI_LOCALE_MAGIC_SWAPPED)
{
- debug("KviLocale: Swapped magic for file %s: swapping data too",KviQString::toUtf8(szCatalogueFile).data());
+ debug("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 ?",KviQString::toUtf8(szCatalogueFile).data());
+ debug("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 QString& name)
if(KVI_SWAP_IF_NEEDED(bMustSwap,hdr.revision) != MO_REVISION_NUMBER)
{
- debug("KviLocale: Invalid *.mo file revision number for file %s",KviQString::toUtf8(szCatalogueFile).data());
+ debug("KviLocale: Invalid *.mo file revision number for file %s",KviTQString::toUtf8(szCatalogueFile).data());
f.close();
return false;
}
@@ -534,7 +534,7 @@ bool KviMessageCatalogue::load(const QString& name)
if(numberOfStrings <= 0)
{
- debug("KviLocale: No translated messages found in file %s",KviQString::toUtf8(szCatalogueFile).data());
+ debug("KviLocale: No translated messages found in file %s",KviTQString::toUtf8(szCatalogueFile).data());
f.close();
return false;
}
@@ -554,7 +554,7 @@ bool KviMessageCatalogue::load(const QString& name)
// FIXME: maybe read it in blocks eh ?
if(f.readBlock(buffer,fSize) < (int)fSize)
{
- debug("KviLocale: Error while reading the translation file %s",KviQString::toUtf8(szCatalogueFile).data());
+ debug("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 QString& name)
// Check for broken *.mo files
if(fSize < (24 + (sizeof(GnuMoStringDescriptor) * numberOfStrings)))
{
- debug("KviLocale: Broken translation file %s (too small for all descriptors)",KviQString::toUtf8(szCatalogueFile).data());
+ debug("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 QString& name)
if(fSize < (unsigned int)expectedFileSize)
{
- debug("KviLocale: Broken translation file %s (too small for all the message strings)",KviQString::toUtf8(szCatalogueFile).data());
+ debug("KviLocale: Broken translation file %s (too small for all the message strings)",KviTQString::toUtf8(szCatalogueFile).data());
kvi_free(buffer);
f.close();
return false;
@@ -609,7 +609,7 @@ bool KviMessageCatalogue::load(const QString& name)
KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].length));
// In some (or all?) *.mo files the first string
- // is zero bytes long and the translated one contains
+ // is zero bytes long and the translated one tqcontains
// informations about the translation
if(e->m_szKey.len() == 0)
{
@@ -629,7 +629,7 @@ bool KviMessageCatalogue::load(const QString& name)
// find out the text encoding , if possible
if(szHeader.hasData())
{
- // find "charset=*\n"
+ // tqfind "charset=*\n"
int idx = szHeader.findFirstIdx("charset=");
if(idx != -1)
{
@@ -641,7 +641,7 @@ bool KviMessageCatalogue::load(const QString& name)
{
debug("Can't find the codec for charset=%s",szHeader.ptr());
debug("Falling back to codecForLocale()");
- m_pTextCodec = QTextCodec::codecForLocale();
+ m_pTextCodec = TQTextCodec::codecForLocale();
}
}
}
@@ -650,7 +650,7 @@ bool KviMessageCatalogue::load(const QString& name)
{
debug("The message catalogue does not have a \"charset\" header");
debug("Assuming utf8"); // FIXME: or codecForLocale() ?
- m_pTextCodec = QTextCodec::codecForName("UTF-8");
+ m_pTextCodec = TQTextCodec::codecForName("UTF-8");
}
return true;
@@ -658,25 +658,25 @@ bool KviMessageCatalogue::load(const QString& name)
const char * KviMessageCatalogue::translate(const char *text)
{
- KviTranslationEntry * aux = m_pMessages->find(text);
+ KviTranslationEntry * aux = m_pMessages->tqfind(text);
if(aux)return aux->m_szEncodedTranslation.ptr();
return text;
}
-const QString & KviMessageCatalogue::translateToQString(const char *text)
+const TQString & KviMessageCatalogue::translateToTQString(const char *text)
{
- KviTranslationEntry * aux = m_pMessages->find(text);
+ KviTranslationEntry * aux = m_pMessages->tqfind(text);
if(aux)
{
- if(aux->m_pQTranslation)return *(aux->m_pQTranslation);
- aux->m_pQTranslation = new QString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr()));
- return *(aux->m_pQTranslation);
+ if(aux->m_pTQTranslation)return *(aux->m_pTQTranslation);
+ aux->m_pTQTranslation = new TQString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr()));
+ return *(aux->m_pTQTranslation);
}
// no translation is available: let's avoid continous string decoding
aux = new KviTranslationEntry(text);
m_pMessages->insert(aux->m_szKey.ptr(),aux);
- aux->m_pQTranslation = new QString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr()));
- return *(aux->m_pQTranslation);
+ aux->m_pTQTranslation = new TQString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr()));
+ return *(aux->m_pTQTranslation);
}
@@ -684,7 +684,7 @@ const QString & KviMessageCatalogue::translateToQString(const char *text)
namespace KviLocale
{
-#ifndef QT_NO_BIG_CODECS
+#ifndef TQT_NO_BIG_CODECS
#define NUM_ENCODINGS 109
#else
#define NUM_ENCODINGS 85
@@ -717,7 +717,7 @@ namespace KviLocale
{ "CP-1255" , 0 , 0 , "Hebrew, CP" },
{ "CP-1254" , 0 , 0 , "Turkish, CP" },
{ "TIS-620" , 0 , 0 , "Thai" },
-#ifndef QT_NO_BIG_CODECS
+#ifndef TQT_NO_BIG_CODECS
{ "Big5" , 0 , 0 , "Chinese Traditional" },
{ "Big5-HKSCS" , 0 , 0 , "Chinese Traditional, Hong Kong" },
{ "GB18030" , 0 , 0 , "Chinese Simplified" },
@@ -757,7 +757,7 @@ namespace KviLocale
{ "CP-1255 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Hebrew, CP, O: Hebrew, CP" },
{ "CP-1254 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Turkish, CP, O: Turkish, CP" },
{ "TIS-620 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Thai, O: Thai" },
-#ifndef QT_NO_BIG_CODECS
+#ifndef TQT_NO_BIG_CODECS
{ "Big5 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Traditional, O: Chinese Traditional" },
{ "Big5-HKSCS [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Traditional, Hong Kong, O: Chinese Traditional, Hong Kong" },
{ "GB18030 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Simplified, O: Chinese Simplified" },
@@ -802,7 +802,7 @@ namespace KviLocale
{ "UTF-8 [CP-1254]" , 1 , 1 , "I: 8-bit Unicode / Turkish, CP, O: 8-bit Unicode" },
{ "UTF-8 [TIS-620]" , 1 , 1 , "I: 8-bit Unicode / Thai, O: 8-bit Unicode" },
-#ifndef QT_NO_BIG_CODECS
+#ifndef TQT_NO_BIG_CODECS
{ "UTF-8 [Big5]" , 1 , 1 , "I: 8-bit Unicode / Chinese Traditional, O: 8-bit Unicode" },
{ "UTF-8 [Big5-HKSCS]" , 1 , 1 , "I: 8-bit Unicode / Chinese Traditional, Hong Kong, O: 8-bit Unicode" },
@@ -831,14 +831,14 @@ namespace KviLocale
return &(supported_encodings[iIdx]);
}
- QTextCodec * codecForName(const char * szName)
+ TQTextCodec * codecForName(const char * szName)
{
KviStr szTmp = szName;
int idx = szTmp.findFirstIdx('[');
if(idx != -1)
{
// composite codec: either UTF-8 [child codec] or child codec [UTF-8]
- KviSmartTextCodec * c = g_pSmartCodecDict->find(szName);
+ KviSmartTextCodec * c = g_pSmartCodecDict->tqfind(szName);
if(c)return c;
@@ -855,13 +855,13 @@ namespace KviLocale
}
if(c->ok())
{
- g_pSmartCodecDict->replace(szName,c);
+ g_pSmartCodecDict->tqreplace(szName,c);
return c;
} else {
delete c;
}
}
- return QTextCodec::codecForName(szName);
+ return TQTextCodec::codecForName(szName);
}
const KviStr & localeName()
@@ -869,12 +869,12 @@ namespace KviLocale
return g_szLang;
}
- bool loadCatalogue(const QString &name,const QString &szLocaleDir)
+ bool loadCatalogue(const TQString &name,const TQString &szLocaleDir)
{
//debug("Looking up catalogue %s",name);
- if(g_pCatalogueDict->find(KviQString::toUtf8(name).data()))return true; // already loaded
+ if(g_pCatalogueDict->tqfind(KviTQString::toUtf8(name).data()))return true; // already loaded
- QString szBuffer;
+ TQString szBuffer;
if(findCatalogue(szBuffer,name,szLocaleDir))
{
@@ -882,27 +882,27 @@ namespace KviLocale
if(c->load(szBuffer))
{
//debug("KviLocale: loaded catalogue %s",name);
- g_pCatalogueDict->insert(KviQString::toUtf8(name).data(),c);
+ g_pCatalogueDict->insert(KviTQString::toUtf8(name).data(),c);
return true;
}
}
return false;
}
- bool unloadCatalogue(const QString &name)
+ bool unloadCatalogue(const TQString &name)
{
//debug("Unloading catalogue : %s",name);
- return g_pCatalogueDict->remove(KviQString::toUtf8(name).data());
+ return g_pCatalogueDict->remove(KviTQString::toUtf8(name).data());
}
- bool findCatalogue(QString &szBuffer,const QString& name,const QString& szLocaleDir)
+ bool findCatalogue(TQString &szBuffer,const TQString& name,const TQString& szLocaleDir)
{
KviStr szLocale = g_szLang;
- QString szLocDir = szLocaleDir;
- KviQString::ensureLastCharIs(szLocDir,KVI_PATH_SEPARATOR_CHAR);
+ TQString szLocDir = szLocaleDir;
+ KviTQString::ensureLastCharIs(szLocDir,KVI_PATH_SEPARATOR_CHAR);
- KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr());
if(KviFileUtils::fileExists(szBuffer))return true;
@@ -912,7 +912,7 @@ namespace KviLocale
// kill them
szLocale.cutFromFirst('.');
- KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr());
if(KviFileUtils::fileExists(szBuffer))return true;
}
@@ -921,7 +921,7 @@ namespace KviLocale
// things like @euro ?
// kill them
szLocale.cutFromFirst('@');
- KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr());
if(KviFileUtils::fileExists(szBuffer))return true;
}
@@ -930,13 +930,13 @@ namespace KviLocale
// things like en_GB
// kill them
szLocale.cutFromFirst('_');
- KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr());
if(KviFileUtils::fileExists(szBuffer))return true;
}
// try the lower case version too
szLocale.toLower();
- KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%TQ_%s.mo",&szLocDir,&name,szLocale.ptr());
if(KviFileUtils::fileExists(szBuffer))return true;
return false;
@@ -952,26 +952,26 @@ namespace KviLocale
// translation map was sucesfully loaded
//
- void init(QApplication * app,const QString &localeDir)
+ void init(TQApplication * app,const TQString &localeDir)
{
// first of all try to find out the current locale
g_szLang="";
#ifdef COMPILE_USE_QT4
- QString szLangFile=QString("%1/.kvirc_force_locale").arg(QDir::homePath());
+ TQString szLangFile=TQString("%1/.kvirc_force_locale").tqarg(TQDir::homePath());
#else
- QString szLangFile=QString("%1/.kvirc_force_locale").arg(QDir::homeDirPath());
+ TQString szLangFile=TQString("%1/.kvirc_force_locale").tqarg(TQDir::homeDirPath());
#endif
if(KviFileUtils::fileExists(szLangFile))
{
- QString szTmp;
+ TQString szTmp;
KviFileUtils::readFile(szLangFile,szTmp);
g_szLang=szTmp;
}
if(g_szLang.isEmpty())g_szLang = kvi_getenv("KVIRC_LANG");
#ifdef COMPILE_USE_QT4
- if(g_szLang.isEmpty())g_szLang = QLocale::system().name();
+ if(g_szLang.isEmpty())g_szLang = TQLocale::system().name();
#else
- if(g_szLang.isEmpty())g_szLang = QTextCodec::locale();
+ if(g_szLang.isEmpty())g_szLang = TQTextCodec::locale();
#endif
if(g_szLang.isEmpty())g_szLang = kvi_getenv("LC_MESSAGES");
if(g_szLang.isEmpty())g_szLang = kvi_getenv("LANG");
@@ -986,17 +986,17 @@ namespace KviLocale
// the smart codec dict
g_pSmartCodecDict = new KviPointerHashTable<const char *,KviSmartTextCodec>;
- // the Qt docs explicitly state that we shouldn't delete
+ // the TQt docs explicitly state that we shouldn't delete
// the codecs by ourselves...
g_pSmartCodecDict->setAutoDelete(false);
if(g_szLang.hasData())
{
- QString szBuffer;
+ TQString szBuffer;
if(findCatalogue(szBuffer,"kvirc",localeDir))
{
g_pMainCatalogue->load(szBuffer);
- g_pTranslator = new KviTranslator(app,"kvirc_translator");
+ g_pTranslator = new KviTranslator(TQT_TQOBJECT(app),"kvirc_translator");
app->installTranslator(g_pTranslator);
} else {
KviStr szTmp = g_szLang;
@@ -1019,11 +1019,11 @@ namespace KviLocale
}
}
- //g_pTextCodec = QTextCodec::codecForLocale();
- //if(!g_pTextCodec)g_pTextCodec = QTextCodec::codecForLocale();
+ //g_pTextCodec = TQTextCodec::codecForLocale();
+ //if(!g_pTextCodec)g_pTextCodec = TQTextCodec::codecForLocale();
}
- void done(QApplication * app)
+ void done(TQApplication * app)
{
delete g_pMainCatalogue;
delete g_pCatalogueDict;
@@ -1039,9 +1039,9 @@ namespace KviLocale
}
}
- KviMessageCatalogue * getLoadedCatalogue(const QString& name)
+ KviMessageCatalogue * getLoadedCatalogue(const TQString& name)
{
- return g_pCatalogueDict->find(KviQString::toUtf8(name).data());
+ return g_pCatalogueDict->tqfind(KviTQString::toUtf8(name).data());
}
@@ -1049,7 +1049,7 @@ namespace KviLocale
{
if(context)
{
- KviMessageCatalogue * c = g_pCatalogueDict->find(context);
+ KviMessageCatalogue * c = g_pCatalogueDict->tqfind(context);
if(!c)
{
// FIXME: Should really try to load the catalogue here!
@@ -1061,28 +1061,28 @@ namespace KviLocale
return g_pMainCatalogue->translate(text);
}
- const QString & translateToQString(const char * text,const char * context)
+ const TQString & translateToTQString(const char * text,const char * context)
{
if(context)
{
- KviMessageCatalogue * c = g_pCatalogueDict->find(context);
+ KviMessageCatalogue * c = g_pCatalogueDict->tqfind(context);
if(!c)
{
// FIXME: Should really try to load the catalogue here!
c = new KviMessageCatalogue();
g_pCatalogueDict->insert(context,c);
}
- return c->translateToQString(text);
+ return c->translateToTQString(text);
}
- return g_pMainCatalogue->translateToQString(text);
+ return g_pMainCatalogue->translateToTQString(text);
}
};
-KviTranslator::KviTranslator(QObject * par,const char * nam)
+KviTranslator::KviTranslator(TQObject * par,const char * nam)
#ifdef COMPILE_USE_QT4
-: QTranslator(par)
+: TQTranslator(par)
#else
-: QTranslator(par,nam)
+: TQTranslator(par,nam)
#endif
{
}
@@ -1092,24 +1092,24 @@ KviTranslator::~KviTranslator()
}
#ifdef COMPILE_USE_QT4
-QString KviTranslator::translate(const char *context,const char * message,const char * comment) const
+TQString KviTranslator::translate(const char *context,const char * message,const char * comment) const
{
// we ignore contexts and comments for qt translations
- return g_pMainCatalogue->translateToQString(message);
+ return g_pMainCatalogue->translateToTQString(message);
}
#endif
-QString KviTranslator::find(const char *context,const char * message) const
+TQString KviTranslator::tqfind(const char *context,const char * message) const
{
// we ignore contexts for qt translations
- return g_pMainCatalogue->translateToQString(message);
+ return g_pMainCatalogue->translateToTQString(message);
}
#ifndef COMPILE_USE_QT4
-QTranslatorMessage KviTranslator::findMessage(const char * context,const char * sourceText,const char * comment) const
+TQTranslatorMessage KviTranslator::findMessage(const char * context,const char * sourceText,const char * comment) const
{
// we ignore contexts for qt translations
- return QTranslatorMessage(context,sourceText,comment,g_pMainCatalogue->translateToQString(sourceText));
+ return TQTranslatorMessage(context,sourceText,comment,g_pMainCatalogue->translateToTQString(sourceText));
}
#endif
@@ -1118,7 +1118,7 @@ QTranslatorMessage KviTranslator::findMessage(const char * context,const char *
// a fake table that will force these translations
// to be included in the *.pot file
-static QString fake_translations_table[]=
+static TQString fake_translations_table[]=
{
// global
__tr2qs("OK"),
diff --git a/src/kvilib/system/kvi_locale.h b/src/kvilib/system/kvi_locale.h
index bc3ed8eb..27b666b7 100644
--- a/src/kvilib/system/kvi_locale.h
+++ b/src/kvilib/system/kvi_locale.h
@@ -31,9 +31,9 @@
#include "kvi_string.h"
#include "kvi_pointerhashtable.h"
-#include <qapplication.h>
+#include <tqapplication.h>
-class QTextCodec;
+class TQTextCodec;
class KviMessageCatalogue;
namespace KviLocale
@@ -49,16 +49,16 @@ namespace KviLocale
// you MUST start iterating from 0 and terminate when
// you get an entry with a NULL szName
KVILIB_API EncodingDescription * encodingDescription(int iIdx);
- KVILIB_API QTextCodec * codecForName(const char * szName);
+ KVILIB_API TQTextCodec * codecForName(const char * szName);
KVILIB_API const KviStr & localeName();
- KVILIB_API bool findCatalogue(QString &szBuffer,const QString& name,const QString& szLocaleDir);
- KVILIB_API bool loadCatalogue(const QString& name,const QString& szLocaleDir);
- KVILIB_API KviMessageCatalogue * getLoadedCatalogue(const QString& name);
- KVILIB_API bool unloadCatalogue(const QString& name);
- KVILIB_API void init(QApplication * app,const QString& localeDir);
- KVILIB_API void done(QApplication * app);
+ KVILIB_API bool findCatalogue(TQString &szBuffer,const TQString& name,const TQString& szLocaleDir);
+ KVILIB_API bool loadCatalogue(const TQString& name,const TQString& szLocaleDir);
+ KVILIB_API KviMessageCatalogue * getLoadedCatalogue(const TQString& name);
+ KVILIB_API bool unloadCatalogue(const TQString& name);
+ KVILIB_API void init(TQApplication * app,const TQString& localeDir);
+ KVILIB_API void done(TQApplication * app);
KVILIB_API const char * translate(const char * text,const char * context);
- KVILIB_API const QString & translateToQString(const char * text,const char * context);
+ KVILIB_API const TQString & translateToTQString(const char * text,const char * context);
};
// not exported
@@ -67,23 +67,23 @@ class KviTranslationEntry
public:
KviStr m_szKey;
KviStr m_szEncodedTranslation;
- QString * m_pQTranslation;
+ TQString * m_pTQTranslation;
public:
KviTranslationEntry(char * keyptr,int keylen,char * trptr,int trlen)
: m_szKey(keyptr,keylen) , m_szEncodedTranslation(trptr,trlen)
{
- m_pQTranslation = 0;
+ m_pTQTranslation = 0;
}
KviTranslationEntry(const char * keyandtr)
: m_szKey(keyandtr) , m_szEncodedTranslation(keyandtr)
{
- m_pQTranslation = 0;
+ m_pTQTranslation = 0;
}
~KviTranslationEntry()
{
- if(m_pQTranslation)delete m_pQTranslation;
+ if(m_pTQTranslation)delete m_pTQTranslation;
}
};
@@ -96,11 +96,11 @@ public:
protected:
//KviPointerHashTable<const char *,KviTranslationEntry> * m_pMessages;
KviPointerHashTable<const char *,KviTranslationEntry> * m_pMessages;
- QTextCodec * m_pTextCodec;
+ TQTextCodec * m_pTextCodec;
public:
- bool load(const QString& name);
+ bool load(const TQString& name);
const char * translate(const char * text);
- const QString & translateToQString(const char * text);
+ const TQString & translateToTQString(const char * text);
};
#ifndef _KVI_LOCALE_CPP_
@@ -111,34 +111,35 @@ public:
#define __tr_no_lookup(__text__) __text__
#define __tr_no_xgettext(__text__) g_pMainCatalogue->translate(__text__)
-#define __tr2qs(__text__) g_pMainCatalogue->translateToQString(__text__)
-#define __tr2qs_no_xgettext(__text__) g_pMainCatalogue->translateToQString(__text__)
+#define __tr2qs(__text__) g_pMainCatalogue->translateToTQString(__text__)
+#define __tr2qs_no_xgettext(__text__) g_pMainCatalogue->translateToTQString(__text__)
#define __tr_ctx(__text__,__context__) KviLocale::translate(__text__,__context__)
#define __tr_no_lookup_ctx(__text__,__context__) __text__
#define __tr_no_xgettext_ctx(__text__,__context__) KviLocale::translate(__text__,__context__)
-#define __tr2qs_ctx(__text__,__context__) KviLocale::translateToQString(__text__,__context__)
-#define __tr2qs_ctx_no_xgettext(__text__,__context__) KviLocale::translateToQString(__text__,__context__)
+#define __tr2qs_ctx(__text__,__context__) KviLocale::translateToTQString(__text__,__context__)
+#define __tr2qs_ctx_no_xgettext(__text__,__context__) KviLocale::translateToTQString(__text__,__context__)
#define __tr2qs_no_lookup(__text__) __text__
-#include <qtranslator.h>
-#include <qstring.h>
+#include <tqtranslator.h>
+#include <tqstring.h>
-class KVILIB_API KviTranslator : public QTranslator
+class KVILIB_API KviTranslator : public TQTranslator
{
Q_OBJECT
+ TQ_OBJECT
public:
- KviTranslator(QObject * parent,const char * name);
+ KviTranslator(TQObject * tqparent,const char * name);
~KviTranslator();
public:
#ifdef COMPILE_USE_QT4
- virtual QString translate(const char * context,const char * message,const char * comment) const;
+ virtual TQString translate(const char * context,const char * message,const char * comment) const;
#endif
// Deprecated in qt 4.x
- virtual QString find(const char * context,const char * message) const;
+ virtual TQString tqfind(const char * context,const char * message) const;
#ifndef COMPILE_USE_QT4
// Dead in qt 4.x
- virtual QTranslatorMessage findMessage(const char * context,const char * sourceText,const char * comment = 0) const;
+ virtual TQTranslatorMessage findMessage(const char * context,const char * sourceText,const char * comment = 0) const;
#endif
};
diff --git a/src/kvilib/system/kvi_process.h b/src/kvilib/system/kvi_process.h
index ea2275dc..649e40d7 100644
--- a/src/kvilib/system/kvi_process.h
+++ b/src/kvilib/system/kvi_process.h
@@ -27,11 +27,11 @@
#include "kvi_settings.h"
#ifdef COMPILE_USE_QT4
- #include <q3process.h>
+ #include <tq3process.h>
#define KviProcess Q3Process
#else
- #include <qprocess.h>
- #define KviProcess QProcess
+ #include <tqprocess.h>
+ #define KviProcess TQProcess
#endif
#endif //!_KVI_PROCESS_H_
diff --git a/src/kvilib/system/kvi_stdarg.h b/src/kvilib/system/kvi_stdarg.h
index 15c5e078..659e7a70 100644
--- a/src/kvilib/system/kvi_stdarg.h
+++ b/src/kvilib/system/kvi_stdarg.h
@@ -34,7 +34,7 @@
// kvi_va_start_by_reference should be used when the last known argument
// is a reference type and not a pointer
//
-// int SomeClass::sprintf(const QString &fmt,...)
+// int SomeClass::sprintf(const TQString &fmt,...)
// {
// kvi_va_list list;
// kvi_va_start_by_reference(list,fmt);
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);
diff --git a/src/kvilib/system/kvi_thread.h b/src/kvilib/system/kvi_thread.h
index bd6dab3b..f024505f 100644
--- a/src/kvilib/system/kvi_thread.h
+++ b/src/kvilib/system/kvi_thread.h
@@ -26,11 +26,11 @@
#include "kvi_heapobject.h"
#include "kvi_string.h"
-#include <qnamespace.h>
-#include <qobject.h>
-#include <qsocketnotifier.h>
+#include <tqnamespace.h>
+#include <tqobject.h>
+#include <tqsocketnotifier.h>
#include "kvi_pointerlist.h"
-#include <qevent.h>
+#include <tqevent.h>
//
@@ -181,7 +181,7 @@ private:
bool m_bRunning;
bool m_bStartingUp;
KviMutex * m_pRunningMutex;
- KviPointerList<QEvent> * m_pLocalEventQueue;
+ KviPointerList<TQEvent> * m_pLocalEventQueue;
public:
// public KviThread interface
// HANDLE WITH CARE
@@ -215,14 +215,14 @@ protected:
void exit();
// The tricky part: threadsafe event dispatching
// Slave thread -> main thread objects
- void postEvent(QObject *o,QEvent *e);
+ void postEvent(TQObject *o,TQEvent *e);
private:
void setRunning(bool bRunning);
void setStartingUp(bool bStartingUp);
};
-// QEvent::Type for Thread events
-#define KVI_THREAD_EVENT (((int)QEvent::User) + 2000)
+// TQEvent::Type for Thread events
+#define KVI_THREAD_EVENT (((int)TQEvent::User) + 2000)
// CONSTANTS FOR KviThreadEvent::eventId();
@@ -261,14 +261,14 @@ private:
// #warning "Get rid of the m_szMessage member of KviThreadEvent : eventual data should be passed with a KviThreadDataEvent"
// Base class for all thread events
-class KVILIB_API KviThreadEvent : public QEvent, public KviHeapObject
+class KVILIB_API KviThreadEvent : public TQEvent, public KviHeapObject
{
protected:
int m_eventId;
KviThread * m_pSender;
public:
KviThreadEvent(int evId,KviThread * sender = 0)
- : QEvent((QEvent::Type)KVI_THREAD_EVENT) , m_eventId(evId) , m_pSender(sender) {};
+ : TQEvent((TQEvent::Type)KVI_THREAD_EVENT) , m_eventId(evId) , m_pSender(sender) {};
virtual ~KviThreadEvent(){};
public:
// This is the sender of the event
@@ -329,25 +329,26 @@ protected:
typedef struct _KviThreadPendingEvent
{
- QObject *o;
- QEvent *e;
+ TQObject *o;
+ TQEvent *e;
} KviThreadPendingEvent;
-class KVILIB_API KviThreadManager : public QObject
+class KVILIB_API KviThreadManager : public TQObject
{
friend class KviApp;
friend class KviThread;
Q_OBJECT
+ TQ_OBJECT
protected:
// These should be private...but we don't want anyone to complain
// Treat as private plz.
KviThreadManager();
~KviThreadManager();
public:
- static void killPendingEvents(QObject * receiver);
+ static void killPendingEvents(TQObject * receiver);
private:
#ifndef COMPILE_ON_WINDOWS
- QSocketNotifier * m_pSn;
+ TQSocketNotifier * m_pSn;
#endif
KviMutex * m_pMutex; // This class performs only atomic operations
KviPointerList<KviThread> * m_pThreadList;
@@ -365,8 +366,8 @@ protected:
void threadEnteredWaitState();
void threadLeftWaitState();
- void postSlaveEvent(QObject *o,QEvent *e);
- void killPendingEventsByReceiver(QObject * receiver);
+ void postSlaveEvent(TQObject *o,TQEvent *e);
+ void killPendingEventsByReceiver(TQObject * receiver);
// Public to KviApp only
static void globalInit();
static void globalDestroy();
diff --git a/src/kvilib/system/kvi_time.cpp b/src/kvilib/system/kvi_time.cpp
index f500b7d4..a61b3e76 100644
--- a/src/kvilib/system/kvi_time.cpp
+++ b/src/kvilib/system/kvi_time.cpp
@@ -93,11 +93,11 @@ namespace KviTimeUtils
*uS = uSecs % 60;
}
- QString formatTimeInterval(unsigned int uSeconds,int iFlags)
+ TQString formatTimeInterval(unsigned int uSeconds,int iFlags)
{
unsigned int d,h,m,s;
secondsToDaysHoursMinsSecs(uSeconds,&d,&h,&m,&s);
- QString ret;
+ TQString ret;
// the following tricks maybe will help translators a bit...
if(iFlags & FillWithHypens)
{
@@ -108,25 +108,25 @@ namespace KviTimeUtils
if(h > 0)
{
if(iFlags & NoLeadingZeroes)
- KviQString::sprintf(ret,__tr2qs("%u h %u m %u s"),h,m,s);
+ KviTQString::sprintf(ret,__tr2qs("%u h %u m %u s"),h,m,s);
else
- KviQString::sprintf(ret,__tr2qs("%u h %u%u m %u%u s"),h,m / 10,m % 10,s / 10,s % 10);
+ KviTQString::sprintf(ret,__tr2qs("%u h %u%u m %u%u s"),h,m / 10,m % 10,s / 10,s % 10);
} else {
if(m > 0)
{
if(iFlags & NoLeadingZeroes)
- KviQString::sprintf(ret,__tr2qs("%u m %u s"),m,s);
+ KviTQString::sprintf(ret,__tr2qs("%u m %u s"),m,s);
else
- KviQString::sprintf(ret,__tr2qs("%u m %u%u s"),m,s / 10,s % 10);
+ KviTQString::sprintf(ret,__tr2qs("%u m %u%u s"),m,s / 10,s % 10);
} else {
- KviQString::sprintf(ret,__tr2qs("%u s"),s);
+ KviTQString::sprintf(ret,__tr2qs("%u s"),s);
}
}
} else {
if(iFlags & NoLeadingZeroes)
- KviQString::sprintf(ret,__tr2qs("%u d %u h %u m %u s"),d,h,m,s);
+ KviTQString::sprintf(ret,__tr2qs("%u d %u h %u m %u s"),d,h,m,s);
else
- KviQString::sprintf(ret,__tr2qs("%u d %u%u h %u%u m %u%u s"),d,h / 10,h % 10,m / 10,m % 10,s / 10,s % 10);
+ KviTQString::sprintf(ret,__tr2qs("%u d %u%u h %u%u m %u%u s"),d,h / 10,h % 10,m / 10,m % 10,s / 10,s % 10);
}
}
return ret;
diff --git a/src/kvilib/system/kvi_time.h b/src/kvilib/system/kvi_time.h
index 309eec10..67997e30 100644
--- a/src/kvilib/system/kvi_time.h
+++ b/src/kvilib/system/kvi_time.h
@@ -26,7 +26,7 @@
//=============================================================================
#include "kvi_settings.h"
-#include <qstring.h>
+#include <tqstring.h>
#include <time.h> // for time()
@@ -86,7 +86,7 @@ namespace KviTimeUtils
NoLeadingZeroes = 2, // no leading zeroes are printed in hours and seconds
FillWithHypens = 4 // uses only -- %d -- %h -- etc.. discards all other flags
};
- KVILIB_API QString formatTimeInterval(unsigned int uSeconds,int iFlags = 0);
+ KVILIB_API TQString formatTimeInterval(unsigned int uSeconds,int iFlags = 0);
};
#endif //_KVI_TIME_H_
diff --git a/src/kvilib/system/moc_kvi_locale.cpp b/src/kvilib/system/moc_kvi_locale.cpp
index 52e2ae22..5d31d72a 100644
--- a/src/kvilib/system/moc_kvi_locale.cpp
+++ b/src/kvilib/system/moc_kvi_locale.cpp
@@ -2,21 +2,21 @@
** KviTranslator meta object code from reading C++ file 'kvi_locale.h'
**
** Created: Sun Mar 23 20:56:24 2008
-** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
+** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
-#undef QT_NO_COMPAT
+#undef TQT_NO_COMPAT
#include "kvi_locale.h"
-#include <qmetaobject.h>
-#include <qapplication.h>
+#include <tqmetaobject.h>
+#include <tqapplication.h>
-#include <private/qucomextra_p.h>
-#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
-#error "This file was generated using the moc from 3.3.8. It"
-#error "cannot be used with the include files from this version of Qt."
-#error "(The moc has changed too much.)"
+#include <private/tqucomextra_p.h>
+#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26)
+#error "This file was generated using the tqmoc from 3.3.8. It"
+#error "cannot be used with the include files from this version of TQt."
+#error "(The tqmoc has changed too much.)"
#endif
const char *KviTranslator::className() const
@@ -24,69 +24,69 @@ const char *KviTranslator::className() const
return "KviTranslator";
}
-QMetaObject *KviTranslator::metaObj = 0;
-static QMetaObjectCleanUp cleanUp_KviTranslator( "KviTranslator", &KviTranslator::staticMetaObject );
+TQMetaObject *KviTranslator::metaObj = 0;
+static TQMetaObjectCleanUp cleanUp_KviTranslator( "KviTranslator", &KviTranslator::staticMetaObject );
-#ifndef QT_NO_TRANSLATION
-QString KviTranslator::tr( const char *s, const char *c )
+#ifndef TQT_NO_TRANSLATION
+TQString KviTranslator::tr( const char *s, const char *c )
{
- if ( qApp )
- return qApp->translate( "KviTranslator", s, c, QApplication::DefaultCodec );
+ if ( tqApp )
+ return tqApp->translate( "KviTranslator", s, c, TQApplication::DefaultCodec );
else
- return QString::fromLatin1( s );
+ return TQString::tqfromLatin1( s );
}
-#ifndef QT_NO_TRANSLATION_UTF8
-QString KviTranslator::trUtf8( const char *s, const char *c )
+#ifndef TQT_NO_TRANSLATION_UTF8
+TQString KviTranslator::trUtf8( const char *s, const char *c )
{
- if ( qApp )
- return qApp->translate( "KviTranslator", s, c, QApplication::UnicodeUTF8 );
+ if ( tqApp )
+ return tqApp->translate( "KviTranslator", s, c, TQApplication::UnicodeUTF8 );
else
- return QString::fromUtf8( s );
+ return TQString::fromUtf8( s );
}
-#endif // QT_NO_TRANSLATION_UTF8
+#endif // TQT_NO_TRANSLATION_UTF8
-#endif // QT_NO_TRANSLATION
+#endif // TQT_NO_TRANSLATION
-QMetaObject* KviTranslator::staticMetaObject()
+TQMetaObject* KviTranslator::staticMetaObject()
{
if ( metaObj )
return metaObj;
- QMetaObject* parentObject = QTranslator::staticMetaObject();
- metaObj = QMetaObject::new_metaobject(
- "KviTranslator", parentObject,
+ TQMetaObject* tqparentObject = TQTranslator::staticMetaObject();
+ metaObj = TQMetaObject::new_metaobject(
+ "KviTranslator", tqparentObject,
0, 0,
0, 0,
-#ifndef QT_NO_PROPERTIES
+#ifndef TQT_NO_PROPERTIES
0, 0,
0, 0,
-#endif // QT_NO_PROPERTIES
+#endif // TQT_NO_PROPERTIES
0, 0 );
cleanUp_KviTranslator.setMetaObject( metaObj );
return metaObj;
}
-void* KviTranslator::qt_cast( const char* clname )
+void* KviTranslator::tqqt_cast( const char* clname )
{
if ( !qstrcmp( clname, "KviTranslator" ) )
return this;
- return QTranslator::qt_cast( clname );
+ return TQTranslator::tqqt_cast( clname );
}
-bool KviTranslator::qt_invoke( int _id, QUObject* _o )
+bool KviTranslator::qt_invoke( int _id, TQUObject* _o )
{
- return QTranslator::qt_invoke(_id,_o);
+ return TQTranslator::qt_invoke(_id,_o);
}
-bool KviTranslator::qt_emit( int _id, QUObject* _o )
+bool KviTranslator::qt_emit( int _id, TQUObject* _o )
{
- return QTranslator::qt_emit(_id,_o);
+ return TQTranslator::qt_emit(_id,_o);
}
-#ifndef QT_NO_PROPERTIES
+#ifndef TQT_NO_PROPERTIES
-bool KviTranslator::qt_property( int id, int f, QVariant* v)
+bool KviTranslator::qt_property( int id, int f, TQVariant* v)
{
- return QTranslator::qt_property( id, f, v);
+ return TQTranslator::qt_property( id, f, v);
}
-bool KviTranslator::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
-#endif // QT_NO_PROPERTIES
+bool KviTranslator::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; }
+#endif // TQT_NO_PROPERTIES
diff --git a/src/kvilib/system/moc_kvi_thread.cpp b/src/kvilib/system/moc_kvi_thread.cpp
index 556849a9..41a824a9 100644
--- a/src/kvilib/system/moc_kvi_thread.cpp
+++ b/src/kvilib/system/moc_kvi_thread.cpp
@@ -2,21 +2,21 @@
** KviThreadManager meta object code from reading C++ file 'kvi_thread.h'
**
** Created: Sun Mar 23 20:56:25 2008
-** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
+** by: The TQt TQMOC ($Id: qt/tqmoc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
-#undef QT_NO_COMPAT
+#undef TQT_NO_COMPAT
#include "kvi_thread.h"
-#include <qmetaobject.h>
-#include <qapplication.h>
+#include <tqmetaobject.h>
+#include <tqapplication.h>
-#include <private/qucomextra_p.h>
-#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
-#error "This file was generated using the moc from 3.3.8. It"
-#error "cannot be used with the include files from this version of Qt."
-#error "(The moc has changed too much.)"
+#include <private/tqucomextra_p.h>
+#if !defined(TQ_TQMOC_OUTPUT_REVISION) || (TQ_TQMOC_OUTPUT_REVISION != 26)
+#error "This file was generated using the tqmoc from 3.3.8. It"
+#error "cannot be used with the include files from this version of TQt."
+#error "(The tqmoc has changed too much.)"
#endif
const char *KviThreadManager::className() const
@@ -24,81 +24,81 @@ const char *KviThreadManager::className() const
return "KviThreadManager";
}
-QMetaObject *KviThreadManager::metaObj = 0;
-static QMetaObjectCleanUp cleanUp_KviThreadManager( "KviThreadManager", &KviThreadManager::staticMetaObject );
+TQMetaObject *KviThreadManager::metaObj = 0;
+static TQMetaObjectCleanUp cleanUp_KviThreadManager( "KviThreadManager", &KviThreadManager::staticMetaObject );
-#ifndef QT_NO_TRANSLATION
-QString KviThreadManager::tr( const char *s, const char *c )
+#ifndef TQT_NO_TRANSLATION
+TQString KviThreadManager::tr( const char *s, const char *c )
{
- if ( qApp )
- return qApp->translate( "KviThreadManager", s, c, QApplication::DefaultCodec );
+ if ( tqApp )
+ return tqApp->translate( "KviThreadManager", s, c, TQApplication::DefaultCodec );
else
- return QString::fromLatin1( s );
+ return TQString::tqfromLatin1( s );
}
-#ifndef QT_NO_TRANSLATION_UTF8
-QString KviThreadManager::trUtf8( const char *s, const char *c )
+#ifndef TQT_NO_TRANSLATION_UTF8
+TQString KviThreadManager::trUtf8( const char *s, const char *c )
{
- if ( qApp )
- return qApp->translate( "KviThreadManager", s, c, QApplication::UnicodeUTF8 );
+ if ( tqApp )
+ return tqApp->translate( "KviThreadManager", s, c, TQApplication::UnicodeUTF8 );
else
- return QString::fromUtf8( s );
+ return TQString::fromUtf8( s );
}
-#endif // QT_NO_TRANSLATION_UTF8
+#endif // TQT_NO_TRANSLATION_UTF8
-#endif // QT_NO_TRANSLATION
+#endif // TQT_NO_TRANSLATION
-QMetaObject* KviThreadManager::staticMetaObject()
+TQMetaObject* KviThreadManager::staticMetaObject()
{
if ( metaObj )
return metaObj;
- QMetaObject* parentObject = QObject::staticMetaObject();
- static const QUParameter param_slot_0[] = {
- { "fd", &static_QUType_int, 0, QUParameter::In }
+ TQMetaObject* tqparentObject = TQObject::staticMetaObject();
+ static const TQUParameter param_slot_0[] = {
+ { "fd", &static_TQUType_int, 0, TQUParameter::In }
};
- static const QUMethod slot_0 = {"eventsPending", 1, param_slot_0 };
- static const QMetaData slot_tbl[] = {
- { "eventsPending(int)", &slot_0, QMetaData::Private }
+ static const TQUMethod slot_0 = {"eventsPending", 1, param_slot_0 };
+ static const TQMetaData slot_tbl[] = {
+ { "eventsPending(int)", &slot_0, TQMetaData::Private }
};
- metaObj = QMetaObject::new_metaobject(
- "KviThreadManager", parentObject,
+ metaObj = TQMetaObject::new_metaobject(
+ "KviThreadManager", tqparentObject,
slot_tbl, 1,
0, 0,
-#ifndef QT_NO_PROPERTIES
+#ifndef TQT_NO_PROPERTIES
0, 0,
0, 0,
-#endif // QT_NO_PROPERTIES
+#endif // TQT_NO_PROPERTIES
0, 0 );
cleanUp_KviThreadManager.setMetaObject( metaObj );
return metaObj;
}
-void* KviThreadManager::qt_cast( const char* clname )
+void* KviThreadManager::tqqt_cast( const char* clname )
{
if ( !qstrcmp( clname, "KviThreadManager" ) )
return this;
- return QObject::qt_cast( clname );
+ return TQObject::tqqt_cast( clname );
}
-bool KviThreadManager::qt_invoke( int _id, QUObject* _o )
+bool KviThreadManager::qt_invoke( int _id, TQUObject* _o )
{
switch ( _id - staticMetaObject()->slotOffset() ) {
- case 0: eventsPending((int)static_QUType_int.get(_o+1)); break;
+ case 0: eventsPending((int)static_TQUType_int.get(_o+1)); break;
default:
- return QObject::qt_invoke( _id, _o );
+ return TQObject::qt_invoke( _id, _o );
}
return TRUE;
}
-bool KviThreadManager::qt_emit( int _id, QUObject* _o )
+bool KviThreadManager::qt_emit( int _id, TQUObject* _o )
{
- return QObject::qt_emit(_id,_o);
+ return TQObject::qt_emit(_id,_o);
}
-#ifndef QT_NO_PROPERTIES
+#ifndef TQT_NO_PROPERTIES
-bool KviThreadManager::qt_property( int id, int f, QVariant* v)
+bool KviThreadManager::qt_property( int id, int f, TQVariant* v)
{
- return QObject::qt_property( id, f, v);
+ return TQObject::qt_property( id, f, v);
}
-bool KviThreadManager::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
-#endif // QT_NO_PROPERTIES
+bool KviThreadManager::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; }
+#endif // TQT_NO_PROPERTIES