Store latest sync state in file provider socket controller

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-07-17 17:28:11 +08:00
parent 3415f39c16
commit 3877efba5e
No known key found for this signature in database
GPG Key ID: C839200C384636B0
2 changed files with 4 additions and 3 deletions

View File

@ -224,7 +224,7 @@ void FileProviderSocketController::sendAccountDetails() const
sendMessage(message);
}
void FileProviderSocketController::reportSyncState(const QString &receivedState) const
void FileProviderSocketController::reportSyncState(const QString &receivedState)
{
auto syncState = SyncResult::Status::Undefined;
if (receivedState == QStringLiteral("SYNC_STARTED")) {
@ -238,7 +238,7 @@ void FileProviderSocketController::reportSyncState(const QString &receivedState)
} else {
qCWarning(lcFileProviderSocketController) << "Unknown sync state received:" << receivedState;
}
_latestStatus = syncState;
emit syncStateChanged(_accountState->account(), syncState);
}

View File

@ -54,11 +54,12 @@ private slots:
void sendAccountDetails() const;
void sendNotAuthenticated() const;
void reportSyncState(const QString &receivedState) const;
void reportSyncState(const QString &receivedState);
private:
QPointer<QLocalSocket> _socket;
AccountStatePtr _accountState;
SyncResult::Status _latestStatus = SyncResult::Undefined;
};
} // namespace Mac