diff options
Diffstat (limited to 'src/modules/dcc/libkvidcc.cpp')
-rw-r--r-- | src/modules/dcc/libkvidcc.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/modules/dcc/libkvidcc.cpp b/src/modules/dcc/libkvidcc.cpp index 50717e77..3cb5a7c7 100644 --- a/src/modules/dcc/libkvidcc.cpp +++ b/src/modules/dcc/libkvidcc.cpp @@ -73,9 +73,9 @@ static void dcc_module_set_dcc_type(KviDccDescriptor * d,const char * szBaseType static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCommandCall *c) { - d->bIsTdcc = c->switches()->tqfind('t',"tdcc"); + d->bIsTdcc = c->switches()->find('t',"tdcc"); - KviKvsVariant * pSw = c->switches()->tqfind('m',"minimize"); + KviKvsVariant * pSw = c->switches()->find('m',"minimize"); if(pSw != 0) d->bOverrideMinimize = pSw->asBoolean(); @@ -85,7 +85,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo if(!d->console()) { // We don't need a console with -c and -n , otherwise we need it - if(!(c->switches()->tqfind('c',"connect") || c->switches()->tqfind('n',"no-ctcp"))) + if(!(c->switches()->find('c',"connect") || c->switches()->find('n',"no-ctcp"))) { delete d; c->error(__tr2qs_ctx("This window has no associated IRC context (an IRC context is required unless -c or -n are passed)","dcc")); @@ -98,7 +98,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo if(!d->console()->isConnected()) { // We don't need a connection with -c and -n , otherwise we need it - if(!(c->switches()->tqfind('c',"connect") || c->switches()->tqfind('n',"no-ctcp"))) + if(!(c->switches()->find('c',"connect") || c->switches()->find('n',"no-ctcp"))) { delete d; c->error(__tr2qs_ctx("You're not connected to a server (an active connection is required unless -c or -n are passed)","dcc")); @@ -118,10 +118,10 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo d->szLocalHost = d->console()->connection()->userInfo()->hostName(); } - if(pSw = c->switches()->tqfind('i',"ip")) + if(pSw = c->switches()->find('i',"ip")) { pSw->asString(d->szListenIp); - if(!(d->szListenIp.tqcontains('.') || d->szListenIp.tqcontains(':'))) + if(!(d->szListenIp.contains('.') || d->szListenIp.contains(':'))) { // This will magically work with the same buffer as source and dst! if(!KviNetUtils::getInterfaceAddress(d->szListenIp,d->szListenIp)) @@ -142,13 +142,13 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo d->szListenIp=tmp; } - if(pSw = c->switches()->tqfind('p',"port")) + if(pSw = c->switches()->find('p',"port")) { pSw->asString(d->szListenPort); // fixme! } else d->szListenPort = "0"; // any port is ok - if(pSw = c->switches()->tqfind('a',"fake-address")) + if(pSw = c->switches()->find('a',"fake-address")) { pSw->asString(d->szFakeIp); } @@ -160,16 +160,16 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo } } - if(pSw = c->switches()->tqfind('f',"fake-port")) + if(pSw = c->switches()->find('f',"fake-port")) { pSw->asString(d->szFakePort); } - d->bDoTimeout = (!c->switches()->tqfind('u',"unlimited")); + d->bDoTimeout = (!c->switches()->find('u',"unlimited")); #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = c->switches()->tqfind('s',"ssl"); + d->bIsSSL = c->switches()->find('s',"ssl"); #else - if(c->switches()->tqfind('s',"ssl"))c->warning(__tr2qs_ctx("This executable was built without SSL support, -s switch ignored","dcc")); + if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable was built without SSL support, -s switch ignored","dcc")); #endif return true; @@ -411,7 +411,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) if(!dcc_kvs_parse_default_parameters(d,c))return false; dcc_module_set_dcc_type(d,"CHAT"); - if(c->switches()->tqfind('z',"zero-port")) + if(c->switches()->find('z',"zero-port")) { // we want to have it reversed... add a tag and send out the request KviDccZeroPortTag * t = g_pDccBroker->addZeroPortTag(); @@ -426,9 +426,9 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) return true; } - if(c->switches()->tqfind('c',"connect")) + if(c->switches()->find('c',"connect")) { - if(!(c->switches()->tqfind('i',"ip") && c->switches()->tqfind('p',"port"))) + if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port"))) { delete d; c->error(__tr2qs_ctx("-c requires -i and -p","dcc")); @@ -443,7 +443,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) d->szIp = __tr2qs_ctx("unknown","dcc"); d->szPort = d->szIp; d->bActive = false; - d->bSendRequest = !c->switches()->tqfind('n',"no-ctcp"); + d->bSendRequest = !c->switches()->find('n',"no-ctcp"); } //c->window()->output(0,"%Q %Q %Q",&(d->szIp),&(d->szPort),&(d->szListenIp)); @@ -618,7 +618,7 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) TQString szTmp; KviKvsVariant * pSw = 0; - if(pSw = c->switches()->tqfind('g',"get")) + if(pSw = c->switches()->find('g',"get")) { d->szFileName = TQFileInfo(szFileName).fileName(); @@ -642,16 +642,16 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) d->szUser = __tr2qs_ctx("unknown","dcc"); // username is always unknown d->szHost = d->szUser; // host is always unknown d->bRecvFile = pSw != 0; - d->bNoAcks = c->switches()->tqfind('b',"blind") || c->switches()->tqfind('t',"tdcc"); + d->bNoAcks = c->switches()->find('b',"blind") || c->switches()->find('t',"tdcc"); d->bResume = false; d->bAutoAccept = pSw != 0; d->bIsIncomingAvatar = false; if(!dcc_kvs_parse_default_parameters(d,c))return false; - if(c->switches()->tqfind('c',"connect")) + if(c->switches()->find('c',"connect")) { - if(!(c->switches()->tqfind('i',"ip") && c->switches()->tqfind('p',"port"))) + if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port"))) { delete d; c->error(__tr2qs_ctx("-c requires -i and -p","dcc")); @@ -666,10 +666,10 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) d->szIp = __tr2qs_ctx("unknown","dcc"); d->szPort = d->szIp; d->bActive = false; - d->bSendRequest = !c->switches()->tqfind('n',"no-ctcp"); + d->bSendRequest = !c->switches()->find('n',"no-ctcp"); } - if(c->switches()->tqfind('g',"get")) + if(c->switches()->find('g',"get")) { dcc_module_set_dcc_type(d,"RECV"); d->triggerCreationEvent(); @@ -815,8 +815,8 @@ static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c) d->bActive = false; // we have to listen! d->bResume = false; d->bRecvFile = true; // we have to receive the file! - d->bSendRequest = !c->switches()->tqfind('n',"no-ctcp"); - d->bNoAcks = d->bIsTdcc || c->switches()->tqfind('b',"blind"); + d->bSendRequest = !c->switches()->find('n',"no-ctcp"); + d->bNoAcks = d->bIsTdcc || c->switches()->find('b',"blind"); d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend); d->bIsIncomingAvatar = g_pApp->findPendingAvatarChange(d->console(),d->szNick,d->szFileName); @@ -883,14 +883,14 @@ static bool dcc_kvs_cmd_rsend(KviKvsModuleCommandCall * c) KviDccDescriptor * d = new KviDccDescriptor(c->window()->console()); d->szNick = szTarget; d->szLocalFileName = szFileName; - d->bIsTdcc = c->switches()->tqfind('t',"tdcc"); + d->bIsTdcc = c->switches()->find('t',"tdcc"); #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = c->switches()->tqfind('s',"ssl"); + d->bIsSSL = c->switches()->find('s',"ssl"); #else - if(c->switches()->tqfind('s',"ssl"))c->warning(__tr2qs_ctx("This executable has been built without SSL support, -s switch ignored","dcc")); + if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable has been built without SSL support, -s switch ignored","dcc")); #endif //!COMPILE_SSL_SUPPORT - if(c->switches()->tqfind('z',"zero-port")) + if(c->switches()->find('z',"zero-port")) { dcc_module_set_dcc_type(d,"SEND"); d->setZeroPortRequestTag("nonempty"); // just to tag it @@ -947,7 +947,7 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c) KviTQString::cutToLast(szFileName,'/'); - if(szFileName.tqcontains(' ')) + if(szFileName.contains(' ')) { szFileName.prepend('"'); szFileName.append('"'); @@ -955,11 +955,11 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c) KviStr szDCC("GET"); #ifdef COMPILE_SSL_SUPPORT - if(c->switches()->tqfind('s',"ssl"))szDCC.prepend('S'); + if(c->switches()->find('s',"ssl"))szDCC.prepend('S'); #else - if(c->switches()->tqfind('s',"ssl"))c->warning(__tr2qs_ctx("This executable has no SSL support, -s switch ignored","dcc")); + if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable has no SSL support, -s switch ignored","dcc")); #endif - if(c->switches()->tqfind('t',"tdcc"))szDCC.prepend('T'); + if(c->switches()->find('t',"tdcc"))szDCC.prepend('T'); if(uSize == 0) { @@ -1124,7 +1124,7 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c) if(!dcc_kvs_parse_default_parameters(d,c))return false; - if(KviKvsVariant * pSR = c->switches()->tqfind('h',"sample-rate")) + if(KviKvsVariant * pSR = c->switches()->find('h',"sample-rate")) { kvs_int_t iSR; if(!pSR->asInteger(iSR)) @@ -1138,7 +1138,7 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c) d->szCodec = "adpcm"; - if(KviKvsVariant * pCodec = c->switches()->tqfind('g',"codec")) + if(KviKvsVariant * pCodec = c->switches()->find('g',"codec")) { TQString szCodec; pCodec->asString(szCodec); @@ -1151,9 +1151,9 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c) } dcc_module_set_dcc_type(d,"VOICE"); - if(c->switches()->tqfind('c',"connect")) + if(c->switches()->find('c',"connect")) { - if(!(c->switches()->tqfind('i',"ip") && c->switches()->tqfind('p',"port"))) + if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port"))) { delete d; c->error(__tr2qs_ctx("-c requires -i and -p","dcc")); @@ -1171,7 +1171,7 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c) d->szIp = __tr2qs_ctx("unknown","dcc"); d->szPort = d->szIp; d->bActive = false; - d->bSendRequest = !(c->switches()->tqfind('n',"no-ctcp")); + d->bSendRequest = !(c->switches()->find('n',"no-ctcp")); d->triggerCreationEvent(); g_pDccBroker->passiveVoiceExecute(d); @@ -1244,7 +1244,7 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) if(c->hasSwitch('i')) { c->getSwitchValue('i',d->szListenIp); - if(!(d->szListenIp.tqcontains('.') || d->szListenIp.tqcontains(':'))) + if(!(d->szListenIp.contains('.') || d->szListenIp.contains(':'))) { // This will magically work with the same buffer as source and dst! if(!kvi_getInterfaceAddress(d->szListenIp.ptr(),d->szListenIp)) @@ -1577,7 +1577,7 @@ static KviDccDescriptor * dcc_kvs_find_dcc_descriptor(const kvs_uint_t &uId,KviK c->warning(__tr2qs_ctx("The current window has no associated DCC session","dcc")); return dcc; } - dcc = KviDccDescriptor::tqfind(uId); + dcc = KviDccDescriptor::find(uId); if((!dcc) && bWarn) c->warning(__tr2qs_ctx("The specified parameter is not a valid DCC identifier","dcc")); return dcc; @@ -1615,7 +1615,7 @@ static bool dcc_kvs_cmd_abort(KviKvsModuleCommandCall * c) KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) KVSM_PARAMETERS_END(c) - KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->tqfind('q',"quiet")); + KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->find('q',"quiet")); if(dcc) { @@ -1655,11 +1655,11 @@ static bool dcc_kvs_cmd_setBandwidthLimit(KviKvsModuleCommandCall * c) KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) KVSM_PARAMETERS_END(c) - KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->tqfind('q',"quiet")); + KviDccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->find('q',"quiet")); if(dcc) { if (dcc->transfer())dcc->transfer()->setBandwidthLimit(uVal); - else if (!c->switches()->tqfind('q',"quiet"))c->warning(__tr2qs_ctx("This DCC session is not a DCC transfer session","dcc")); + else if (!c->switches()->find('q',"quiet"))c->warning(__tr2qs_ctx("This DCC session is not a DCC transfer session","dcc")); } return true; } @@ -2614,9 +2614,9 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c) ++it; } } else { - bool bWantFileUploads = szFlags.tqfind('u',false) != -1; - bool bWantFileDownloads = szFlags.tqcontains('d',false) != -1; - bool bWantChats = szFlags.tqcontains('c',false) != -1; + bool bWantFileUploads = szFlags.find('u',false) != -1; + bool bWantFileDownloads = szFlags.contains('d',false) != -1; + bool bWantChats = szFlags.contains('c',false) != -1; while(KviDccDescriptor * dcc = it.current()) { |