mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 14:36:01 +03:00
parent
fc52c5d0cd
commit
5bc2180478
2 changed files with 15 additions and 3 deletions
|
@ -1029,10 +1029,10 @@ void PropagateDownloadFile::downloadFinished()
|
|||
propagator()->_journal->deleteFileRecord(virtualFile);
|
||||
|
||||
// Move the pin state to the new location
|
||||
auto pin = propagator()->_journal->internalPinStates().rawForPath(_item->_file.toUtf8());
|
||||
auto pin = propagator()->_journal->internalPinStates().rawForPath(virtualFile.toUtf8());
|
||||
if (pin && *pin != PinState::Inherited) {
|
||||
vfs->setPinState(virtualFile, *pin);
|
||||
vfs->setPinState(_item->_file, PinState::Inherited);
|
||||
vfs->setPinState(_item->_file, *pin);
|
||||
vfs->setPinState(virtualFile, PinState::Inherited);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1162,6 +1162,18 @@ private slots:
|
|||
QVERIFY(fakeFolder.syncOnce());
|
||||
QCOMPARE(*vfs->pinState("onlinerenamed2/file1rename"), PinState::OnlineOnly);
|
||||
QCOMPARE(*vfs->pinState("onlinerenamed2/file1rename" DVSUFFIX), PinState::OnlineOnly);
|
||||
|
||||
// When a file is hydrated or dehydrated due to pin state it retains its pin state
|
||||
vfs->setPinState("onlinerenamed2/file1rename" DVSUFFIX, PinState::AlwaysLocal);
|
||||
QVERIFY(fakeFolder.syncOnce());
|
||||
QVERIFY(fakeFolder.currentLocalState().find("onlinerenamed2/file1rename"));
|
||||
QCOMPARE(*vfs->pinState("onlinerenamed2/file1rename"), PinState::AlwaysLocal);
|
||||
|
||||
vfs->setPinState("onlinerenamed2", PinState::Unspecified);
|
||||
vfs->setPinState("onlinerenamed2/file1rename", PinState::OnlineOnly);
|
||||
QVERIFY(fakeFolder.syncOnce());
|
||||
QVERIFY(fakeFolder.currentLocalState().find("onlinerenamed2/file1rename" DVSUFFIX));
|
||||
QCOMPARE(*vfs->pinState("onlinerenamed2/file1rename" DVSUFFIX), PinState::OnlineOnly);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue