From 84e7cd0df83d925bb5e3cfc52c1879e090358e18 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 3 May 2023 01:17:10 +0200 Subject: [PATCH] CollectionWatcher: Connect PathChanged signal once --- src/collection/collectionwatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collection/collectionwatcher.cpp b/src/collection/collectionwatcher.cpp index 6def589aa..d9b7e9454 100644 --- a/src/collection/collectionwatcher.cpp +++ b/src/collection/collectionwatcher.cpp @@ -108,6 +108,7 @@ CollectionWatcher::CollectionWatcher(Song::Source source, QObject *parent) ReloadSettings(); + QObject::connect(fs_watcher_, &FileSystemWatcherInterface::PathChanged, this, &CollectionWatcher::DirectoryChanged, Qt::UniqueConnection); QObject::connect(rescan_timer_, &QTimer::timeout, this, &CollectionWatcher::RescanPathsNow); QObject::connect(periodic_scan_timer_, &QTimer::timeout, this, &CollectionWatcher::IncrementalScanCheck); @@ -916,7 +917,6 @@ void CollectionWatcher::AddWatch(const CollectionDirectory &dir, const QString & if (!QFile::exists(path)) return; - QObject::connect(fs_watcher_, &FileSystemWatcherInterface::PathChanged, this, &CollectionWatcher::DirectoryChanged, Qt::UniqueConnection); fs_watcher_->AddPath(path); subdir_mapping_[path] = dir;