summaryrefslogtreecommitdiffstats
path: root/src/modules/perlcore/libkviperlcore.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/modules/perlcore/libkviperlcore.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/modules/perlcore/libkviperlcore.cpp')
-rw-r--r--src/modules/perlcore/libkviperlcore.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/modules/perlcore/libkviperlcore.cpp b/src/modules/perlcore/libkviperlcore.cpp
index a9196219..4325ccda 100644
--- a/src/modules/perlcore/libkviperlcore.cpp
+++ b/src/modules/perlcore/libkviperlcore.cpp
@@ -72,7 +72,7 @@
static KviKvsRunTimeContext * g_pCurrentKvsContext = 0;
static bool g_bExecuteQuiet = false;
static KviStr g_szLastReturnValue("");
- static QStringList g_lWarningList;
+ static TQStringList g_lWarningList;
#include "xs.inc"
#endif // COMPILE_PERL_SUPPORT
@@ -92,21 +92,21 @@
class KviPerlInterpreter
{
public:
- KviPerlInterpreter(const QString &szContextName);
+ KviPerlInterpreter(const TQString &szContextName);
~KviPerlInterpreter();
protected:
- QString m_szContextName;
+ TQString m_szContextName;
PerlInterpreter * m_pInterpreter;
public:
bool init(); // if this fails then well.. :D
void done();
- bool execute(const QString &szCode,QStringList &args,QString &szRetVal,QString &szError,QStringList &lWarnings);
- const QString & contextName(){ return m_szContextName; };
+ bool execute(const TQString &szCode,TQStringList &args,TQString &szRetVal,TQString &szError,TQStringList &lWarnings);
+ const TQString & contextName(){ return m_szContextName; };
protected:
- QString svToQString(SV * sv);
+ TQString svToTQString(SV * sv);
};
-KviPerlInterpreter::KviPerlInterpreter(const QString &szContextName)
+KviPerlInterpreter::KviPerlInterpreter(const TQString &szContextName)
{
m_szContextName = szContextName;
m_pInterpreter = 0;
@@ -156,7 +156,7 @@ bool KviPerlInterpreter::init()
perl_construct(m_pInterpreter);
char * daArgs[] = { "yo", "-e", "0", "-w" };
perl_parse(m_pInterpreter,xs_init,4,daArgs,NULL);
- QString szInitCode;
+ TQString szInitCode;
// this part of the code seems to be unnecessary
// even if it is created by the perl make process...
@@ -169,7 +169,7 @@ bool KviPerlInterpreter::init()
// declaration could be dropped as well...
// I just haven't tried :D
- KviQString::sprintf(
+ KviTQString::sprintf(
szInitCode,
"{\n" \
"package KVIrc;\n" \
@@ -202,9 +202,9 @@ void KviPerlInterpreter::done()
m_pInterpreter = 0;
}
-QString KviPerlInterpreter::svToQString(SV * sv)
+TQString KviPerlInterpreter::svToTQString(SV * sv)
{
- QString ret = "";
+ TQString ret = "";
if(!sv)return ret;
STRLEN len;
char * ptr = SvPV(sv,len);
@@ -213,11 +213,11 @@ QString KviPerlInterpreter::svToQString(SV * sv)
}
bool KviPerlInterpreter::execute(
- const QString &szCode,
- QStringList &args,
- QString &szRetVal,
- QString &szError,
- QStringList &lWarnings)
+ const TQString &szCode,
+ TQStringList &args,
+ TQString &szRetVal,
+ TQString &szError,
+ TQStringList &lWarnings)
{
if(!m_pInterpreter)
{
@@ -227,7 +227,7 @@ bool KviPerlInterpreter::execute(
g_lWarningList.clear();
- KviQCString szUtf8 = szCode.utf8();
+ KviTQCString szUtf8 = szCode.utf8();
PERL_SET_CONTEXT(m_pInterpreter);
// clear the _ array
@@ -244,9 +244,9 @@ bool KviPerlInterpreter::execute(
// set the args in the _ arry
av_unshift(pArgs,(I32)args.count());
int idx = 0;
- for(QStringList::Iterator it = args.begin();it != args.end();++it)
+ for(TQStringList::Iterator it = args.begin();it != args.end();++it)
{
- QString tmp = *it;
+ TQString tmp = *it;
const char * val = tmp.utf8().data();
if(val)
{
@@ -275,7 +275,7 @@ bool KviPerlInterpreter::execute(
if(pRet)
{
if(SvOK(pRet))
- szRetVal = svToQString(pRet);
+ szRetVal = svToTQString(pRet);
}
if(!g_lWarningList.isEmpty())
@@ -287,7 +287,7 @@ bool KviPerlInterpreter::execute(
{
if(SvOK(pRet))
{
- szError = svToQString(pRet);
+ szError = svToTQString(pRet);
if(!szError.isEmpty())return false;
}
}
@@ -295,11 +295,11 @@ bool KviPerlInterpreter::execute(
return true;
}
-static KviPointerHashTable<QString,KviPerlInterpreter> * g_pInterpreters = 0;
+static KviPointerHashTable<TQString,KviPerlInterpreter> * g_pInterpreters = 0;
-static KviPerlInterpreter * perlcore_get_interpreter(const QString &szContextName)
+static KviPerlInterpreter * perlcore_get_interpreter(const TQString &szContextName)
{
- KviPerlInterpreter * i = g_pInterpreters->find(szContextName);
+ KviPerlInterpreter * i = g_pInterpreters->tqfind(szContextName);
if(i)return i;
i = new KviPerlInterpreter(szContextName);
if(!i->init())
@@ -307,13 +307,13 @@ static KviPerlInterpreter * perlcore_get_interpreter(const QString &szContextNam
delete i;
return 0;
}
- g_pInterpreters->replace(szContextName,i);
+ g_pInterpreters->tqreplace(szContextName,i);
return i;
}
-static void perlcore_destroy_interpreter(const QString &szContextName)
+static void perlcore_destroy_interpreter(const TQString &szContextName)
{
- KviPerlInterpreter * i = g_pInterpreters->find(szContextName);
+ KviPerlInterpreter * i = g_pInterpreters->tqfind(szContextName);
if(!i)return;
g_pInterpreters->remove(szContextName);
i->done();
@@ -322,7 +322,7 @@ static void perlcore_destroy_interpreter(const QString &szContextName)
static void perlcore_destroy_all_interpreters()
{
- KviPointerHashTableIterator<QString,KviPerlInterpreter> it(*g_pInterpreters);
+ KviPointerHashTableIterator<TQString,KviPerlInterpreter> it(*g_pInterpreters);
while(it.current())
{
@@ -376,7 +376,7 @@ static bool perlcore_module_ctrl(KviModule * m,const char * cmd,void * param)
static bool perlcore_module_init(KviModule * m)
{
#ifdef COMPILE_PERL_SUPPORT
- g_pInterpreters = new KviPointerHashTable<QString,KviPerlInterpreter>(17,false);
+ g_pInterpreters = new KviPointerHashTable<TQString,KviPerlInterpreter>(17,false);
g_pInterpreters->setAutoDelete(false);
return true;
#else // !COMPILE_PERL_SUPPORT