|
|
@ -30,7 +30,7 @@ namespace kt
|
|
|
|
|
|
|
|
|
|
|
|
TQString BytesToString(Uint64 bytes,int precision)
|
|
|
|
TQString BytesToString(Uint64 bytes,int precision)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KLocale* loc = TDEGlobal::locale();
|
|
|
|
TDELocale* loc = TDEGlobal::locale();
|
|
|
|
if (bytes >= 1024 * 1024 * 1024)
|
|
|
|
if (bytes >= 1024 * 1024 * 1024)
|
|
|
|
return i18n("%1 GB").arg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision));
|
|
|
|
return i18n("%1 GB").arg(loc->formatNumber(bytes / TO_GIG,precision < 0 ? 2 : precision));
|
|
|
|
else if (bytes >= 1024*1024)
|
|
|
|
else if (bytes >= 1024*1024)
|
|
|
@ -43,13 +43,13 @@ namespace kt
|
|
|
|
|
|
|
|
|
|
|
|
TQString KBytesPerSecToString(double speed,int precision)
|
|
|
|
TQString KBytesPerSecToString(double speed,int precision)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KLocale* loc = TDEGlobal::locale();
|
|
|
|
TDELocale* loc = TDEGlobal::locale();
|
|
|
|
return i18n("%1 KB/s").arg(loc->formatNumber(speed,precision));
|
|
|
|
return i18n("%1 KB/s").arg(loc->formatNumber(speed,precision));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString DurationToString(Uint32 nsecs)
|
|
|
|
TQString DurationToString(Uint32 nsecs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KLocale* loc = TDEGlobal::locale();
|
|
|
|
TDELocale* loc = TDEGlobal::locale();
|
|
|
|
TQTime t;
|
|
|
|
TQTime t;
|
|
|
|
int ndays = nsecs / 86400;
|
|
|
|
int ndays = nsecs / 86400;
|
|
|
|
t = t.addSecs(nsecs % 86400);
|
|
|
|
t = t.addSecs(nsecs % 86400);
|
|
|
|