From e0f47c5d70bfaccb4350d2ca975131db96f091e6 Mon Sep 17 00:00:00 2001 From: Szymon Tomasz Stefanek Date: Wed, 2 Jun 2010 13:27:04 +0000 Subject: Some tweaks to the DCC send git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4414 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/dcc/broker.cpp | 51 ++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'src/modules') diff --git a/src/modules/dcc/broker.cpp b/src/modules/dcc/broker.cpp index 6a9ed91cd..2b82d8a5a 100644 --- a/src/modules/dcc/broker.cpp +++ b/src/modules/dcc/broker.cpp @@ -738,15 +738,18 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc) bool bOk; quint64 iRemoteSize = dcc->szFileSize.toULongLong(&bOk); - if(!bOk)iRemoteSize = 0; + if(!bOk) + iRemoteSize = 0; if(!dcc->bAutoAccept) { QString tmp; bool bDisableResume = false; - if((bOk) || // remote size is unknown - (iRemoteSize > (quint64)fi.size())) // or it is larger than the actual size on disk + if( + (!bOk) || // remote size is unknown + (iRemoteSize > (quint64)fi.size()) // or it is larger than the actual size on disk + ) { tmp = __tr2qs_ctx( \ "The file '%1' already exists " \ @@ -780,27 +783,31 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc) this,SLOT(cancelDcc(KviDccBox *,KviDccDescriptor *))); box->show(); return; - } else { - // auto resume ? - if(KVI_OPTION_BOOL(KviOption_boolAutoResumeDccSendWhenAutoAccepted) && - (bOk) && // only if the remote size is really known + } + + // auto resume ? + if( + KVI_OPTION_BOOL(KviOption_boolAutoResumeDccSendWhenAutoAccepted) && + (bOk) && // only if the remote size is really known (iRemoteSize > (quint64)fi.size()) && // only if the remote size is larger than the local size - (!KviDccFileTransfer::nonFailedTransferWithLocalFileName(dcc->szLocalFileName.toUtf8().data()))) // only if there is no transfer with this local file name yet - { - // yep, auto resume... - dcc->bResume = true; - recvFileExecute(0,dcc); - } else if(iRemoteSize == (quint64)fi.size()) - { - dcc->console()->output(KVI_OUT_DCCMSG,"Transfer aborted: file %Q already completed",&(dcc->szLocalFileName)); - cancelDcc(0,dcc); - } else { - // otherwise auto rename - renameDccSendFile(0,dcc); - } - return; + (!KviDccFileTransfer::nonFailedTransferWithLocalFileName(dcc->szLocalFileName)) // only if there is no transfer with this local file name yet + ) + { + // yep, auto resume... + dcc->bResume = true; + recvFileExecute(0,dcc); + } else if(iRemoteSize == (quint64)fi.size()) + { + dcc->console()->output(KVI_OUT_DCCMSG,"Transfer aborted: file %Q already completed",&(dcc->szLocalFileName)); + cancelDcc(0,dcc); + } else { + // otherwise auto rename + renameDccSendFile(0,dcc); } - } else dcc->szLocalFileSize = "0"; + return; + } + + dcc->szLocalFileSize = "0"; // everything OK recvFileExecute(0,dcc); -- cgit v1.3.1-10-gc9f91