Skip to content

Commit 1b3f78d

Browse files
committed
initial work to limit inittial sync to only some folders
idea is to only sync a subset of existing folders and populate the other on demand when the user needs them Signed-off-by: Matthieu Gallien <[email protected]>
1 parent 29e315a commit 1b3f78d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/libsync/discovery.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,8 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
11381138
item->_folderQuota.bytesAvailable = -1;
11391139
}
11401140

1141+
const auto folderHierarchyDepth = item->_file.split("/").length();
1142+
11411143
// Decay server modifications to UPDATE_METADATA if the local virtual exists
11421144
bool hasLocalVirtual = localEntry.isVirtualFile || (_queryLocal == ParentNotChanged && dbEntry.isVirtualFile());
11431145
bool virtualFileDownload = item->_type == ItemTypeVirtualFileDownload;

src/libsync/vfs/cfapi/cfapiwrapper.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,17 @@ void CALLBACK cfApiValidateData(const CF_CALLBACK_INFO *callbackInfo, const CF_C
386386
qCDebug(lcCfApiWrapper) << "Validate data:" << path << requestId;
387387
}
388388

389+
void CALLBACK cfApiFetchPlaceHolders(const CF_CALLBACK_INFO *callbackInfo, const CF_CALLBACK_PARAMETERS * /*callbackParameters*/)
390+
{
391+
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));
392+
393+
auto vfs = reinterpret_cast<OCC::VfsCfApi *>(callbackInfo->CallbackContext);
394+
Q_ASSERT(vfs->metaObject()->className() == QByteArrayLiteral("OCC::VfsCfApi"));
395+
const auto requestId = QString::number(callbackInfo->TransferKey.QuadPart, 16);
396+
397+
qCDebug(lcCfApiWrapper) << "Fetch placeholder:" << path << requestId;
398+
}
399+
389400
void CALLBACK cfApiCancelFetchPlaceHolders(const CF_CALLBACK_INFO *callbackInfo, const CF_CALLBACK_PARAMETERS * /*callbackParameters*/)
390401
{
391402
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));
@@ -415,6 +426,7 @@ CF_CALLBACK_REGISTRATION cfApiCallbacks[] = {
415426
{ CF_CALLBACK_TYPE_NOTIFY_FILE_CLOSE_COMPLETION, cfApiNotifyFileCloseCompletion },
416427
{ CF_CALLBACK_TYPE_VALIDATE_DATA, cfApiValidateData },
417428
{ CF_CALLBACK_TYPE_CANCEL_FETCH_PLACEHOLDERS, cfApiCancelFetchPlaceHolders },
429+
{ CF_CALLBACK_TYPE_FETCH_PLACEHOLDERS, cfApiFetchPlaceHolders},
418430
CF_CALLBACK_REGISTRATION_END
419431
};
420432

0 commit comments

Comments
 (0)