Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Signals | Public Member Functions | Protected Slots | Protected Attributes

FileWatcher Class Reference
[System]

Watcher that monitors file changes. More...

#include <OpenMS/SYSTEM/FileWatcher.h>

Inheritance diagram for FileWatcher:
QFileSystemWatcher

List of all members.

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).

Detailed Description

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).


Constructor & Destructor Documentation

FileWatcher ( QObject parent = 0  ) 

Constructor.

virtual ~FileWatcher (  )  [virtual]

Destructor.


Member Function Documentation

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.


Member Data Documentation

Delay (seconds).

Referenced by FileWatcher::setDelayInSeconds().

Map<QString, QString> timers_ [protected]

A map that links timer name and file.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:56 using doxygen 1.7.1