1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-04-28 01:15:46 +02:00

Race condition in the remote size loading logic

The quota retrieval process might not be finished by the time
the used space on the server (`_rSize`) is compared against
the locally available disk space which might end up in
a "There isn't enough free space in the local folder!" message
even if there is enough free space.

This patch updates the status after the quota has been retrieved.

It also initializes `_rSize` to `-1` so that errors like this
are easier to catch in the future.
This commit is contained in:
Ivan Čukić 2019-05-08 22:54:52 +02:00 committed by Camila San
parent caa7c845c2
commit a0faf1f54d
No known key found for this signature in database
GPG Key ID: 7A4A6121E88E2AD4

View File

@ -42,6 +42,8 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
, _localFolderValid(false)
, _progressIndi(new QProgressIndicator(this))
, _remoteFolder()
, _rSize(-1)
, _rSelectedSize(-1)
{
_ui.setupUi(this);
@ -368,6 +370,8 @@ void OwncloudAdvancedSetupPage::slotQuotaRetrieved(const QVariantMap &result)
{
_rSize = result["size"].toDouble();
_ui.lSyncEverythingSizeLabel->setText(tr("(%1)").arg(Utility::octetsToString(_rSize)));
updateStatus();
}
qint64 OwncloudAdvancedSetupPage::availableLocalSpace() const