mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 04:55:48 +03:00
Process state of file provider account domains in slotComputeOverallSyncStatus
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
98dba86f58
commit
84d74bc5ab
1 changed files with 20 additions and 0 deletions
|
@ -65,6 +65,7 @@
|
|||
|
||||
#ifdef BUILD_FILE_PROVIDER_MODULE
|
||||
#include "macOS/fileprovider.h"
|
||||
#include "macOS/fileproviderdomainmanager.h"
|
||||
#include "macOS/fileprovidersettingscontroller.h"
|
||||
#endif
|
||||
|
||||
|
@ -299,6 +300,25 @@ void ownCloudGui::slotComputeOverallSyncStatus()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef BUILD_FILE_PROVIDER_MODULE
|
||||
QList<QString> syncingFileProviderAccounts;
|
||||
|
||||
if (Mac::FileProvider::fileProviderAvailable()) {
|
||||
for (const auto &accountState : AccountManager::instance()->accounts()) {
|
||||
const auto accountFpId = Mac::FileProviderDomainManager::fileProviderDomainIdentifierFromAccountState(accountState);
|
||||
if (!Mac::FileProviderSettingsController::instance()->vfsEnabledForAccount(accountFpId)) {
|
||||
continue;
|
||||
}
|
||||
const auto socketState = Mac::FileProvider::instance()->socketServer()->socketStateForAccount(accountFpId);
|
||||
if (!socketState.connected || socketState.latestStatus == SyncResult::Problem || socketState.latestStatus == SyncResult::Error) {
|
||||
problemAccounts.append(accountState);
|
||||
} else if (socketState.latestStatus == SyncResult::SyncRunning) {
|
||||
syncingFileProviderAccounts.append(accountFpId);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!problemAccounts.empty()) {
|
||||
_tray->setIcon(Theme::instance()->folderOfflineIcon(true));
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
Loading…
Reference in a new issue