summaryrefslogtreecommitdiffstats
path: root/ksirc/ioDCC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ksirc/ioDCC.cpp')
-rw-r--r--ksirc/ioDCC.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/ksirc/ioDCC.cpp b/ksirc/ioDCC.cpp
index ff2d5022..e718a452 100644
--- a/ksirc/ioDCC.cpp
+++ b/ksirc/ioDCC.cpp
@@ -58,10 +58,10 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
// Then we look at the one time start/stop messages. They only arrive
// once in a long long time (compared to the byte messages) so if it takes
// a few extra clock cycles to find them, who cares?
- if(str.find("DCC GET read:", 0) != -1){ /*fold01*/
+ if(str.tqfind("DCC GET read:", 0) != -1){ /*fold01*/
TQRegExp rx("read: (.+) who: (.+) bytes: (.*)");
if(rx.search(str)){
- TQString key = TQString("%1/%2").arg(rx.cap(1)).arg(rx.cap(2));
+ TQString key = TQString("%1/%2").tqarg(rx.cap(1)).tqarg(rx.cap(2));
uint bytesXfer = rx.cap(3).toUInt();
//
@@ -73,10 +73,10 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
}
}
}
- else if(str.find("DCC SEND write:", 0) != -1){ /*fold01*/
+ else if(str.tqfind("DCC SEND write:", 0) != -1){ /*fold01*/
TQRegExp rx("write: (.+) who: (.+) bytes: (.*)");
if(rx.search(str)){
- TQString key = TQString("%1/%2").arg(rx.cap(1)).arg(rx.cap(2));
+ TQString key = TQString("%1/%2").tqarg(rx.cap(1)).tqarg(rx.cap(2));
uint bytesXfer = rx.cap(3).toUInt();
if(DCCSendItems[key]){
@@ -84,14 +84,14 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
}
}
}
- else if(str.find("INBOUND DCC SEND", 0) != -1){ /*FOLD01*/
+ else if(str.tqfind("INBOUND DCC SEND", 0) != -1){ /*FOLD01*/
TQRegExp rx("who: (.+) file: (.+) size: (.*) ip: (.+) port: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
TQString size = rx.cap(3);
TQString ip = rx.cap(4);
- //QSTring port = rx.cap(5);
+ //TQSTring port = rx.cap(5);
int fileSize = size.toInt(); // Bytes per step
fileSize /= 1024;
@@ -103,7 +103,7 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
this, TQT_SLOT(dccRenameDone(dccItem *, TQString, TQString)));
it->setWhoPostfix("(" + ip + ")");
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCGetItems[key]){
/*
* don't add duplicates, this cuases real headaches
@@ -113,11 +113,11 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
dccItem *old = DCCGetItems.take(key);
int i;
for(i = 0; i <= (int) DCCGetItems.count()+1; i++){
- renamed = TQString("%1 (finished %2)/%3").arg(filename).arg(i+1).arg(old->who());
+ renamed = TQString("%1 (finished %2)/%3").tqarg(filename).tqarg(i+1).tqarg(old->who());
if( DCCGetItems[renamed] == 0x0)
break;
}
- old->changeFilename(TQString("%1 (finished %2)").arg(filename).arg(i+1));
+ old->changeFilename(TQString("%1 (finished %2)").tqarg(filename).tqarg(i+1));
DCCGetItems.insert(renamed, it);
}
@@ -127,7 +127,7 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
kdDebug(5008) << "DCC SEND was unable to parse: " << str << endl;
}
}
- else if(str.find("Sent DCC SEND", 0) != -1){ /*FOLD01*/
+ else if(str.tqfind("Sent DCC SEND", 0) != -1){ /*FOLD01*/
TQRegExp rx("who: (.+) file: (.+) size: (.*)");
if(rx.search(str)){
TQString who = rx.cap(1);
@@ -139,7 +139,7 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
// setup dcc dialog
displayMgr->show(mgr);
dccItem *it = mgr->mgr()->newSendItem(filename, who, dccItem::dccSentOffer, fileSize);
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCSendItems[key]){
/*
* don't add duplicates, this cuases real headaches
@@ -151,11 +151,11 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
dccItem *old = DCCSendItems.take(key);
int i;
for(i = 0; i <= (int) DCCSendItems.count()+1; i++){
- renamed = TQString("%1 (sent %2)/%3").arg(filename).arg(i+1).arg(old->who());
+ renamed = TQString("%1 (sent %2)/%3").tqarg(filename).tqarg(i+1).tqarg(old->who());
if( DCCSendItems[renamed] == 0x0)
break;
}
- old->changeFilename(TQString("%1 (sent %2)").arg(filename).arg(i+1));
+ old->changeFilename(TQString("%1 (sent %2)").tqarg(filename).tqarg(i+1));
DCCSendItems.insert(renamed, it);
}
DCCSendItems.insert(key, it);
@@ -164,7 +164,7 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
kdDebug(5008) << "DCC SENT was unable to parse: " << str << endl;
}
}
- else if(str.find("DCC CHAT OFFERED", 0) != -1){ /*FOLD01*/
+ else if(str.tqfind("DCC CHAT OFFERED", 0) != -1){ /*FOLD01*/
TQRegExp rx("who: (.+) ip: (.+) port: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
@@ -182,7 +182,7 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
kdDebug(5008) << "DCC CHAT SEND was unable to parse: " << str << endl;
}
}
- else if(str.find("DCC CHAT SEND", 0) != -1){ /*FOLD01*/
+ else if(str.tqfind("DCC CHAT SEND", 0) != -1){ /*FOLD01*/
TQRegExp rx("who: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
@@ -198,201 +198,201 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
kdDebug(5008) << "DCC CHAT SEND was unable to parse: " << str << endl;
}
}
- else if(str.find("DCC SEND terminated") != -1){ /*FOLD01*/
+ else if(str.tqfind("DCC SEND terminated") != -1){ /*FOLD01*/
TQRegExp rx("who: (.+) file: (.+) reason: (.*)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
TQString error = rx.cap(3);
- enum dccItem::dccStatus status = dccItem::dccDone;
+ enum dccItem::dcctqStatus status = dccItem::dccDone;
if(error == "CLOSE"){
status = dccItem::dccCancel;
}
if(error != "OK"){
status = dccItem::dccError;
- KPassivePopup::message(i18n("DCC SEND with %1 for %2 failed because of %3").arg(who).arg(filename).arg(error), mgr->mgr());
+ KPassivePopup::message(i18n("DCC SEND with %1 for %2 failed because of %3").tqarg(who).tqarg(filename).tqarg(error), mgr->mgr());
}
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCSendItems[key]){
kdDebug(5008) << "SendPercent: " << DCCSendItems[key]->getPercent() << endl;
if((status == dccItem::dccDone) && (DCCSendItems[key]->getPercent() < 100))
status = dccItem::dccError;
- DCCSendItems[key]->changeStatus(status);
+ DCCSendItems[key]->changetqStatus(status);
}
}
}
- else if(str.find ("DCC GET terminated") != -1){ /*fold01*/
+ else if(str.tqfind ("DCC GET terminated") != -1){ /*fold01*/
kdDebug(5008) << "Term: " << str << endl;
TQRegExp rx("who: (.+) file: (.+) reason: (.*)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
TQString error = rx.cap(3);
- enum dccItem::dccStatus status = dccItem::dccDone;
+ enum dccItem::dcctqStatus status = dccItem::dccDone;
if(error != "OK"){
status = dccItem::dccError;
- KPassivePopup::message(i18n("DCC GET with %1 for %2 failed because of %3").arg(who).arg(filename).arg(error), mgr->mgr());
+ KPassivePopup::message(i18n("DCC GET with %1 for %2 failed because of %3").tqarg(who).tqarg(filename).tqarg(error), mgr->mgr());
}
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCGetItems[key]){
kdDebug(5008) << "GetPercent: " << DCCGetItems[key]->getPercent() << endl;
if((status == dccItem::dccDone) && (DCCGetItems[key]->getPercent() < 100))
status = dccItem::dccError;
- DCCGetItems[key]->changeStatus(status);
+ DCCGetItems[key]->changetqStatus(status);
}
}
else {
kdDebug(5008) << "DCC Get term failed to parse: " << str << endl;
}
}
- else if(str.find("DCC GET resumed") != -1){ /*fold01*/
+ else if(str.tqfind("DCC GET resumed") != -1){ /*fold01*/
TQRegExp rx("who: (.+) file: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCGetItems[key]){
dccItem *it = DCCGetItems[key];
kdDebug(5008) << "Got DCC GET resumed message..." << it->file() << endl;
if(it->status() == dccItem::dccWaitOnResume)
dccConnectClicked(it);
- it->changeStatus(dccItem::dccResumed);
+ it->changetqStatus(dccItem::dccResumed);
}
}
}
- else if(str.find("DCC SEND resumed") != -1){ /*fold01*/
+ else if(str.tqfind("DCC SEND resumed") != -1){ /*fold01*/
TQRegExp rx("who: (.+) file: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCSendItems[key]){
- DCCSendItems[key]->changeStatus(dccItem::dccResumed);
+ DCCSendItems[key]->changetqStatus(dccItem::dccResumed);
}
}
}
- else if(str.find("DCC GET established") != -1){ /*fold01*/
+ else if(str.tqfind("DCC GET established") != -1){ /*fold01*/
TQRegExp rx("who: (.+) file: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCGetItems[key]){
- DCCGetItems[key]->changeStatus(dccItem::dccRecving);
+ DCCGetItems[key]->changetqStatus(dccItem::dccRecving);
}
}
}
- else if(str.find("DCC SEND established") != -1){ /*fold01*/
+ else if(str.tqfind("DCC SEND established") != -1){ /*fold01*/
TQRegExp rx("who: (.+) file: (.+) ip: (\\S+)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
TQString ip = rx.cap(3);
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCSendItems[key]){
DCCSendItems[key]->setWhoPostfix("(" + ip + ")");
- DCCSendItems[key]->changeStatus(dccItem::dccSending);
+ DCCSendItems[key]->changetqStatus(dccItem::dccSending);
}
}
}
- else if(str.find("DCC CHAT established") != -1){ /*FOLD01*/
+ else if(str.tqfind("DCC CHAT established") != -1){ /*FOLD01*/
TQRegExp rx("who: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
if(DCCChatItems[who]){
- DCCChatItems[who]->changeStatus(dccItem::dccOpen);
+ DCCChatItems[who]->changetqStatus(dccItem::dccOpen);
proc->new_toplevel(KSircChannel(proc->serverName(), TQString("=") + who.lower()));
}
}
}
- else if(str.find("DCC CHAT inbound established") != -1){ /*FOLD01*/
+ else if(str.tqfind("DCC CHAT inbound established") != -1){ /*FOLD01*/
TQRegExp rx("who: (.+) ip: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString ip = rx.cap(2);
if(DCCChatItems[who]){
DCCChatItems[who]->setWhoPostfix("(" + ip + ")");
- DCCChatItems[who]->changeStatus(dccItem::dccOpen);
+ DCCChatItems[who]->changetqStatus(dccItem::dccOpen);
proc->new_toplevel(KSircChannel(proc->serverName(), TQString("=") + who.lower()));
}
}
}
- else if(str.find("DCC GET failed") != -1){ /*fold01*/
+ else if(str.tqfind("DCC GET failed") != -1){ /*fold01*/
TQRegExp rx("who: (.+) file: (.+) reason: (.*)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
TQString error = rx.cap(3);
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCGetItems[key]){
- DCCGetItems[key]->changeStatus(dccItem::dccError);
+ DCCGetItems[key]->changetqStatus(dccItem::dccError);
}
- KPassivePopup::message(i18n("DCC Get with %1 for %2 failed because of %3").arg(who).arg(filename).arg(error), mgr->mgr());
+ KPassivePopup::message(i18n("DCC Get with %1 for %2 failed because of %3").tqarg(who).tqarg(filename).tqarg(error), mgr->mgr());
}
}
- else if(str.find("DCC CHAT failed") != -1){ /*FOLD01*/
+ else if(str.tqfind("DCC CHAT failed") != -1){ /*FOLD01*/
TQRegExp rx("who: (.+) reason: (.*)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString error = rx.cap(2);
if(DCCChatItems[who]){
- DCCChatItems[who]->changeStatus(dccItem::dccError);
+ DCCChatItems[who]->changetqStatus(dccItem::dccError);
}
- KPassivePopup::message(i18n("DCC Chat with %1 failed because of %2").arg(who).arg(error), mgr->mgr());
+ KPassivePopup::message(i18n("DCC Chat with %1 failed because of %2").tqarg(who).tqarg(error), mgr->mgr());
}
}
- else if(str.find("DCC CHAT renamed") != -1){ /*FOLD01*/
+ else if(str.tqfind("DCC CHAT renamed") != -1){ /*FOLD01*/
TQRegExp rx("who: (.+) to: (.+)");
if(rx.search(str)){
TQString oldwho = rx.cap(1);
TQString newwho = rx.cap(2);
TQString oldwin = "=" + oldwho;
- if(proc->getWindowList().find(oldwin)){
- proc->getWindowList().find(oldwin)->control_message(CHANGE_CHANNEL,TQString("=" +newwho).lower());
+ if(proc->getWindowList().tqfind(oldwin)){
+ proc->getWindowList().tqfind(oldwin)->control_message(CHANGE_CHANNEL,TQString("=" +newwho).lower());
}
}
}
- else if(str.find("Closing DCC GET") != -1){ /*fold01*/
+ else if(str.tqfind("Closing DCC GET") != -1){ /*fold01*/
TQRegExp rx("who: (.+) file: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
- TQString key = TQString("%1/%2").arg(filename).arg(who);
+ TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
if(DCCGetItems[key]){
- DCCGetItems[key]->changeStatus(dccItem::dccCancel);
+ DCCGetItems[key]->changetqStatus(dccItem::dccCancel);
}
}
}
-// else if(str.find("Closing DCC SEND") != -1){ /*FOLD01*/
+// else if(str.tqfind("Closing DCC SEND") != -1){ /*FOLD01*/
// TQRegExp rx("who: (.+) file: (.+)");
// if(rx.search(str)){
// TQString who = rx.cap(1);
// TQString filename = rx.cap(2);
-// TQString key = TQString("%1/%2").arg(filename).arg(who);
+// TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
// if(DCCSendItems[key]){
-// DCCSendItems[key]->changeStatus(dccItem::dccCancel);
+// DCCSendItems[key]->changetqStatus(dccItem::dccCancel);
// }
// }
// }
- else if(str.find("Closing DCC CHAT") != -1){ /*fold01*/
+ else if(str.tqfind("Closing DCC CHAT") != -1){ /*fold01*/
TQRegExp rx("who: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
if(DCCChatItems[who]){
- DCCChatItems[who]->changeStatus(dccItem::dccDone);
+ DCCChatItems[who]->changetqStatus(dccItem::dccDone);
}
}
}
- else if(str.find("No DCC SEND") != -1){ /*fold01*/
+ else if(str.tqfind("No DCC SEND") != -1){ /*fold01*/
TQRegExp rx("who: (.+) file: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
TQString filename = rx.cap(2);
- //TQString key = TQString("%1/%2").arg(filename).arg(who);
+ //TQString key = TQString("%1/%2").tqarg(filename).tqarg(who);
TQPtrList<dccItem> toDel;
TQDict<dccItem> new_list;
@@ -412,7 +412,7 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
toDel.clear();
}
}
- else if(str.find("No DCC GET") != -1){ /*fold01*/
+ else if(str.tqfind("No DCC GET") != -1){ /*fold01*/
TQRegExp rx("who: (.+) file: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
@@ -436,7 +436,7 @@ void KSircIODCC::sirc_receive(TQCString str, bool )
toDel.clear();
}
}
- else if(str.find("No DCC CHAT") != -1){ /*fold01*/
+ else if(str.tqfind("No DCC CHAT") != -1){ /*fold01*/
TQRegExp rx("who: (.+)");
if(rx.search(str)){
TQString who = rx.cap(1);
@@ -470,11 +470,11 @@ void KSircIODCC::control_message(int, TQString)
void KSircIODCC::cancelTransfer(TQString filename)
{
//if(DlgList[filename]){
- //emit outputLine(DCCStatus[filename]->cancelMessage.ascii());
+ //emit outputLine(DCCtqStatus[filename]->cancelMessage.ascii());
//delete DlgList[filename];
//DlgList.remove(filename);
- //delete DCCStatus[filename];
- //DCCStatus.remove(filename);
+ //delete DCCtqStatus[filename];
+ //DCCtqStatus.remove(filename);
//}
}
@@ -482,9 +482,9 @@ void KSircIODCC::getFile()
{
/*
TQString text = pending->fileListing()->text(pending->fileListing()->currentItem());
- int pos = text.find(" ", 0);
+ int pos = text.tqfind(" ", 0);
TQString nick = text.mid(0, pos);
- pos = text.find(" ", pos+1) + 1;
+ pos = text.tqfind(" ", pos+1) + 1;
TQString filename = text.mid(pos, text.length() - pos);
//if(DlgList[filename]->isVisible() == FALSE)
// DlgList[filename]->show();
@@ -503,9 +503,9 @@ void KSircIODCC::forgetFile()
{
/*
TQString text = pending->fileListing()->text(pending->fileListing()->currentItem());
- int pos = text.find(" ", 0);
+ int pos = text.tqfind(" ", 0);
TQString nick = text.mid(0, pos);
- pos = text.find(" ", pos+1) + 1;
+ pos = text.tqfind(" ", pos+1) + 1;
TQString filename = text.mid(pos, text.length() - pos);
TQString command = "/dcc close get " + nick + " " + filename + "\n";
emit outputLine(command.ascii());
@@ -561,7 +561,7 @@ void KSircIODCC::dccResumeClicked(dccItem *it)
kdDebug(5008) << "Got resume click on " << it->who() << " " << it->type() << endl;
switch(it->type()){
case dccItem::dccGet:
- it->changeStatus(dccItem::dccWaitOnResume);
+ it->changetqStatus(dccItem::dccWaitOnResume);
str = "/resume " + it->who() + " " + it->file() + "\n";
emit outputLine(str.ascii());
break;
@@ -583,10 +583,10 @@ void KSircIODCC::dccAbortClicked(dccItem *it)
case dccItem::dccError:
switch(it->type()) {
case dccItem::dccGet:
- DCCGetItems.remove(TQString("%1/%2").arg(it->file()).arg(it->who()));
+ DCCGetItems.remove(TQString("%1/%2").tqarg(it->file()).tqarg(it->who()));
break;
case dccItem::dccSend:
- DCCSendItems.remove(TQString("%1/%2").arg(it->file()).arg(it->who()));
+ DCCSendItems.remove(TQString("%1/%2").tqarg(it->file()).tqarg(it->who()));
break;
case dccItem::dccChat:
DCCChatItems.remove(it->who());
@@ -615,11 +615,11 @@ void KSircIODCC::dccAbortClicked(dccItem *it)
void KSircIODCC::dccRenameDone(dccItem *it, TQString oldWho, TQString oldFile)
{
if(it->type() == dccItem::dccGet){
- TQString str = TQString("/dcc rename %1 %2 %3\n").arg(oldWho).arg(oldFile).arg(it->file());
- TQString key = TQString("%1/%2").arg(oldFile).arg(oldWho);
+ TQString str = TQString("/dcc rename %1 %2 %3\n").tqarg(oldWho).tqarg(oldFile).tqarg(it->file());
+ TQString key = TQString("%1/%2").tqarg(oldFile).tqarg(oldWho);
if(DCCGetItems[key]){
DCCGetItems.take(key);
- TQString newkey = TQString("%1/%2").arg(it->file()).arg(it->who());
+ TQString newkey = TQString("%1/%2").tqarg(it->file()).tqarg(it->who());
DCCGetItems.insert(newkey, it);
}
emit outputLine(str.ascii());
@@ -629,7 +629,7 @@ void KSircIODCC::dccRenameDone(dccItem *it, TQString oldWho, TQString oldFile)
DCCChatItems.take(oldWho);
DCCChatItems.insert(it->who(), it);
}
- TQString str = TQString("/dcc rchat %1 %2\n").arg(oldWho).arg(it->who());
+ TQString str = TQString("/dcc rchat %1 %2\n").tqarg(oldWho).tqarg(it->who());
emit outputLine(str.ascii());
}