From 2c2cb135ca0474d154ae054c42bb1634ac10f622 Mon Sep 17 00:00:00 2001 From: Felix Date: Sat, 4 Jan 2025 16:06:03 +0100 Subject: [PATCH 1/2] Log path strings directly instead of accumulating Signed-off-by: Felix --- src/libsync/syncengine.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 368d0f8c899bd..30fa24115bb0f 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -1216,12 +1216,14 @@ void SyncEngine::setLocalDiscoveryOptions(LocalDiscoveryStyle style, std::set QString { - first += ", " + second; - return first; - }); - - qCInfo(lcEngine()) << "paths to discover locally" << allPaths; + if (lcEngine().isInfoEnabled()) { + // only execute if logging is enabled + auto debug = qInfo(lcEngine); + debug << "paths to discover locally"; + for (auto path : _localDiscoveryPaths) { + debug << path; + } + } // Normalize to make sure that no path is a contained in another. // Note: for simplicity, this code consider anything less than '/' as a path separator, so for From 1001a1dff4eff9b0592990dd2dfa796106f7f5bd Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 8 Jan 2025 13:45:41 +0100 Subject: [PATCH 2/2] Check if discovery paths are empty before logging Signed-off-by: Felix --- src/libsync/syncengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 30fa24115bb0f..8367dfa40796a 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -1216,7 +1216,7 @@ void SyncEngine::setLocalDiscoveryOptions(LocalDiscoveryStyle style, std::set