author | mickeyl <mickeyl> | 2005-05-07 00:55:52 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-05-07 00:55:52 (UTC) |
commit | 21a9e96cebeb6e729d129cd75544ac54ae4d09f4 (patch) (unidiff) | |
tree | 0b5737e5c9b0df8306f3faf5f30fd442ce0bc7c9 /examples | |
parent | 852f6cf4ff1c4010f998ee8cd68936e38001f032 (diff) | |
download | opie-21a9e96cebeb6e729d129cd75544ac54ae4d09f4.zip opie-21a9e96cebeb6e729d129cd75544ac54ae4d09f4.tar.gz opie-21a9e96cebeb6e729d129cd75544ac54ae4d09f4.tar.bz2 |
introduce OFileNotifyEvent and add more signals
-rw-r--r-- | examples/opiecore/onotifydemo/onotifydemo.cpp | 14 | ||||
-rw-r--r-- | examples/opiecore/onotifydemo/onotifydemo.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/examples/opiecore/onotifydemo/onotifydemo.cpp b/examples/opiecore/onotifydemo/onotifydemo.cpp index 2beda2a..e147c6a 100644 --- a/examples/opiecore/onotifydemo/onotifydemo.cpp +++ b/examples/opiecore/onotifydemo/onotifydemo.cpp | |||
@@ -100,20 +100,22 @@ DemoApp::DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 | |||
100 | { | 100 | { |
101 | if ( !multi ) | 101 | if ( !multi ) |
102 | { | 102 | { |
103 | success = OFileNotification::singleShot( filename, this, SLOT( unnamedTrigger() ), (OFileNotificationType) fntype ); | 103 | success = OFileNotification::singleShot( filename, this, SLOT(unnamedTrigger()), (OFileNotificationType) fntype ); |
104 | } | 104 | } |
105 | else | 105 | else |
106 | { | 106 | { |
107 | OFileNotification* fn = new OFileNotification(); | 107 | OFileNotification* fn = new OFileNotification(); |
108 | success = fn->watch( filename, false, (OFileNotificationType) fntype ); | 108 | success = fn->watch( filename, false, (OFileNotificationType) fntype ); |
109 | connect( fn, SIGNAL( triggered( const QString& ) ), this, SLOT( namedTrigger( const QString& ) ) ); | 109 | connect( fn, SIGNAL(triggered(const QString&,unsigned int,const QString&)), |
110 | } | 110 | this, SLOT(namedTrigger(const QString&,unsigned int,const QString&)) ); |
111 | } | ||
111 | } | 112 | } |
112 | else if ( QFileInfo( filename ).isDir() ) | 113 | else if ( QFileInfo( filename ).isDir() ) |
113 | { | 114 | { |
114 | ODirNotification* dn = new ODirNotification(); | 115 | ODirNotification* dn = new ODirNotification(); |
115 | success = dn->watch( filename, !multi, (OFileNotificationType) fntype ); | 116 | success = dn->watch( filename, !multi, (OFileNotificationType) fntype ); |
116 | connect( dn, SIGNAL( triggered( const QString& ) ), this, SLOT( namedTrigger( const QString& ) ) ); | 117 | connect( dn, SIGNAL(triggered(const QString&,unsigned int,const QString&)), |
118 | this, SLOT(namedTrigger(const QString&,unsigned int,const QString&)) ); | ||
117 | } | 119 | } |
118 | else | 120 | else |
119 | { | 121 | { |
@@ -162,9 +164,9 @@ DemoApp::DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 | |||
162 | owarn << "DemoApp::singleShotStrigger() : F I R E !!!!!" << oendl; | 164 | owarn << "DemoApp::singleShotStrigger() : F I R E !!!!!" << oendl; |
163 | } | 165 | } |
164 | 166 | ||
165 | void DemoApp::namedTrigger( const QString& path ) | 167 | void DemoApp::namedTrigger( const QString& path, unsigned int type, const QString& name ) |
166 | { | 168 | { |
167 | owarn << "DemoApp::named trigger = " << path << " : F I R E !!!!!" << oendl; | 169 | owarn << "DemoApp::named trigger = ( " << path << ", " << type << ", " << name << " ) : F I R E !!!!!" << oendl; |
168 | } | 170 | } |
169 | 171 | ||
170 | int main( int argc, char** argv ) | 172 | int main( int argc, char** argv ) |
diff --git a/examples/opiecore/onotifydemo/onotifydemo.h b/examples/opiecore/onotifydemo/onotifydemo.h index f6ac5ea..20019e4 100644 --- a/examples/opiecore/onotifydemo/onotifydemo.h +++ b/examples/opiecore/onotifydemo/onotifydemo.h | |||
@@ -20,7 +20,7 @@ public slots: | |||
20 | void addMulti(); | 20 | void addMulti(); |
21 | void delTrigger(); | 21 | void delTrigger(); |
22 | void unnamedTrigger(); | 22 | void unnamedTrigger(); |
23 | void namedTrigger( const QString& name ); | 23 | void namedTrigger( const QString&, unsigned int, const QString& ); |
24 | 24 | ||
25 | private: | 25 | private: |
26 | Opie::Ui::OListView* l; | 26 | Opie::Ui::OListView* l; |