Add method in file provider xpc to set fast enumeration enabled state

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-02-06 14:08:37 +08:00
parent db9b9a64b4
commit a02efd65f8
2 changed files with 9 additions and 0 deletions

View file

@ -44,6 +44,8 @@ public slots:
void unauthenticateExtension(const QString &extensionAccountId) const;
void createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename) const;
void setFastEnumerationEnabledForExtension(const QString &extensionAccountId, bool enabled) const;
private slots:
void slotAccountStateChanged(AccountState::State state) const;

View file

@ -158,4 +158,11 @@ std::optional<std::pair<bool, bool>> FileProviderXPC::fastEnumerationStateForExt
return std::optional<std::pair<bool, bool>>{{receivedFastEnumerationEnabled, receivedFastEnumerationSet}};
}
void FileProviderXPC::setFastEnumerationEnabledForExtension(const QString &extensionAccountId, bool enabled) const
{
qCInfo(lcFileProviderXPC) << "Setting fast enumeration for extension" << extensionAccountId << "to" << enabled;
const auto service = (NSObject<ClientCommunicationProtocol> *)_clientCommServices.value(extensionAccountId);
[service setFastEnumerationEnabled:enabled];
}
} // namespace OCC::Mac