summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/ofilenotify.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie2/opiecore/ofilenotify.h b/libopie2/opiecore/ofilenotify.h
index bd2f9d0..d820f7c 100644
--- a/libopie2/opiecore/ofilenotify.h
+++ b/libopie2/opiecore/ofilenotify.h
@@ -87,64 +87,65 @@ enum OFileNotificationType { Single = 0x0000000,
87 * 87 *
88 * @author Michael 'Mickey' Lauer <mickey@vanille.de> 88 * @author Michael 'Mickey' Lauer <mickey@vanille.de>
89 * 89 *
90 **/ 90 **/
91 91
92class OFileNotification : public QObject 92class OFileNotification : public QObject
93{ 93{
94 Q_OBJECT 94 Q_OBJECT
95 95
96 public: 96 public:
97 OFileNotification( QObject* parent = 0, const char* name = 0 ); 97 OFileNotification( QObject* parent = 0, const char* name = 0 );
98 ~OFileNotification(); 98 ~OFileNotification();
99 /** 99 /**
100 * This static function calls a slot when an event with @a type happens to file @a path. 100 * This static function calls a slot when an event with @a type happens to file @a path.
101 * 101 *
102 * It is very convenient to use this function because you do not need to 102 * It is very convenient to use this function because you do not need to
103 * bother with a timerEvent or to create a local QTimer object. 103 * bother with a timerEvent or to create a local QTimer object.
104 * 104 *
105 * Example: 105 * Example:
106 * <pre> 106 * <pre>
107 * 107 *
108 * #include <opie2/oapplication.h> 108 * #include <opie2/oapplication.h>
109 * #include <opie2/onitify.h> 109 * #include <opie2/onitify.h>
110 * using namespace Opie::Core; 110 * using namespace Opie::Core;
111 * 111 *
112 * int main( int argc, char **argv ) 112 * int main( int argc, char **argv )
113 * { 113 * {
114 * OApplication a( argc, argv, "File Notification Example" ); 114 * OApplication a( argc, argv, "File Notification Example" );
115 * OFileNotification::singleShot( "/tmp/quit", &a, SLOT(quit()), Create ); 115 * OFileNotification::singleShot( "/tmp/quit", &a, SLOT(quit()), Create );
116 * ... // create and show your widgets 116 * ... // create and show your widgets
117 * return a.exec(); 117 * return a.exec();
118 * } 118 * }
119 * </pre>
119 * 120 *
120 * This sample program automatically terminates when the file "/tmp/quite" has been created. 121 * This sample program automatically terminates when the file "/tmp/quite" has been created.
121 * 122 *
122 * 123 *
123 * The @a receiver is the receiving object and the @a member is the slot. 124 * The @a receiver is the receiving object and the @a member is the slot.
124 **/ 125 **/
125 static void singleShot( const QString& path, QObject* receiver, const char* member, OFileNotificationType type = Modify ); 126 static void singleShot( const QString& path, QObject* receiver, const char* member, OFileNotificationType type = Modify );
126 /** 127 /**
127 * Starts to watch for @a type changes to @a path. Set @a sshot to True if you want to be notified only once. 128 * Starts to watch for @a type changes to @a path. Set @a sshot to True if you want to be notified only once.
128 * Note that in that case it may be more convenient to use @ref OFileNotification::singleShot() then. 129 * Note that in that case it may be more convenient to use @ref OFileNotification::singleShot() then.
129 **/ 130 **/
130 int start( const QString& path, bool sshot = false, OFileNotificationType type = Modify ); 131 int start( const QString& path, bool sshot = false, OFileNotificationType type = Modify );
131 /** 132 /**
132 * Stop watching for file events. 133 * Stop watching for file events.
133 **/ 134 **/
134 void stop(); 135 void stop();
135 /** 136 /**
136 * @returns the notification type as set by @ref start(). 137 * @returns the notification type as set by @ref start().
137 **/ 138 **/
138 OFileNotificationType type() const; 139 OFileNotificationType type() const;
139 /** 140 /**
140 * @returns the path to the file being watched by this instance. 141 * @returns the path to the file being watched by this instance.
141 **/ 142 **/
142 QString path() const; 143 QString path() const;
143 /** 144 /**
144 * @returns the UNIX file descriptor for the file being watched. 145 * @returns the UNIX file descriptor for the file being watched.
145 **/ 146 **/
146 int fileno() const; 147 int fileno() const;
147 /** 148 /**
148 * @returns if a file is currently being watched. 149 * @returns if a file is currently being watched.
149 **/ 150 **/
150 bool isActive() const; 151 bool isActive() const;