From d19f8ff6b693b1f0133106c32635b5645624bb55 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 26 Jan 2010 20:51:46 +0000 Subject: fix for #691 git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3895 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/dcc/broker.cpp | 14 +++++++------- src/modules/dcc/send.cpp | 4 ++-- src/modules/dcc/send.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/modules') diff --git a/src/modules/dcc/broker.cpp b/src/modules/dcc/broker.cpp index f654356ca..ee7abc150 100644 --- a/src/modules/dcc/broker.cpp +++ b/src/modules/dcc/broker.cpp @@ -564,7 +564,7 @@ void KviDccBroker::recvFileManage(KviDccDescriptor * dcc) if(dcc->bIsIncomingAvatar) { bool bOk; - unsigned long size = dcc->szFileSize.toULong(&bOk); + quint64 size = dcc->szFileSize.toULongLong(&bOk); if(bOk) { if(size>=KVI_OPTION_UINT(KviOption_uintMaximumRequestedAvatarSize)) { cancelDcc(0,dcc); @@ -589,7 +589,7 @@ void KviDccBroker::recvFileManage(KviDccDescriptor * dcc) "The connection target will be host %6 on port %7
" \ ,"dcc" \ ).arg(dcc->szNick).arg(dcc->szUser).arg(dcc->szHost).arg( - dcc->szFileName).arg(KviQString::makeSizeReadable(dcc->szFileSize.toULong())).arg( + dcc->szFileName).arg(KviQString::makeSizeReadable(dcc->szFileSize.toULongLong())).arg( dcc->szIp).arg(dcc->szPort); } else { @@ -602,7 +602,7 @@ void KviDccBroker::recvFileManage(KviDccDescriptor * dcc) "You will be the passive side of the connection.
" \ ,"dcc" \ ).arg(dcc->szNick).arg(dcc->szUser).arg(dcc->szHost).arg( - dcc->szFileName).arg(KviQString::makeSizeReadable(dcc->szFileSize.toULong())); + dcc->szFileName).arg(KviQString::makeSizeReadable(dcc->szFileSize.toULongLong())); } if(dcc->bIsIncomingAvatar) @@ -737,7 +737,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc) dcc->szLocalFileSize.setNum(fi.size()); bool bOk; - unsigned long iRemoteSize = dcc->szFileSize.toULong(&bOk); + quint64 iRemoteSize = dcc->szFileSize.toULongLong(&bOk); if(!bOk)iRemoteSize = 0; if(!dcc->bAutoAccept) @@ -746,7 +746,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc) bool bDisableResume = false; if((bOk) || // remote size is unknown - (iRemoteSize > ((unsigned long)(fi.size())))) // or it is larger than the actual size on disk + (iRemoteSize > (quint64)fi.size())) // or it is larger than the actual size on disk { tmp = __tr2qs_ctx( \ "The file '%1' already exists " \ @@ -784,13 +784,13 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc) // auto resume ? if(KVI_OPTION_BOOL(KviOption_boolAutoResumeDccSendWhenAutoAccepted) && (bOk) && // only if the remote size is really known - (iRemoteSize > ((unsigned long)(fi.size()))) && // only if the remote size is larger than the local size + (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 == ((unsigned long)(fi.size())))) + } else if(iRemoteSize == (quint64)fi.size()) { dcc->console()->output(KVI_OUT_DCCMSG,"Transfer aborted: file %Q already completed",&(dcc->szLocalFileName)); cancelDcc(0,dcc); diff --git a/src/modules/dcc/send.cpp b/src/modules/dcc/send.cpp index 746ed2f65..6def7c4e1 100644 --- a/src/modules/dcc/send.cpp +++ b/src/modules/dcc/send.cpp @@ -1436,7 +1436,7 @@ bool KviDccFileTransfer::handleResumeAccepted(const char * filename,const char * return false; } -bool KviDccFileTransfer::handleResumeRequest(const char * filename,const char * port,unsigned long filePos) +bool KviDccFileTransfer::handleResumeRequest(const char * filename,const char * port,quint64 filePos) { if(!g_pDccFileTransfers)return false; @@ -1783,7 +1783,7 @@ bool KviDccFileTransfer::resumeAccepted(const char *filename,const char *port,co return true; } -bool KviDccFileTransfer::doResume(const char * filename,const char * port,unsigned long filePos) +bool KviDccFileTransfer::doResume(const char * filename,const char * port,quint64 filePos) { if(KviQString::equalCI(port,m_pMarshal->dccPort()) && (!m_pSlaveRecvThread) && (!m_pDescriptor->bRecvFile)) diff --git a/src/modules/dcc/send.h b/src/modules/dcc/send.h index 61f950cfd..561aa9cf1 100644 --- a/src/modules/dcc/send.h +++ b/src/modules/dcc/send.h @@ -199,7 +199,7 @@ private: QTimer * m_pResumeTimer; // used to signal resume timeout public: bool resumeAccepted(const char * filename,const char * port,const char *szZeroPortTag); - bool doResume(const char * filename,const char * port,unsigned long filePos); + bool doResume(const char * filename,const char * port,quint64 filePos); static void init(); static void done(); @@ -207,7 +207,7 @@ public: static KviDccFileTransfer * nonFailedTransferWithLocalFileName(const QString &szLocalFileName); static unsigned int transferCount(); static bool handleResumeAccepted(const char * filename,const char * port,const char * szZeroPortTag); - static bool handleResumeRequest(const char * filename,const char * port,unsigned long filePos); + static bool handleResumeRequest(const char * filename,const char * port,quint64 filePos); virtual bool event(QEvent *e); -- cgit v1.3.1-10-gc9f91