[patch] kio remaining time

Martin Koller m.koller at surfeu.at
Sun Jan 30 19:26:08 GMT 2005


On Sunday 30 January 2005 19:05, David Faure wrote:
> Since filesize_t isn't really related to "number of seconds" it reads a bit
> funny to use that type.

Yes, you're right. I wasn't really fond of this.

> Why not just use "unsigned long long int"? 
> kmountpoint.h does that so it looks portable.

OK, done this.

> 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;

Very good idea. Didn't know formatTime() until now.

Question to your code:
Why do you use "const QTime" etc. for the local vars ?
Does this really make sense ?

-- 
Best regards/Schöne Grüße

Martin    ()  ascii ribbon campaign - against html mail 
          /\                        - against microsoft attachments

       Some operating systems are called 'user friendly',
             Linux however is 'expert friendly'.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050130/53411860/attachment.sig>


More information about the kde-core-devel mailing list