|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.core.QFileSystemWatcher
public class QFileSystemWatcher
The QFileSystemWatcher class provides an interface for monitoring files and directories for modifications.
QFileSystemWatcher monitors the file system for changes to files and directories by watching a list of specified paths.
Call addPath to watch a particular file or directory. Multiple paths can be added using the addPaths function. Existing paths can be removed by using the removePath and removePaths functions.
QFileSystemWatcher examines each path added to it. Files that have been added to the QFileSystemWatcher can be accessed using the files function, and directories using the directories function.
The fileChanged signal is emitted when a file has been modified or removed from disk. Similarly, the directoryChanged signal is emitted when a directory or its contents is modified or removed. Note that QFileSystemWatcher stops monitoring files and directories once they have been removed from disk.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary | |
---|---|
QSignalEmitter.Signal1<java.lang.String> |
directoryChanged
This signal is emitted when the directory at a specified path, is modified (e.g., when a file is added, modified or deleted) or removed from disk. |
QSignalEmitter.Signal1<java.lang.String> |
fileChanged
This signal is emitted when the file at the specified path is modified or removed from disk. |
Constructor Summary | |
---|---|
QFileSystemWatcher()
Equivalent to QFileSystemWatcher(0). |
|
QFileSystemWatcher(java.util.List<java.lang.String> paths)
Equivalent to QFileSystemWatcher(paths, 0). |
|
QFileSystemWatcher(java.util.List<java.lang.String> paths,
QObject parent)
Constructs a new file system watcher object with the given parent which monitors the specified paths list. |
|
QFileSystemWatcher(QObject parent)
Constructs a new file system watcher object with the given parent. |
Method Summary | |
---|---|
void |
addPath(java.lang.String file)
Adds file to the file system watcher if file exists. |
void |
addPaths(java.util.List<java.lang.String> files)
Adds each path in files to the file system watcher. |
java.util.List<java.lang.String> |
directories()
Returns a list of paths to directories that are being watched. |
java.util.List<java.lang.String> |
files()
Returns a list of paths to files that are being watched. |
static QFileSystemWatcher |
fromNativePointer(QNativePointer nativePointer)
This function returns the QFileSystemWatcher instance pointed to by nativePointer |
void |
removePath(java.lang.String file)
Removes the specified file from the file system watcher. |
void |
removePaths(java.util.List<java.lang.String> files)
Removes the specified files from the file system watcher. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1<java.lang.String> directoryChanged
This signal is emitted when the directory at a specified path, is modified (e.g., when a file is added, modified or deleted) or removed from disk. Note that if there are several changes during a short period of time, some of the changes might not emit this signal. However, the last change in the sequence of changes will always generate this signal.
public final QSignalEmitter.Signal1<java.lang.String> fileChanged
This signal is emitted when the file at the specified path is modified or removed from disk.
Constructor Detail |
---|
public QFileSystemWatcher()
Equivalent to QFileSystemWatcher(0).
public QFileSystemWatcher(QObject parent)
Constructs a new file system watcher object with the given parent.
public QFileSystemWatcher(java.util.List<java.lang.String> paths)
Equivalent to QFileSystemWatcher(paths, 0).
public QFileSystemWatcher(java.util.List<java.lang.String> paths, QObject parent)
Constructs a new file system watcher object with the given parent which monitors the specified paths list.
Method Detail |
---|
public final void addPath(java.lang.String file)
Adds file to the file system watcher if file exists. The path is not added if it does not exist, or if it is already being monitored by the file system watcher.
If file specifies a directory, the directoryChanged signal will be emitted when file is modified or removed from disk; otherwise the fileChanged signal is emitted when file is modified or removed.
public final void addPaths(java.util.List<java.lang.String> files)
Adds each path in files to the file system watcher. Paths are not added if they not exist, or if they are already being monitored by the file system watcher.
If a path specifies a directory, the directoryChanged signal will be emitted when the path is modified or removed from disk; otherwise the fileChanged signal is emitted when the path is modified or removed.
public final java.util.List<java.lang.String> directories()
Returns a list of paths to directories that are being watched.
public final java.util.List<java.lang.String> files()
Returns a list of paths to files that are being watched.
public final void removePath(java.lang.String file)
Removes the specified file from the file system watcher.
public final void removePaths(java.util.List<java.lang.String> files)
Removes the specified files from the file system watcher.
public static QFileSystemWatcher fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |