mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 21:35:47 +03:00
Propagate Remote mkdir: save the fileid to the database early
It's important so that if we delete or rename a diectory that is being uploaded, this is properly detected
This commit is contained in:
parent
168c89aba7
commit
3c26bfa618
2 changed files with 13 additions and 3 deletions
|
@ -88,8 +88,7 @@ void PropagateRemoteMkdir::slotMkcolJobFinished()
|
|||
_job = propfindJob;
|
||||
return;
|
||||
}
|
||||
|
||||
done(SyncFileItem::Success);
|
||||
success();
|
||||
}
|
||||
|
||||
void PropagateRemoteMkdir::propfindResult(const QVariantMap &result)
|
||||
|
@ -101,7 +100,7 @@ void PropagateRemoteMkdir::propfindResult(const QVariantMap &result)
|
|||
if (result.contains("id")) {
|
||||
_item._fileId = result["id"].toByteArray();
|
||||
}
|
||||
done(SyncFileItem::Success);
|
||||
success();
|
||||
}
|
||||
|
||||
void PropagateRemoteMkdir::propfindError()
|
||||
|
@ -111,6 +110,16 @@ void PropagateRemoteMkdir::propfindError()
|
|||
done(SyncFileItem::Success);
|
||||
}
|
||||
|
||||
void PropagateRemoteMkdir::success()
|
||||
{
|
||||
// save the file id already so we can detect rename or remove
|
||||
SyncJournalFileRecord record(_item, _propagator->_localDir + _item.destination());
|
||||
_propagator->_journal->setFileRecord(record);
|
||||
|
||||
done(SyncFileItem::Success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ private slots:
|
|||
void slotMkcolJobFinished();
|
||||
void propfindResult(const QVariantMap &);
|
||||
void propfindError();
|
||||
void success();
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue