Skip to content

Commit

Permalink
Ensure all sync result status types are handled for file provider in …
Browse files Browse the repository at this point in the history
…owncloudgui

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Jul 19, 2024
1 parent c852506 commit 58d953f
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,28 @@ void ownCloudGui::slotComputeOverallSyncStatus()
continue;
}
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);
} else if (latestStatus == SyncResult::SyncRunning) {
syncingFileProviderAccounts.append(accountFpId);
} else {
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;
}
}
}
}
Expand Down

0 comments on commit 58d953f

Please sign in to comment.