Ensure all sync result status types are handled for file provider in owncloudgui

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-07-19 15:06:20 +08:00
parent 3194edb063
commit 1128d9d668
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -311,11 +311,28 @@ void ownCloudGui::slotComputeOverallSyncStatus()
continue; continue;
} }
const auto fileProvider = Mac::FileProvider::instance(); const auto fileProvider = Mac::FileProvider::instance();
const auto latestStatus = fileProvider->socketServer()->latestReceivedSyncStatusForAccount(accountState->account());
if (latestStatus == SyncResult::Problem || latestStatus == SyncResult::Error || !fileProvider->xpc()->fileProviderExtReachable(accountFpId)) { if (!fileProvider->xpc()->fileProviderExtReachable(accountFpId)) {
problemFileProviderAccounts.append(accountFpId); problemFileProviderAccounts.append(accountFpId);
} else if (latestStatus == SyncResult::SyncRunning) { } else {
syncingFileProviderAccounts.append(accountFpId); switch (const auto latestStatus = fileProvider->socketServer()->latestReceivedSyncStatusForAccount(accountState->account())) {
case SyncResult::Undefined:
case SyncResult::NotYetStarted:
break;
case SyncResult::SyncPrepare:
case SyncResult::SyncRunning:
case SyncResult::SyncAbortRequested:
case SyncResult::Success:
syncingFileProviderAccounts.append(accountFpId);
break;
case SyncResult::Problem:
case SyncResult::Error:
case SyncResult::SetupError:
problemFileProviderAccounts.append(accountFpId);
break;
case SyncResult::Paused:
break;
}
} }
} }
} }