Skip to content

Commit

Permalink
Merge pull request #7827 from nextcloud/bugfix/sync-state-tray-icon
Browse files Browse the repository at this point in the history
gui/tray: Fix defaulting to "problem" state in sync tray icon when using macOS VFS
  • Loading branch information
mgallien authored Feb 7, 2025
2 parents 08de4ff + c912317 commit 62772e3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
QList<QString> problemFileProviderAccounts;
QList<QString> syncingFileProviderAccounts;
QList<QString> successFileProviderAccounts;
QList<QString> idleFileProviderAccounts;

if (Mac::FileProvider::fileProviderAvailable()) {
for (const auto &accountState : AccountManager::instance()->accounts()) {
Expand All @@ -329,6 +330,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
switch (const auto latestStatus = fileProvider->socketServer()->latestReceivedSyncStatusForAccount(accountState->account())) {
case SyncResult::Undefined:
case SyncResult::NotYetStarted:
idleFileProviderAccounts.append(accountFpId);
break;
case SyncResult::SyncPrepare:
case SyncResult::SyncRunning:
Expand All @@ -343,7 +345,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
case SyncResult::SetupError:
problemFileProviderAccounts.append(accountFpId);
break;
case SyncResult::Paused:
case SyncResult::Paused: // This is not technically possible with VFS
break;
}
}
Expand Down Expand Up @@ -405,6 +407,12 @@ void ownCloudGui::slotComputeOverallSyncStatus()
overallStatus != SyncResult::Error &&
overallStatus != SyncResult::SetupError) {
overallStatus = SyncResult::SyncRunning;
} else if ((!successFileProviderAccounts.isEmpty() || (problemFileProviderAccounts.isEmpty() && syncingFileProviderAccounts.isEmpty() && !idleFileProviderAccounts.isEmpty())) &&
overallStatus != SyncResult::SyncRunning &&
overallStatus != SyncResult::Problem &&
overallStatus != SyncResult::Error &&
overallStatus != SyncResult::SetupError) {
overallStatus = SyncResult::Success;
}
#endif

Expand Down

0 comments on commit 62772e3

Please sign in to comment.