From kde-commits Fri Nov 26 00:40:24 2004 From: David Faure Date: Fri, 26 Nov 2004 00:40:24 +0000 To: kde-commits Subject: kdelibs/kio Message-Id: <20041126004024.701FC1D05C () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=110142963530820 CVS commit by faure: When using kio_uiserver to display progress for something else than a KIO job, we might have a number of files and no "total size" - e.g. in the dialog I added in the kolab resource. "10% of 540 files" looks better than "10% of 0B" M +3 -1 kio/defaultprogress.cpp 1.66 M +3 -1 misc/uiserver.cpp 1.120 --- kdelibs/kio/misc/uiserver.cpp #1.119:1.120 @@ -265,5 +265,7 @@ void ProgressItem::setProcessedDirs( uns void ProgressItem::setPercent( unsigned long percent ) { - QString tmps = i18n( "%1 % of %2 ").arg( percent ).arg( KIO::convertSize(m_iTotalSize)); + QString total = m_iTotalSize ? KIO::convertSize(m_iTotalSize) + : i18n( "%1 files" ).arg( m_iTotalFiles ); + QString tmps = i18n( "%1 % of %2 ").arg( percent ).arg( total ); setText( ListProgress::TB_PROGRESS, tmps ); --- kdelibs/kio/kio/defaultprogress.cpp #1.65:1.66 @@ -230,5 +230,7 @@ void DefaultProgress::showTotals() void DefaultProgress::slotPercent( KIO::Job*, unsigned long percent ) { - QString tmp(i18n( "%1% of %2 ").arg( percent ).arg( KIO::convertSize(m_iTotalSize))); + QString total = m_iTotalSize ? KIO::convertSize( m_iTotalSize ) + : i18n( "%1 files" ).arg( m_iTotalFiles ); + QString tmp = i18n( "%1 % of %2 " ).arg( percent ).arg( total ); m_pProgressBar->setValue( percent ); switch(mode) {