|
|
Watch directories for changes.
It uses stat
(2) and
compares stored and actual changed time of directories. If
there is a difference it notifies about the change. Directories can be
added, removed from the list and scanning of particular directories
can be stopped and restarted. The whole class can be stopped and
restarted. Directories can be added/removed from list in
any state.
When a watched directory is changed, KDirWatch will emit
the signal dirty().
If a watched directory gets deleted, KDirwatch will remove it from the list, and emit the signal deleted().
|
Constructor.
Does not begin scanning until startScan() is called. Default frequency is 500 ms. The created list of directories has deep copies.
~ |
Destructor.
Stops scanning and cleans up.
void |
Add a directory to the list of directories to be watched.
The list makes deep copies.
time_t |
Retrieve the time the directory was last changed.
void |
Remove a directory from the list of scanned directories.
If specified path is not in the list this does nothing.
bool |
Stop scanning the specified path.
The path
is not deleted from the interal just, it is just skipped.
Call this function when you perform an huge operation
on this directory (copy/move big files or many files). When finished,
call restartDirScan (path).
Returns false
if specified path is not in list, true
otherwise.
bool |
Restart scanning for specified path.
Resets ctime. It doesn't notify the change (by emitted a signal), since the ctime value is reset.
Call it when you are finished with big operations on that path,
and when you have refreshed that path. Returns false
if specified path is not in list, true
otherwise.
void |
Start scanning of all dirs in list.
If notify is true,
all changed directories (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
directories
in list will be notified. If
skippedToo
is true, the skipped directoris (scanning of which was
stopped with stopDirScan() ) will be reset and notified
for change. Otherwise, stopped directories will continue to be
unnotified.
void |
Stop scanning of all directories in internal list.
The timer is stopped, but the list is not cleared.
bool |
[const]
void |
signal fileDirty()
KDirWatch* |
[static]
void |
[signal]
Emitted when a directory is changed.
The new ctime is set before the signal is emited.
void |
[signal]
Emitted when KDirWatch learns that the file
_file
has changed.
This happens for instance when a .desktop file gets a new icon - but this isn't automatic, one has to call setFileDirty() for this signal to be emitted.
void |
[signal]
Emitted when directory is deleted.
When you receive this signal, the directory is not yet deleted from the list. You will receive this signal only once, because one directory cannot be deleted more than once. Please, forget the last^H^H^H^Hprevious sentence.
void |
[protected]
void |
[protected slot]
void |
[protected slot]