summaryrefslogtreecommitdiffstats
path: root/src/kvilib/system/kvi_locale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvilib/system/kvi_locale.cpp')
-rw-r--r--src/kvilib/system/kvi_locale.cpp206
1 files changed, 103 insertions, 103 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"),