123456789101112131415161718192021222324 |
- #include "filewatcher.h"
- FileWatcher::FileWatcher()
- {
- m_fileSystemWatcher = new QFileSystemWatcher(this);
- connect(m_fileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, [=](const QString& path)
- {
- emit sig_dirStateChange(path);
- });
- };
- bool FileWatcher::addPath(const QString& file)
- {
- return m_fileSystemWatcher->addPath(file);
- }
- FileWatcher::~FileWatcher()
- {
- if (m_fileSystemWatcher) {
- delete m_fileSystemWatcher;
- m_fileSystemWatcher = Q_NULLPTR;
- }
- };
|