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@yahoo.fr>
Thu, 24 Nov 2022 11:07:59 +0000 (12:07 +0100)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/discoveryphase.h
src/libsync/syncengine.cpp

index f4bb42704c11fa4c1cd6daeff098b9519fbc986c..ea0edbbabb8529c6616a5b23a8ade325bf6b54f7 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 25ad7072efa1f8142a74c6307a3e431a06ea8c49..8f4025586755c854c7e37d836ef36a8e876da422 100644 (file)
@@ -568,7 +568,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) {