OpenMS
|
Watcher that monitors file changes. More...
#include <OpenMS/SYSTEM/FileWatcher.h>
Signals | |
void | fileChanged (const String &) |
Delayed file change signal. More... | |
Public Member Functions | |
FileWatcher (QObject *parent=nullptr) | |
Constructor. More... | |
~FileWatcher () override | |
Destructor. More... | |
void | setDelayInSeconds (double delay) |
Sets the delay in seconds (default: 1s) More... | |
void | addFile (const String &path) |
Adds a file to the watcher. More... | |
void | removeFile (const String &path) |
removes a file from the watcher More... | |
Protected Slots | |
void | monitorFileChanged_ (const QString &name) |
Slot that is connected to the fileChanged signal in order to track the changes. More... | |
void | timerTriggered_ () |
Slot that is called when the delay is over. More... | |
Protected Attributes | |
std::map< QString, QString > | timers_ |
A map that links timer name and file. More... | |
double | delay_in_seconds_ |
Delay (seconds) More... | |
Watcher that monitors file changes.
This class can be used similar to QFileSystemWatcher. Additionally it offers a delayed fileChanged signal.
This behaviour is required for the following reason: Normally QFileSystemWatcher emits a signal every time a file is changed. This causes several signals for large files (one for each flush of the buffer).
FileWatcher | ( | QObject * | parent = nullptr | ) |
Constructor.
|
override |
Destructor.
|
inline |
Adds a file to the watcher.
References String::toQString().
Referenced by TOPPViewBase::addDataFile(), and TOPPViewBase::fileChanged_().
|
signal |
Delayed file change signal.
Referenced by TOPPViewBase::TOPPViewBase().
|
protectedslot |
Slot that is connected to the fileChanged signal in order to track the changes.
|
inline |
removes a file from the watcher
References String::toQString().
Referenced by TOPPViewBase::fileChanged_().
|
inline |
Sets the delay in seconds (default: 1s)
|
protectedslot |
Slot that is called when the delay is over.
|
protected |
Delay (seconds)
|
protected |
A map that links timer name and file.