* Moved the duplicate "string_for_size()" implementations into libshared.a.

* Adapted libtracker.so, DriveSetup and Installer to use the shared version.
 * The new version uses the correct units (KiB instead of KB and so on).
 * Use the correct units in a few other prominent places, where
   string_for_size() could not be used.

Should resolve a major part of #5378.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35935 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2010-03-23 16:49:49 +00:00
parent 3d019c5f63
commit 48d796576e
14 changed files with 113 additions and 118 deletions
+3 -3
View File
@@ -675,11 +675,11 @@ BInfoWindow::GetSizeString(BString &result, off_t size, int32 fileCount)
bytes = numStr;
if (size >= kGBSize)
PrintFloat(result, (float)size / kGBSize) << " GB";
PrintFloat(result, (float)size / kGBSize) << " GiB";
else if (size >= kMBSize)
PrintFloat(result, (float)size / kMBSize) << " MB";
PrintFloat(result, (float)size / kMBSize) << " MiB";
else if (size >= kKBSize)
result << (int64)(size + kHalfKBSize) / kKBSize << "K";
result << (int64)(size + kHalfKBSize) / kKBSize << "KiB";
else
result << size;