[patch] kio remaining time
David Faure
faure at kde.org
Sun Jan 30 18:05:04 GMT 2005
On Sunday 30 January 2005 16:50, Martin Koller wrote:
> Addressing http://bugs.kde.org/show_bug.cgi?id=14567
> (showing more than 1 day for remaining time)
> I want to know if the following is ok to commit.
Thanks for having looked into this.
Since filesize_t isn't really related to "number of seconds" it reads a bit
funny to use that type. Why not just use "unsigned long long int"?
kmountpoint.h does that so it looks portable.
One problem with KIO::convertSeconds() is that it doesn't allow localization,
i.e. using another format than hh:mm:ss in some languages. How about using
QTime at that point? E.g. like this:
const QTime time(hours, mins, secs);
const QString timeStr( KGlobal::locale()->formatTime(time, true /*with seconds*/, true /*duration*/) );
if ( days > 0 )
return i18n("1 day %1", "%n days %1", days).arg(timeStr);
else
return timeStr;
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list