From: Christian Kamm Date: Fri, 8 Feb 2019 11:18:22 +0000 (+0100) Subject: Vfs: Make dehydration a SYNC and not a NEW action X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~294 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f24687ec932ba6307c7c9f87e714004ba8a38949;p=nextcloud-desktop.git 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". --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 51dc164dd..c2c1db099 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -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); } diff --git a/test/testsyncvirtualfiles.cpp b/test/testsyncvirtualfiles.cpp index b2b3ef239..3c461cad0 100644 --- a/test/testsyncvirtualfiles.cpp +++ b/test/testsyncvirtualfiles.cpp @@ -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"));