Watcher that monitors file changes. More...
#include <OpenMS/SYSTEM/FileWatcher.h>
Signals | |
| void | fileChanged (const String &) |
| Delayed file change signal. | |
Public Member Functions | |
| FileWatcher (QObject *parent=0) | |
| Constructor. | |
| virtual | ~FileWatcher () |
| Destructor. | |
| void | setDelayInSeconds (DoubleReal delay) |
| Sets the delay in seconds (default: 1s). | |
| void | addFile (const String &path) |
| Adds a file to the watcher. | |
| void | removeFile (const String &path) |
| removes a file from the watcher | |
Protected Slots | |
| void | monitorFileChanged_ (const QString &name) |
| Slot that is connected to the fileChanged signal in order to track the changes. | |
| void | timerTriggered_ () |
| Slot that is called when the delay is over. | |
Protected Attributes | |
| Map< QString, QString > | timers_ |
| A map that links timer name and file. | |
| DoubleReal | delay_in_seconds_ |
| Delay (seconds). | |
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 = 0 |
) |
Constructor.
| virtual ~FileWatcher | ( | ) | [virtual] |
Destructor.
| void addFile | ( | const String & | path | ) | [inline] |
Adds a file to the watcher.
References String::toQString().
Referenced by TOPPViewBase::addDataFile(), and TOPPViewBase::fileChanged_().
| void fileChanged | ( | const String & | ) | [signal] |
Delayed file change signal.
| void monitorFileChanged_ | ( | const QString & | name | ) | [protected, slot] |
Slot that is connected to the fileChanged signal in order to track the changes.
| void removeFile | ( | const String & | path | ) | [inline] |
removes a file from the watcher
References String::toQString().
Referenced by TOPPViewBase::fileChanged_().
| void setDelayInSeconds | ( | DoubleReal | delay | ) | [inline] |
Sets the delay in seconds (default: 1s).
References FileWatcher::delay_in_seconds_.
| void timerTriggered_ | ( | ) | [protected, slot] |
Slot that is called when the delay is over.
DoubleReal delay_in_seconds_ [protected] |
Delay (seconds).
Referenced by FileWatcher::setDelayInSeconds().
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:56 using doxygen 1.7.1 |