Commit 2558341f authored by Marcus Camen's avatar Marcus Camen
Browse files

Backport:

Patch by Tim Edwards <tkedwards@optusnet.com.au>:
"While using KGet I've noticed that when the total size of all the files
being downloaded is over ~2gb (i.e the highest number in bytes that a
32-bit signed int can represent) it doesn't display the total size
correctly in the task bar."
(http://lists.kde.org/?l=kde-devel&m=108307479005468)

This is mostly replacing 'unsigned long' with 'KIO::filesize_t'.

CCMAIL: tkedwards@optusnet.com.au

svn path=/branches/KDE_3_2_BRANCH/kdenetwork/kget/; revision=306988
parent ce985aa0
......@@ -2045,7 +2045,7 @@ void KMainWidget::updateStatusBar()
QString tmpstr;
int totalFiles = 0;
int totalSize = 0;
KIO::filesize_t totalSize = 0;
int totalSpeed = 0;
QTime remTime;
......
......@@ -278,7 +278,7 @@ void Transfer::updateAll()
dlgIndividual->setCanResume(canResume);
if (totalSize != 0) {
//logMessage(i18n("Total size is %1 bytes").arg(totalSize));
//logMessage(i18n("Total size is %1 bytes").arg((double)totalSize));
setText(view->lv_total, KIO::convertSize(totalSize));
} else {
//logMessage(i18n("Total size is unknown"));
......@@ -566,7 +566,7 @@ void Transfer::slotSpeed(unsigned long bytes_per_second)
void Transfer::slotTotalSize(unsigned long bytes)
void Transfer::slotTotalSize(KIO::filesize_t bytes)
{
#ifdef _DEBUG
sDebugIn<<" totalSize is = "<<totalSize << endl;
......@@ -575,7 +575,7 @@ void Transfer::slotTotalSize(unsigned long bytes)
if (totalSize == 0) {
totalSize = bytes;
if (totalSize != 0) {
logMessage(i18n("Total size is %1 bytes").arg(totalSize));
logMessage(i18n("Total size is %1 bytes").arg((double)totalSize,0,'f'));
setText(view->lv_total, KIO::convertSize(totalSize));
dlgIndividual->setTotalSize(totalSize);
dlgIndividual->setPercent(0);
......@@ -600,7 +600,7 @@ void Transfer::slotTotalSize(unsigned long bytes)
void Transfer::slotProcessedSize(unsigned long bytes)
void Transfer::slotProcessedSize(KIO::filesize_t bytes)
{
//sDebug<< ">>>>Entering"<<endl;
......
......@@ -87,11 +87,11 @@ public:
return remainingTime;
}
unsigned long getTotalSize()const
KIO::filesize_t getTotalSize()const
{
return totalSize;
}
unsigned long getProcessedSize()const
KIO::filesize_t getProcessedSize()const
{
return processedSize;
}
......@@ -178,8 +178,8 @@ public slots:
void slotQueue();
void slotFinished();
void slotTotalSize(unsigned long bytes);
void slotProcessedSize(unsigned long);
void slotTotalSize(KIO::filesize_t bytes);
void slotProcessedSize(KIO::filesize_t);
void slotStartTime(const QDateTime &);
......@@ -203,8 +203,8 @@ private:
// schedule time
QDateTime startTime;
unsigned long totalSize;
unsigned long processedSize;
KIO::filesize_t totalSize;
KIO::filesize_t processedSize;
int percent;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment