diff --git a/src/library/library.cpp b/src/library/library.cpp index 1f8d14322..45733f1d5 100644 --- a/src/library/library.cpp +++ b/src/library/library.cpp @@ -20,7 +20,6 @@ #include "librarymodel.h" #include "librarybackend.h" #include "core/database.h" -#include "core/filesystemwatcherinterface.h" #include "smartplaylists/generator.h" #include "smartplaylists/querygenerator.h" #include "smartplaylists/search.h" @@ -121,7 +120,6 @@ void Library::WatcherInitialised() { watcher->set_backend(backend_); watcher->set_task_manager(task_manager_); - watcher->set_filesystem_watcher(FileSystemWatcherInterface::Create()); connect(backend_, SIGNAL(DirectoryDiscovered(Directory,SubdirectoryList)), watcher, SLOT(AddDirectory(Directory,SubdirectoryList))); diff --git a/src/library/librarywatcher.cpp b/src/library/librarywatcher.cpp index a5f5ebf87..e373868dd 100644 --- a/src/library/librarywatcher.cpp +++ b/src/library/librarywatcher.cpp @@ -49,7 +49,7 @@ LibraryWatcher::LibraryWatcher(QObject* parent) : QObject(parent), backend_(NULL), task_manager_(NULL), - fs_watcher_(NULL), + fs_watcher_(FileSystemWatcherInterface::Create(this)), stop_requested_(false), scan_on_startup_(true), monitor_(true), @@ -695,9 +695,7 @@ void LibraryWatcher::ReloadSettings() { } if (!monitor_ && was_monitoring_before) { - if (fs_watcher_) { - fs_watcher_->Clear(); - } + fs_watcher_->Clear(); } else if (monitor_ && !was_monitoring_before) { // Add all directories to all QFileSystemWatchers again foreach (const DirData& data, watched_dirs_.values()) { diff --git a/src/library/librarywatcher.h b/src/library/librarywatcher.h index 72b69ca16..5fe943ef1 100644 --- a/src/library/librarywatcher.h +++ b/src/library/librarywatcher.h @@ -44,7 +44,6 @@ class LibraryWatcher : public QObject { void set_backend(LibraryBackend* backend) { backend_ = backend; } void set_task_manager(TaskManager* task_manager) { task_manager_ = task_manager; } - void set_filesystem_watcher(FileSystemWatcherInterface* watcher) { fs_watcher_ = watcher; } void set_device_name(const QString& device_name) { device_name_ = device_name; } void IncrementalScanAsync();