Commits

Anonymous committed cf4c7d0

Corrections for file sizes >2GB

  • Participants
  • Parent commits d2f6acf

Comments (0)

Files changed (2)

File src-QT4/fileaccess.cpp

 bool FileAccess::isDir() const         {   return m_bDir;        }
 bool FileAccess::isSymLink() const     {   return m_bSymLink;    }
 bool FileAccess::exists() const        {   return m_bExists;     }
-long FileAccess::size() const          {   return m_size;        }
+qint64 FileAccess::size() const        {   return m_size;        }
 KUrl FileAccess::url() const           {   return m_url;         }
 bool FileAccess::isLocal() const       {   return m_bLocal;      }
 bool FileAccess::isReadable() const    {   return m_bReadable;   }
 }
 
 // If the size couldn't be determined by stat() then the file is copied to a local temp file.
-long FileAccess::sizeForReading()
+qint64 FileAccess::sizeForReading()
 {
    if ( m_size == 0 && !isLocal() )
    {
    }
    else
    {
-      long length = min2( long(newData.size()), m_maxLength - m_transferredBytes );
+      qint64 length = min2( qint64(newData.size()), m_maxLength - m_transferredBytes );
       ::memcpy( m_pTransferBuffer + m_transferredBytes, newData.data(), newData.size() );
       m_transferredBytes += length;
    }
    }
    else
    {
-      long maxChunkSize = 100000;
-      long length = min2( maxChunkSize, m_maxLength - m_transferredBytes );
+      qint64 maxChunkSize = 100000;
+      qint64 length = min2( maxChunkSize, m_maxLength - m_transferredBytes );
       data.resize( length );
       if ( data.size()==length )
       {
                }
                bFirst = false;
                FileAccess fa;
-               fa.m_size = findData.nFileSizeLow ;//+ findData.nFileSizeHigh;
+               fa.m_size = ( qint64( findData.nFileSizeHigh ) << 32 ) + findData.nFileSizeLow;
 
                FILETIME ft;
                SYSTEMTIME t;

File src-QT4/fileaccess.h

    bool isDir() const;
    bool isSymLink() const;
    bool exists() const;
-   long size() const;            // Size as returned by stat().
-   long sizeForReading();  // If the size can't be determined by stat() then the file is copied to a local temp file.
+   qint64 size() const;            // Size as returned by stat().
+   qint64 sizeForReading();  // If the size can't be determined by stat() then the file is copied to a local temp file.
    bool isReadable() const;
    bool isWritable() const;
    bool isExecutable() const;
    bool m_bLocal;
    bool m_bValidData;
 
-   unsigned long m_size;
+   qint64 m_size;
    QDateTime m_modificationTime;
    QDateTime m_accessTime;
    QDateTime m_creationTime;
    bool m_bSuccess;
 
    // Data needed during Job
-   long m_transferredBytes;
+   qint64 m_transferredBytes;
    char* m_pTransferBuffer;  // Needed during get or put
-   long m_maxLength;
+   qint64 m_maxLength;
 
    QString m_filePattern;
    QString m_fileAntiPattern;