#include </home/clem/local/src/opie/libopie2/opiecore/linux/ofilenotify.h>
Collaboration diagram for Opie::Core::OFileNotification:

Signals | |
| void | triggered (const QString &, unsigned int, const QString &) |
| void | accessed (const QString &) |
| void | modified (const QString &) |
| void | attributed (const QString &) |
| void | closed (const QString &, bool) |
| void | opened (const QString &) |
| void | movedTo (const QString &, const QString &) |
| void | movedFrom (const QString &, const QString &) |
| void | deletedSubdir (const QString &, const QString &) |
| void | deletedFile (const QString &, const QString &) |
| void | createdSubdir (const QString &, const QString &) |
| void | createdFile (const QString &, const QString &) |
| void | deleted (const QString &) |
| void | unmounted (const QString &) |
Public Member Functions | |
| OFileNotification (QObject *parent=0, const char *name=0) | |
| ~OFileNotification () | |
| int | watch (const QString &path, bool sshot=false, OFileNotificationType type=Modify) |
| void | stop () |
| OFileNotificationType | type () const |
| QString | path () const |
| bool | isSingleShot () const |
| bool | isActive () const |
| int | startWatching (const QString &path, bool sshot=false, OFileNotificationType type=Modify) |
Static Public Member Functions | |
| static bool | singleShot (const QString &path, QObject *receiver, const char *member, OFileNotificationType type=Modify) |
Protected Member Functions | |
| bool | activate (const OFileNotificationEvent *e) |
Private Slots | |
| void | inotifyEventHandler () |
Private Member Functions | |
| bool | registerEventHandler () |
| void | unregisterEventHandler () |
Private Attributes | |
| QString | _path |
| OFileNotificationType | _type |
| QSignal | _signal |
| bool | _active |
| bool | _multi |
| int | _wd |
Static Private Attributes | |
| static QSocketNotifier * | _sn |
| static int | _fd = -1 |
Friends | |
| class | OFileNotificationEvent |
This class allows to watch for events happening to files. It uses the inotify linux (2.6.x) kernel interface.
Definition at line 149 of file ofilenotify.h.
|
||||||||||||
|
Definition at line 135 of file ofilenotify.cpp. References qDebug(). Referenced by singleShot(). |
|
|
Definition at line 142 of file ofilenotify.cpp. |
|
|
Referenced by activate(). |
|
|
|
Referenced by activate(). |
|
||||||||||||
|
Referenced by activate(). |
|
||||||||||||
|
Referenced by activate(). |
|
||||||||||||
|
Referenced by activate(). |
|
|
Referenced by activate(). |
|
||||||||||||
|
Referenced by activate(). |
|
||||||||||||
|
Referenced by activate(). |
|
|
Definition at line 285 of file ofilenotify.cpp. References _fd, inotify_event::cookie, inotify_event::len, inotify_event::mask, inotify_event::name, OFileNotificationEvent, qDebug(), and inotify_event::wd. Referenced by registerEventHandler(). |
|
|
Definition at line 149 of file ofilenotify.cpp. References _active. |
|
|
Definition at line 229 of file ofilenotify.cpp. References _multi. Referenced by Opie::Core::ODirNotification::subdirCreated(). |
|
|
Referenced by activate(). |
|
||||||||||||
|
Referenced by activate(). |
|
||||||||||||
|
Referenced by activate(). |
|
|
Referenced by activate(). |
|
|
Definition at line 223 of file ofilenotify.cpp. References _path. Referenced by Opie::Core::ODirNotification::subdirCreated(). |
|
|
Definition at line 317 of file ofilenotify.cpp. References _fd, _sn, INOTIFY_DEVICE, inotifyEventHandler(), qDebug(), and qWarning(). Referenced by startWatching(). |
|
||||||||||||||||||||
|
This static function calls a slot when an event with type happens to file path. It is very convenient to use this function because you do not need to bother with a timerEvent or to create a local QTimer object. Example:
#include <opie2/oapplication.h>
#include <opie2/ofilenotify.h>
using namespace Opie::Core;
int main( int argc, char **argv ) { OApplication a( argc, argv, "File Notification Example" ); OFileNotification::singleShot( "/tmp/quit", &a, SLOT(quit()), Access ); ... // create and show your widgets return a.exec(); } This sample program automatically terminates when the file "/tmp/quit" has been accessed. The receiver is the receiving object and the member is the slot. Definition at line 277 of file ofilenotify.cpp. References _signal, OFileNotification(), and watch(). |
|
||||||||||||||||
|
For internal use only.
Definition at line 174 of file ofilenotify.cpp. References _active, _fd, _multi, _path, _type, _wd, INOTIFY_WATCH, QIntDict< type >::insert(), QIntDict< type >::isEmpty(), inotify_watch_request::name, qDebug(), qWarning(), and registerEventHandler(). Referenced by Opie::Core::ODirNotification::watch(), and watch(). |
|
|
Stop watching for file events. Definition at line 204 of file ofilenotify.cpp. References _active, _path, _wd, QIntDict< type >::isEmpty(), QString::null, QIntDict< type >::remove(), and unregisterEventHandler(). Referenced by activate(), and ~OFileNotification(). |
|
||||||||||||||||
|
Referenced by activate(). |
|
|
Definition at line 217 of file ofilenotify.cpp. References _type. Referenced by Opie::Core::ODirNotification::subdirCreated(). |
|
|
Referenced by activate(). |
|
|
Definition at line 334 of file ofilenotify.cpp. References _fd, _sn, and qDebug(). Referenced by stop(). |
|
||||||||||||||||
|
Starts to watch for type changes to path. Set sshot to True if you want to be notified only once. Note that in that case it may be more convenient to use OFileNotification::singleShot() then. Definition at line 155 of file ofilenotify.cpp. References qWarning(), and startWatching(). Referenced by DemoApp::addTrigger(), and singleShot(). |
|
|
Definition at line 249 of file ofilenotify.h. Referenced by inotifyEventHandler(). |
|
|
Definition at line 243 of file ofilenotify.h. Referenced by isActive(), startWatching(), and stop(). |
|
|
Definition at line 54 of file ofilenotify.cpp. Referenced by inotifyEventHandler(), registerEventHandler(), startWatching(), and unregisterEventHandler(). |
|
|
Definition at line 244 of file ofilenotify.h. Referenced by activate(), isSingleShot(), and startWatching(). |
|
|
Definition at line 240 of file ofilenotify.h. Referenced by activate(), path(), startWatching(), and stop(). |
|
|
Definition at line 242 of file ofilenotify.h. Referenced by activate(), and singleShot(). |
|
|
Definition at line 53 of file ofilenotify.cpp. Referenced by registerEventHandler(), and unregisterEventHandler(). |
|
|
Definition at line 241 of file ofilenotify.h. Referenced by startWatching(), and type(). |
|
|
Definition at line 246 of file ofilenotify.h. Referenced by startWatching(), and stop(). |
1.4.2