|
|
@@ -199,13 +199,19 @@ void PropagateRemoteMove::slotMoveJobFinished()
|
|
|
|
|
|
void PropagateRemoteMove::finalize()
|
|
|
{
|
|
|
- SyncJournalFileRecord oldRecord;
|
|
|
- propagator()->_journal->getFileRecord(_item->_originalFile, &oldRecord);
|
|
|
+ // Retrieve old db data.
|
|
|
// if reading from db failed still continue hoping that deleteFileRecord
|
|
|
// reopens the db successfully.
|
|
|
// The db is only queried to transfer the content checksum from the old
|
|
|
// to the new record. It is not a problem to skip it here.
|
|
|
+ SyncJournalFileRecord oldRecord;
|
|
|
+ propagator()->_journal->getFileRecord(_item->_originalFile, &oldRecord);
|
|
|
+ auto &vfs = propagator()->syncOptions()._vfs;
|
|
|
+ auto pinState = vfs->pinState(_item->_originalFile);
|
|
|
+
|
|
|
+ // Delete old db data.
|
|
|
propagator()->_journal->deleteFileRecord(_item->_originalFile);
|
|
|
+ vfs->setPinState(_item->_originalFile, PinState::Inherited);
|
|
|
|
|
|
SyncFileItem newItem(*_item);
|
|
|
newItem._type = _item->_type;
|
|
|
@@ -222,6 +228,11 @@ void PropagateRemoteMove::finalize()
|
|
|
done(SyncFileItem::FatalError, tr("Error writing metadata to the database"));
|
|
|
return;
|
|
|
}
|
|
|
+ if (pinState && *pinState != PinState::Inherited
|
|
|
+ && !vfs->setPinState(newItem._renameTarget, *pinState)) {
|
|
|
+ done(SyncFileItem::NormalError, tr("Error setting pin state"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
if (_item->isDirectory()) {
|
|
|
propagator()->_renamedDirectories.insert(_item->_file, _item->_renameTarget);
|