From 0f7c10a2d667423c31aee86d214bdf8659ecc090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= Date: Wed, 8 May 2019 22:54:52 +0200 Subject: [PATCH] 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. --- src/gui/wizard/owncloudadvancedsetuppage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp index c5e17040d1..19ffd1a709 100644 --- a/src/gui/wizard/owncloudadvancedsetuppage.cpp +++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp @@ -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