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
This commit is contained in:
Olivier Goffart 2014-03-17 10:37:06 +01:00
parent cabcdd890e
commit 5c45ede4a5

View File

@ -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:
// <d:quota-available-bytes>1374532061.2</d:quota-available-bytes>
quotaAvailableBytes = reader.readElementText().toDouble();
} else if (name == QLatin1String("quota-used-bytes")) {
quotaUsedBytes = reader.readElementText().toLongLong();
quotaUsedBytes = reader.readElementText().toDouble();
}
}
}