mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-30 21:15:35 +00:00
21 lines
397 B
C
21 lines
397 B
C
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <QString>
|
||
|
#include <QFileSystemWatcher>
|
||
|
|
||
|
struct WatchLock
|
||
|
{
|
||
|
WatchLock(QFileSystemWatcher * watcher, const QString& directory)
|
||
|
: m_watcher(watcher), m_directory(directory)
|
||
|
{
|
||
|
m_watcher->removePath(m_directory);
|
||
|
}
|
||
|
~WatchLock()
|
||
|
{
|
||
|
m_watcher->addPath(m_directory);
|
||
|
}
|
||
|
QFileSystemWatcher * m_watcher;
|
||
|
QString m_directory;
|
||
|
};
|