mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03: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:
parent
8151eb4837
commit
0f7c10a2d6
1 changed files with 4 additions and 0 deletions
|
@ -42,6 +42,8 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
|
||||||
, _localFolderValid(false)
|
, _localFolderValid(false)
|
||||||
, _progressIndi(new QProgressIndicator(this))
|
, _progressIndi(new QProgressIndicator(this))
|
||||||
, _remoteFolder()
|
, _remoteFolder()
|
||||||
|
, _rSize(-1)
|
||||||
|
, _rSelectedSize(-1)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
|
|
||||||
|
@ -368,6 +370,8 @@ void OwncloudAdvancedSetupPage::slotQuotaRetrieved(const QVariantMap &result)
|
||||||
{
|
{
|
||||||
_rSize = result["size"].toDouble();
|
_rSize = result["size"].toDouble();
|
||||||
_ui.lSyncEverythingSizeLabel->setText(tr("(%1)").arg(Utility::octetsToString(_rSize)));
|
_ui.lSyncEverythingSizeLabel->setText(tr("(%1)").arg(Utility::octetsToString(_rSize)));
|
||||||
|
|
||||||
|
updateStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 OwncloudAdvancedSetupPage::availableLocalSpace() const
|
qint64 OwncloudAdvancedSetupPage::availableLocalSpace() const
|
||||||
|
|
Loading…
Reference in a new issue