Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "All files deleted" error upon modification of anything #6818

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/libsync/syncengine.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/libsync/syncengine.cpp

File src/libsync/syncengine.cpp does not conform to Custom style guidelines. (lines 340, 341, 342, 343, 344, 345, 346, 347, 348)
* Copyright (C) by Duncan Mac-Vicar P. <[email protected]>
* Copyright (C) by Klaas Freitag <[email protected]>
*
Expand Down Expand Up @@ -337,6 +337,19 @@
{
emit itemDiscovered(item);

_hasNoneFiles |= (item->_instruction == CSYNC_INSTRUCTION_NEW
|| item->_instruction == CSYNC_INSTRUCTION_UPDATE_METADATA
|| item->_instruction == CSYNC_INSTRUCTION_NONE
// If a file (or every file) has been renamed, it means not all files where deleted
|| item->_instruction == CSYNC_INSTRUCTION_RENAME
// An upload of an existing file means that the file was left unchanged on the server
// This counts as a NONE for detecting if all the files on the server were changed
|| ((item->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE
|| item->_instruction == CSYNC_INSTRUCTION_SYNC)
&& item->_direction == SyncFileItem::Up));

_hasRemoveFile |= item->_instruction == CSYNC_INSTRUCTION_REMOVE && !item->_isSelectiveSync;

if (Utility::isConflictFile(item->_file))
_seenConflictFiles.insert(item->_file);
if (item->_instruction == CSYNC_INSTRUCTION_UPDATE_METADATA && !item->isDirectory()) {
Expand Down Expand Up @@ -450,10 +463,8 @@
qCWarning(lcEngine) << "Could not update local metadata for file" << item->_file;
}
}
_hasNoneFiles = true;
return;
} else if (item->_instruction == CSYNC_INSTRUCTION_NONE) {
_hasNoneFiles = true;
_syncFileStatusTracker->slotCheckAndRemoveSilentlyExcluded(item->_file);
if (_account->capabilities().uploadConflictFiles() && Utility::isConflictFile(item->_file)) {
// For uploaded conflict files, files with no action performed on them should
Expand All @@ -464,17 +475,6 @@
item->_status = SyncFileItem::Conflict;
}
return;
} else if (item->_instruction == CSYNC_INSTRUCTION_REMOVE && !item->_isSelectiveSync) {
_hasRemoveFile = true;
} else if (item->_instruction == CSYNC_INSTRUCTION_RENAME) {
_hasNoneFiles = true; // If a file (or every file) has been renamed, it means not al files where deleted
} else if (item->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE
|| item->_instruction == CSYNC_INSTRUCTION_SYNC) {
if (item->_direction == SyncFileItem::Up) {
// An upload of an existing file means that the file was left unchanged on the server
// This counts as a NONE for detecting if all the files on the server were changed
_hasNoneFiles = true;
}
}

// check for blacklisting of this item.
Expand Down Expand Up @@ -859,7 +859,7 @@
const auto scriptExecutable = scriptArgs.takeFirst();
QProcess::execute(scriptExecutable, scriptArgs);
}
#else
#else
qCWarning(lcEngine) << "**** Attention: POST_UPDATE_SCRIPT installed, but not executed because compiled with NDEBUG";
#endif
}
Expand Down
Loading