Vfs: Make dehydration a SYNC and not a NEW action

That change will be useful for the notifications. Previously the
dehydrated files were reported as "newly downloaded", now they're
reported as "updated".
This commit is contained in:
Christian Kamm 2019-02-08 12:18:22 +01:00 committed by Kevin Ottens
parent 797734870f
commit f24687ec93
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2
2 changed files with 5 additions and 3 deletions

View file

@ -642,7 +642,7 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
} else if (dbEntry._type == ItemTypeVirtualFileDehydration) {
// dehydration requested
item->_direction = SyncFileItem::Down;
item->_instruction = CSYNC_INSTRUCTION_NEW;
item->_instruction = CSYNC_INSTRUCTION_SYNC;
item->_type = ItemTypeVirtualFileDehydration;
}
} else if (noServerEntry) {
@ -707,7 +707,7 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
item->_direction = SyncFileItem::Down;
} else if (dbEntry._type == ItemTypeVirtualFileDehydration || localEntry.type == ItemTypeVirtualFileDehydration) {
item->_direction = SyncFileItem::Down;
item->_instruction = CSYNC_INSTRUCTION_NEW;
item->_instruction = CSYNC_INSTRUCTION_SYNC;
item->_type = ItemTypeVirtualFileDehydration;
} else if (!serverModified && dbEntry._inode != localEntry.inode) {
item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
@ -970,7 +970,7 @@ void ProcessDirectoryJob::processFileFinalize(
addVirtualFileSuffix(item->_file);
}
if (item->_type == ItemTypeVirtualFileDehydration
&& item->_instruction == CSYNC_INSTRUCTION_NEW) {
&& item->_instruction == CSYNC_INSTRUCTION_SYNC) {
item->_renameTarget = item->_file;
addVirtualFileSuffix(item->_renameTarget);
}

View file

@ -677,8 +677,10 @@ private slots:
QVERIFY(isDehydrated("A/a1"));
QVERIFY(hasDehydratedDbEntries("A/a1"));
QVERIFY(itemInstruction(completeSpy, "A/a1.nextcloud", CSYNC_INSTRUCTION_SYNC));
QVERIFY(isDehydrated("A/a2"));
QVERIFY(hasDehydratedDbEntries("A/a2"));
QVERIFY(itemInstruction(completeSpy, "A/a2.nextcloud", CSYNC_INSTRUCTION_SYNC));
QVERIFY(!fakeFolder.currentLocalState().find("B/b1"));
QVERIFY(!fakeFolder.currentRemoteState().find("B/b1"));