diff --git a/src/core/qtfslistener.cpp b/src/core/qtfslistener.cpp index f09936861..22bdfe911 100644 --- a/src/core/qtfslistener.cpp +++ b/src/core/qtfslistener.cpp @@ -23,6 +23,7 @@ #include #include +#include "core/logging.h" #include "filesystemwatcherinterface.h" #include "qtfslistener.h" @@ -32,11 +33,25 @@ QtFSListener::QtFSListener(QObject *parent) : FileSystemWatcherInterface(parent) } -void QtFSListener::AddPath(const QString &path) { watcher_.addPath(path); } +void QtFSListener::AddPath(const QString &path) { -void QtFSListener::RemovePath(const QString &path) { watcher_.removePath(path); } + if (!watcher_.addPath(path)) { + qLog(Error) << "Failed to add watch for path" << path; + } + +} + +void QtFSListener::RemovePath(const QString &path) { + + if (!watcher_.removePath(path)) { + qLog(Error) << "Failed to remove watch for path" << path; + } + +} void QtFSListener::Clear() { + watcher_.removePaths(watcher_.directories()); watcher_.removePaths(watcher_.files()); + }