2018-07-23 23:11:24 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QFileSystemWatcher>
|
2023-08-02 17:35:35 +01:00
|
|
|
#include <QString>
|
2018-07-23 23:11:24 +01:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
struct WatchLock {
|
|
|
|
WatchLock(QFileSystemWatcher* watcher, const QString& directory) : m_watcher(watcher), m_directory(directory)
|
2018-07-23 23:11:24 +01:00
|
|
|
{
|
|
|
|
m_watcher->removePath(m_directory);
|
|
|
|
}
|
2023-08-02 17:35:35 +01:00
|
|
|
~WatchLock() { m_watcher->addPath(m_directory); }
|
|
|
|
QFileSystemWatcher* m_watcher;
|
2018-07-23 23:11:24 +01:00
|
|
|
QString m_directory;
|
|
|
|
};
|