when files get hydrated indirectly through pinning, sets correct state

files that get downloaded not through an hydration request need to be
converted to placeholder

sets the expected state when converting them to placeholder files

 #3082

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
This commit is contained in:
Matthieu Gallien 2021-04-19 15:06:40 +02:00
parent 929ae965ce
commit 419bd93dea

View file

@ -703,7 +703,7 @@ OCC::Result<void, QString> OCC::CfApiWrapper::convertToPlaceholder(const FileHan
const auto fileIdentity = QString::fromUtf8(fileId).toStdWString();
const auto fileIdentitySize = (fileIdentity.length() + 1) * sizeof(wchar_t);
const qint64 result = CfConvertToPlaceholder(handle.get(), fileIdentity.data(), sizeToDWORD(fileIdentitySize), CF_CONVERT_FLAG_NONE, nullptr, nullptr);
const qint64 result = CfConvertToPlaceholder(handle.get(), fileIdentity.data(), sizeToDWORD(fileIdentitySize), CF_CONVERT_FLAG_MARK_IN_SYNC, nullptr, nullptr);
Q_ASSERT(result == S_OK);
if (result != S_OK) {
qCCritical(lcCfApiWrapper) << "Couldn't convert to placeholder" << pathForHandle(handle) << ":" << _com_error(result).ErrorMessage();