From 5c45ede4a56b6fb7c97810b098ead551c59a3ef2 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 17 Mar 2014 10:37:06 +0100 Subject: [PATCH] Read the quota as double The server is sending floating point number when the amount of storage is set to a custom number (say 1.2GB) This should fix #1374 --- src/mirall/networkjobs.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mirall/networkjobs.cpp b/src/mirall/networkjobs.cpp index a6b3d215ef..bd17f173a1 100644 --- a/src/mirall/networkjobs.cpp +++ b/src/mirall/networkjobs.cpp @@ -531,9 +531,11 @@ void CheckQuotaJob::finished() reader.namespaceUri() == QLatin1String("DAV:")) { QString name = reader.name().toString(); if (name == QLatin1String("quota-available-bytes")) { - quotaAvailableBytes = reader.readElementText().toLongLong(); + // I have seen the server returning frational bytes: + // 1374532061.2 + quotaAvailableBytes = reader.readElementText().toDouble(); } else if (name == QLatin1String("quota-used-bytes")) { - quotaUsedBytes = reader.readElementText().toLongLong(); + quotaUsedBytes = reader.readElementText().toDouble(); } } }