Units: Back to the "usual" mix units.
authorKlaas Freitag <freitag@owncloud.com>
Thu, 10 Sep 2015 10:08:20 +0000 (12:08 +0200)
committerKlaas Freitag <freitag@owncloud.com>
Thu, 10 Sep 2015 10:08:20 +0000 (12:08 +0200)
Now we display units again numerically wrong (based on 1024) but back
to how it was before in ownCloud.

src/libsync/utility.cpp

index 5babf16f562d28a765ee83e634a0d5be86febfe5..98dc63d41765d4ac6175d823c7dcafdffc890bfc 100644 (file)
@@ -103,10 +103,11 @@ void Utility::setupFavLink(const QString &folder)
 
 QString Utility::octetsToString( qint64 octets )
 {
-    static const qint64 kb = 1000;
-    static const qint64 mb = 1000 * kb;
-    static const qint64 gb = 1000 * mb;
-    static const qint64 tb = 1000 * gb;
+#define THE_FACTOR 1024
+    static const qint64 kb = THE_FACTOR;
+    static const qint64 mb = THE_FACTOR * kb;
+    static const qint64 gb = THE_FACTOR * mb;
+    static const qint64 tb = THE_FACTOR * gb;
 
     QString s;
     qreal value = octets;