aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2010-06-02 13:27:04 +0000
committerGravatar Szymon Tomasz Stefanek2010-06-02 13:27:04 +0000
commite0f47c5d70bfaccb4350d2ca975131db96f091e6 (patch)
tree30a574c66aecf67d42616f4c414fcb434546cd4a /src/modules
parentCode cleaning (diff)
downloadKVIrc-e0f47c5d70bfaccb4350d2ca975131db96f091e6.tar.gz
KVIrc-e0f47c5d70bfaccb4350d2ca975131db96f091e6.tar.bz2
KVIrc-e0f47c5d70bfaccb4350d2ca975131db96f091e6.zip
Some tweaks to the DCC send
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4414 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/dcc/broker.cpp51
1 files changed, 29 insertions, 22 deletions
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 '<b>%1</b>' 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);