mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Fix MOVE of directory.
Remove the right entry from the database (i.e: the original file name) Fetch the etags of the sub entries
This commit is contained in:
parent
cb8006b89f
commit
0efbfb10aa
@ -483,7 +483,7 @@ void CSyncThread::transferCompleted(const SyncFileItem &item)
|
||||
/* Update the database */
|
||||
|
||||
if (item._instruction == CSYNC_INSTRUCTION_DELETED) {
|
||||
_journal->deleteFileRecord(item._file);
|
||||
_journal->deleteFileRecord(item._originalFile);
|
||||
if (!item._renameTarget.isEmpty()) {
|
||||
SyncJournalFileRecord record(item, _localPath + item._renameTarget);
|
||||
record._path = item._renameTarget;
|
||||
|
||||
@ -645,8 +645,16 @@ csync_instructions_e OwncloudPropagator::downloadFile(const SyncFileItem &item,
|
||||
csync_instructions_e OwncloudPropagator::remoteRename(const SyncFileItem &item)
|
||||
{
|
||||
if (item._file == item._renameTarget) {
|
||||
if (!item._isDirectory) {
|
||||
// The parents has been renamed already so there is nothing more to do.
|
||||
// But we still need to fetch the new ETAG
|
||||
// FIXME maybe do a recusrsive propfind after having moced the parent.
|
||||
// Note: we also update the mtime because the server do not keep the mtime when moving files
|
||||
QScopedPointer<char, QScopedPointerPodDeleter> uri2(ne_path_escape((_remoteDir + item._renameTarget).toUtf8()));
|
||||
updateMTimeAndETag(uri2.data(), item._modtime);
|
||||
}
|
||||
_status = SyncFileItem::Success;
|
||||
return CSYNC_INSTRUCTION_DELETED; // nothing to do;
|
||||
return CSYNC_INSTRUCTION_DELETED;
|
||||
}
|
||||
|
||||
// Check if it is the toplevel Shared folder and do not propagate it.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user