]> jfr.im git - irc/kvirc/KVIrc.git/commitdiff
patch for #321: *should* be fixed
authorElvio Basello <redacted>
Fri, 19 Dec 2008 01:31:20 +0000 (01:31 +0000)
committerElvio Basello <redacted>
Fri, 19 Dec 2008 01:31:20 +0000 (01:31 +0000)
git-svn-id: https://svn.kvirc.de/svn/branches/kvirc/3.4@2954 17fca916-40b9-46aa-a4ea-0a15b648b75c

src/modules/dcc/broker.cpp

index 99710495dfcea67e66f68486170c4f5579244b5f..e5a19c8084efd89c7e29a18217b27504c2257319 100644 (file)
@@ -641,13 +641,13 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc)
        if(box)box->forgetDescriptor();
 
        // Check if file exists
-       QFile fi(dcc->szLocalFileName);
+       QFileInfo fi(dcc->szLocalFileName);
        if(fi.exists() && (fi.size() > 0)) // 0 byte files are senseless for us
        {
                dcc->szLocalFileSize.setNum(fi.size());
                
                bool bOk;
-               unsigned long iRemoteSize = dcc->szFileSize.toULong(&bOk);
+               int iRemoteSize = dcc->szFileSize.toInt(&bOk);
                if(!bOk)iRemoteSize = -1;
 
                // FIXME: Files downloaded succesfully shouldn't be resumed
@@ -659,7 +659,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc)
                        bool bDisableResume = false;
                        
                        if((iRemoteSize > -1) || // remote size is unknown
-                               (iRemoteSize > (fi.size()))) // or it is larger than the actual size on disk
+                               (iRemoteSize > ((int)(fi.size())))) // or it is larger than the actual size on disk
                        {
                                tmp = __tr2qs_ctx( \
                                                        "The file '<b>%1</b>' already exists " \
@@ -697,7 +697,7 @@ void KviDccBroker::renameOverwriteResume(KviDccBox *box,KviDccDescriptor * dcc)
                        // auto resume ?
                        if(KVI_OPTION_BOOL(KviOption_boolAutoResumeDccSendWhenAutoAccepted) &&
                                (iRemoteSize > -1) && // only if the remote size is really known
-                               (iRemoteSize > (fi.size())) && // only if the remote size is larger than the local size
+                               (iRemoteSize > ((int)(fi.size()))) && // only if the remote size is larger than the local size
                                (!KviDccFileTransfer::nonFailedTransferWithLocalFileName(dcc->szLocalFileName.utf8().data()))) // only if there is no transfer with this local file name yet
                        {
                                // yep, auto resume...