From 0a80cfd57d271dd44221467efb426675fa470356 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 18:31:12 +0000 Subject: 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 --- src/modules/config/libkviconfig.cpp | 100 ++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'src/modules/config/libkviconfig.cpp') diff --git a/src/modules/config/libkviconfig.cpp b/src/modules/config/libkviconfig.cpp index 854c321b..348dbe8f 100644 --- a/src/modules/config/libkviconfig.cpp +++ b/src/modules/config/libkviconfig.cpp @@ -31,7 +31,7 @@ #include "kvi_pointerhashtable.h" -static KviPointerHashTable * g_pConfigDict = 0; +static KviPointerHashTable * g_pConfigDict = 0; static int g_iNextConfigId = 0; /* @@ -82,8 +82,8 @@ static int g_iNextConfigId = 0; static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) { - QString szFile; - QString szMode; + TQString szFile; + TQString szMode; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("filename",KVS_PT_STRING,0,szFile) @@ -92,25 +92,25 @@ static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) KviConfig::FileMode fileMode; - if(szMode.contains('r')) + if(szMode.tqcontains('r')) { - if(szMode.contains('w'))fileMode = KviConfig::ReadWrite; + if(szMode.tqcontains('w'))fileMode = KviConfig::ReadWrite; else fileMode = KviConfig::Read; } else { - if(szMode.contains('w'))fileMode = KviConfig::Write; + if(szMode.tqcontains('w'))fileMode = KviConfig::Write; else fileMode = KviConfig::ReadWrite; } KviFileUtils::adjustFilePath(szFile); - QString szAbsFile; + TQString szAbsFile; if(KviFileUtils::isAbsolutePath(szFile))szAbsFile = szFile; else g_pApp->getLocalKvircDirectory(szAbsFile,KviApp::ConfigScripts,szFile,true); - KviPointerHashTableIterator it(*g_pConfigDict); + KviPointerHashTableIterator it(*g_pConfigDict); while(it.current()) { - if(KviQString::equalCI(it.current()->fileName(),szAbsFile)) + if(KviTQString::equalCI(it.current()->fileName(),szAbsFile)) { c->returnValue()->setString(it.currentKey()); if(it.current()->readOnly() && (fileMode & KviConfig::Write)) @@ -124,7 +124,7 @@ static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) KviConfig * cfg = new KviConfig(szAbsFile,fileMode); g_iNextConfigId++; - QString tmp = QString("%1").arg(g_iNextConfigId); + TQString tmp = TQString("%1").tqarg(g_iNextConfigId); g_pConfigDict->insert(tmp,cfg); c->returnValue()->setString(tmp); return true; @@ -150,7 +150,7 @@ static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_id(KviKvsModuleFunctionCall * c) { - QString szFile; + TQString szFile; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("file",KVS_PT_STRING,0,szFile) @@ -158,15 +158,15 @@ static bool config_kvs_fnc_id(KviKvsModuleFunctionCall * c) KviFileUtils::adjustFilePath(szFile); - QString szAbsFile; + TQString szAbsFile; if(KviFileUtils::isAbsolutePath(szFile))szAbsFile = szFile; else g_pApp->getLocalKvircDirectory(szAbsFile,KviApp::ConfigScripts,szFile,true); - KviPointerHashTableIterator it(*g_pConfigDict); + KviPointerHashTableIterator it(*g_pConfigDict); while(it.current()) { - if(KviQString::equalCI(it.current()->fileName(),szAbsFile)) + if(KviTQString::equalCI(it.current()->fileName(),szAbsFile)) { c->returnValue()->setString(it.currentKey()); return true; @@ -201,9 +201,9 @@ static bool config_kvs_fnc_id(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_read(KviKvsModuleFunctionCall * c) { - QString szId; - QString szKey; - QString szDefault; + TQString szId; + TQString szKey; + TQString szDefault; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) @@ -211,7 +211,7 @@ static bool config_kvs_fnc_read(KviKvsModuleFunctionCall * c) KVSM_PARAMETER("default",KVS_PT_STRING,KVS_PF_OPTIONAL,szDefault) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -241,13 +241,13 @@ static bool config_kvs_fnc_read(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_section(KviKvsModuleFunctionCall * c) { - QString szId; + TQString szId; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -279,13 +279,13 @@ static bool config_kvs_fnc_section(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_readonly(KviKvsModuleFunctionCall * c) { - QString szId; + TQString szId; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -317,13 +317,13 @@ static bool config_kvs_fnc_readonly(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_filename(KviKvsModuleFunctionCall * c) { - QString szId; + TQString szId; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -352,15 +352,15 @@ static bool config_kvs_fnc_filename(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_hassection(KviKvsModuleFunctionCall * c) { - QString szId; - QString szSect; + TQString szId; + TQString szSect; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETER("id",KVS_PT_STRING,0,szSect) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -390,13 +390,13 @@ static bool config_kvs_fnc_hassection(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_sectionlist(KviKvsModuleFunctionCall * c) { - QString szId; + TQString szId; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -434,17 +434,17 @@ static bool config_kvs_fnc_sectionlist(KviKvsModuleFunctionCall * c) static bool config_kvs_fnc_keylist(KviKvsModuleFunctionCall * c) { - QString szId; + TQString szId; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { - KviConfigGroup * d = cfg->dict()->find(cfg->group()); + KviConfigGroup * d = cfg->dict()->tqfind(cfg->group()); if(!d)return true; KviConfigGroupIterator it(*d); @@ -488,7 +488,7 @@ static bool config_kvs_fnc_filelist(KviKvsModuleFunctionCall * c) KviKvsArray* pArray = new KviKvsArray(); int id=0; - KviPointerHashTableIterator it(*g_pConfigDict); + KviPointerHashTableIterator it(*g_pConfigDict); while(it.current()) { pArray->set(id++, new KviKvsVariant(it.currentKey())); @@ -523,12 +523,12 @@ static bool config_kvs_fnc_filelist(KviKvsModuleFunctionCall * c) static bool config_kvs_cmd_close(KviKvsModuleCommandCall * c) { - QString szId; + TQString szId; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -570,12 +570,12 @@ static bool config_kvs_cmd_close(KviKvsModuleCommandCall * c) static bool config_kvs_cmd_flush(KviKvsModuleCommandCall * c) { - QString szId; + TQString szId; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -614,12 +614,12 @@ static bool config_kvs_cmd_flush(KviKvsModuleCommandCall * c) static bool config_kvs_cmd_clear(KviKvsModuleCommandCall * c) { - QString szId; + TQString szId; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -656,14 +656,14 @@ static bool config_kvs_cmd_clear(KviKvsModuleCommandCall * c) static bool config_kvs_cmd_clearsection(KviKvsModuleCommandCall * c) { - QString szId; - QString szSect; + TQString szId; + TQString szSect; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETER("section",KVS_PT_STRING,0,szSect) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -703,9 +703,9 @@ static bool config_kvs_cmd_clearsection(KviKvsModuleCommandCall * c) static bool config_kvs_cmd_write(KviKvsModuleCommandCall * c) { - QString szId; - QString szKey; - QString szVal; + TQString szId; + TQString szKey; + TQString szVal; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) @@ -713,7 +713,7 @@ static bool config_kvs_cmd_write(KviKvsModuleCommandCall * c) KVSM_PARAMETER("value",KVS_PT_STRING,0,szVal) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -748,15 +748,15 @@ static bool config_kvs_cmd_write(KviKvsModuleCommandCall * c) static bool config_kvs_cmd_setsection(KviKvsModuleCommandCall * c) { - QString szId; - QString szSect; + TQString szId; + TQString szSect; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) KVSM_PARAMETER("section",KVS_PT_STRING,0,szSect) KVSM_PARAMETERS_END(c) - KviConfig * cfg = g_pConfigDict->find(szId); + KviConfig * cfg = g_pConfigDict->tqfind(szId); if(cfg) { @@ -829,7 +829,7 @@ static bool config_kvs_cmd_setsection(KviKvsModuleCommandCall * c) static bool config_module_init(KviModule * m) { - g_pConfigDict = new KviPointerHashTable; + g_pConfigDict = new KviPointerHashTable; g_pConfigDict->setAutoDelete(true); KVSM_REGISTER_FUNCTION(m,"open",config_kvs_fnc_open); -- cgit v1.2.1