Skip to content

Commit

Permalink
gui/tray: Present successful sync tray icon is we just have idle file…
Browse files Browse the repository at this point in the history
… provider accounts

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra committed Feb 7, 2025
1 parent a7c3902 commit 00946f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,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 @@ -328,6 +329,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 @@ -342,7 +344,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 @@ -404,7 +406,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
overallStatus != SyncResult::Error &&
overallStatus != SyncResult::SetupError) {
overallStatus = SyncResult::SyncRunning;
} else if (!successFileProviderAccounts.isEmpty() &&
} else if ((!successFileProviderAccounts.isEmpty() || (problemFileProviderAccounts.isEmpty() && syncingFileProviderAccounts.isEmpty() && !idleFileProviderAccounts.isEmpty())) &&
overallStatus != SyncResult::SyncRunning &&
overallStatus != SyncResult::Problem &&
overallStatus != SyncResult::Error &&
Expand Down

0 comments on commit 00946f3

Please sign in to comment.