improve logging of discovery policy decisions when scanning folders
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 17 Nov 2022 08:42:47 +0000 (09:42 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 17 Nov 2022 13:47:00 +0000 (14:47 +0100)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/discoveryphase.h
src/libsync/syncengine.cpp

index fc7b00578a9b268afd5e9baf88484fe69846d922..3cd4d9cbbd96cf236a46e9092e1eca3a0bc47555 100644 (file)
@@ -32,11 +32,20 @@ class ExcludedFiles;
 
 namespace OCC {
 
+namespace LocalDiscoveryEnums {
+
+OCSYNC_EXPORT Q_NAMESPACE
+
 enum class LocalDiscoveryStyle {
     FilesystemOnly, //< read all local data from the filesystem
     DatabaseAndFilesystem, //< read from the db, except for listed paths
 };
 
+Q_ENUM_NS(LocalDiscoveryStyle)
+
+}
+
+using OCC::LocalDiscoveryEnums::LocalDiscoveryStyle;
 
 class Account;
 class SyncJournalDb;
index 0aeb1a48b035423f19a158d0f22a8e6866953174..b47845e9a8c3c9694b418e1f76cae461c020d3b1 100644 (file)
@@ -586,7 +586,11 @@ void SyncEngine::startSync()
     if (!_discoveryPhase->_remoteFolder.endsWith('/'))
         _discoveryPhase->_remoteFolder+='/';
     _discoveryPhase->_syncOptions = _syncOptions;
-    _discoveryPhase->_shouldDiscoverLocaly = [this](const QString &s) { return shouldDiscoverLocally(s); };
+    _discoveryPhase->_shouldDiscoverLocaly = [this](const QString &s) {
+        const auto result = shouldDiscoverLocally(s);
+        qCInfo(lcEngine) << "shouldDiscoverLocaly" << s << (result ? "true" : "false");
+        return result;
+    };
     _discoveryPhase->setSelectiveSyncBlackList(selectiveSyncBlackList);
     _discoveryPhase->setSelectiveSyncWhiteList(_journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, &ok));
     if (!ok) {