From 0eabc75039f2a74cc1fac396e363db5ed3900b91 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Fri, 27 Nov 2020 12:00:46 +0100 Subject: [PATCH] Improve log message --- src/libsync/discovery.cpp | 7 +++---- src/libsync/discoveryphase.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 8c2ebc155..89bdf70ce 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -1224,11 +1224,11 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item) return true; } if (!perms.hasPermission(RemotePermissions::CanWrite)) { - qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file; item->_instruction = CSYNC_INSTRUCTION_CONFLICT; item->_errorString = tr("Not allowed to upload this file because it is read-only on the server, restoring"); item->_direction = SyncFileItem::Down; item->_isRestoration = true; + qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file << item->_errorString; // Take the things to write to the db from the "other" node (i.e: info from server). // Do a lookup into the csync remote tree to get the metadata we need to restore. qSwap(item->_size, item->_previousSize); @@ -1244,12 +1244,11 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item) forbiddenIt -= 1; if (forbiddenIt != _discoveryData->_forbiddenDeletes.end() && fileSlash.startsWith(forbiddenIt.key())) { - - qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file; item->_instruction = CSYNC_INSTRUCTION_NEW; item->_direction = SyncFileItem::Down; item->_isRestoration = true; item->_errorString = tr("Moved to invalid target, restoring"); + qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file << item->_errorString; return true; // restore sub items } const auto perms = item->_remotePerm; @@ -1258,11 +1257,11 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item) return true; } if (!perms.hasPermission(RemotePermissions::CanDelete)) { - qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file; item->_instruction = CSYNC_INSTRUCTION_NEW; item->_direction = SyncFileItem::Down; item->_isRestoration = true; item->_errorString = tr("Not allowed to remove, restoring"); + qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file << item->_errorString; return true; // (we need to recurse to restore sub items) } break; diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 24090197f..24b4fb155 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -173,7 +173,7 @@ QPair DiscoveryPhase::findAndCancelDeletedJob(const QString &o || ((*it)->_type == ItemTypeVirtualFile && instruction == CSYNC_INSTRUCTION_NEW) || ((*it)->_isRestoration && instruction == CSYNC_INSTRUCTION_NEW))) { - qCWarning(lcDiscovery) << "OC_ENFORCE(FAILING)"; + qCWarning(lcDiscovery) << "ENFORCE(FAILING)" << originalPath; qCWarning(lcDiscovery) << "instruction == CSYNC_INSTRUCTION_REMOVE" << (instruction == CSYNC_INSTRUCTION_REMOVE); qCWarning(lcDiscovery) << "((*it)->_type == ItemTypeVirtualFile && instruction == CSYNC_INSTRUCTION_NEW)" << ((*it)->_type == ItemTypeVirtualFile && instruction == CSYNC_INSTRUCTION_NEW); -- 2.30.2