diff options
| author | 2010-01-26 20:51:46 +0000 | |
|---|---|---|
| committer | 2010-01-26 20:51:46 +0000 | |
| commit | d19f8ff6b693b1f0133106c32635b5645624bb55 (patch) | |
| tree | f4eee84f38145cdf049fd32b69d1951bf19b1dfc | |
| parent | added italian translation (diff) | |
| download | KVIrc-d19f8ff6b693b1f0133106c32635b5645624bb55.tar.gz KVIrc-d19f8ff6b693b1f0133106c32635b5645624bb55.tar.bz2 KVIrc-d19f8ff6b693b1f0133106c32635b5645624bb55.zip | |
fix for #691
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3895 17fca916-40b9-46aa-a4ea-0a15b648b75c
| -rw-r--r-- | src/kvilib/core/kvi_qstring.cpp | 2 | ||||
| -rw-r--r-- | src/kvilib/core/kvi_qstring.h | 2 | ||||
| -rw-r--r-- | src/modules/dcc/broker.cpp | 14 | ||||
| -rw-r--r-- | src/modules/dcc/send.cpp | 4 | ||||
| -rw-r--r-- | src/modules/dcc/send.h | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/src/kvilib/core/kvi_qstring.cpp b/src/kvilib/core/kvi_qstring.cpp index 631d329bd..66ca75aa2 100644 --- a/src/kvilib/core/kvi_qstring.cpp +++ b/src/kvilib/core/kvi_qstring.cpp @@ -223,7 +223,7 @@ namespace KviQString return (pC1 == pC1e); } - QString makeSizeReadable(size_t bytes) + QString makeSizeReadable(quint64 bytes) { double dSize = bytes; if(dSize < 1024) diff --git a/src/kvilib/core/kvi_qstring.h b/src/kvilib/core/kvi_qstring.h index 60c678479..ef1e33254 100644 --- a/src/kvilib/core/kvi_qstring.h +++ b/src/kvilib/core/kvi_qstring.h @@ -58,7 +58,7 @@ namespace KviQString * \param size The size of the file * \return QString */ - extern KVILIB_API QString makeSizeReadable(size_t size); + extern KVILIB_API QString makeSizeReadable(quint64 size); /** * \brief Compares two strings with case sensitive 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 <b>%6</b> on port <b>%7</b><br>" \ ,"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.<br>" \ ,"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 '<b>%1</b>' 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); |
