[KDirWatch Index] [KDirWatch Hierarchy] [Headers]
Class for watching directory changes. More...
#include <kdirwatch.h>
Inherits: QObject (qt)
Class for watching directory changes. It uses stat (2) and compares stored and actual changed time of directories. If there is a difference notifies KFM for change. Directories can be aded, removed from the list and scanning of particular directories can be stoped and restarted. The whole class can be stoped and restarted. Directories can be added/removed from list in any state. There may be only one KDirWatch object in application. There is a static function that returns a pointer that object.
Constructor. Does not begin with scanning until startScan is called. Default frequency is 500 ms. The created list of directories has deep copies.
Destructor. Stops scanning and cleans up.
Adds directory to list of directories to be watched. (The list makes deep copies).
Removes directory from list of scanned directories. If specified url is not in the list, does nothing.
Stops scanning for specified url. Does not delete dir from list, just skips it. Call this function when you make an huge operation on this directory (copy/move big files or lot of files). When finished, call restartDirScan (url). Returns 'false' if specified url is not in list, 'true' otherwise.
Restarts scanning for specified url. Resets ctime. It doesn't notify the change, since ctime value is reset. Call it when you are finished with big operations on that url, *and* when *you* have refreshed that url. Returns 'false' if specified url is not in list, 'true' otherwise.
Starts scanning of all dirs in list. If notify is true, all changed dirs (since stopScan call) will be notified for refresh. If notify is false, all ctimes will be reset (except those who are stopped, but only if skippedToo is false) and changed dirs won't be notified. You can start scanning even if the list is empty. First call should be called with 'false' or else all dirs in list will be notified. Note that direcories that were. If 'skippedToo' is true, the skipped dirs, (scanning of which was stopped with stopDirScan ) will be reset and notified for change. Otherwise, stopped dirs will continue to be unnotified.
Stops scanning of all dirs in list. List is not cleared, just the timer is stopped.
Returns list of directories.
Static function that returns a pointer to dirwatcher.
| Kdoc |