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 <[email protected]>
  • Loading branch information
claucambra authored and mgallien committed Feb 7, 2025
1 parent e3f49df commit cd1cb3b
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 @@ -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,7 +407,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 cd1cb3b

Please sign in to comment.