Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui/tray: Fix defaulting to "problem" state in sync tray icon when using macOS VFS #7827

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/gui/owncloudgui.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/gui/owncloudgui.cpp

File src/gui/owncloudgui.cpp does not conform to Custom style guidelines. (lines 410, 411, 412, 413)
* Copyright (C) by Klaas Freitag <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -313,6 +313,7 @@
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 @@
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 @@
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 @@
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
Loading