Diffstat (limited to 'examples/opiecore/onotifytest/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | examples/opiecore/onotifytest/main.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/opiecore/onotifytest/main.cpp b/examples/opiecore/onotifytest/main.cpp index b773da9..7b7b0bc 100644 --- a/examples/opiecore/onotifytest/main.cpp +++ b/examples/opiecore/onotifytest/main.cpp | |||
@@ -33,5 +33,8 @@ App::App( int argc, char** argv ) : QApplication( argc, argv ) | |||
33 | 33 | ||
34 | ODirNotification* tmpfoo = new ODirNotification( 0, 0 ); | 34 | tmpfoo = new ODirNotification( 0, 0 ); |
35 | 35 | ||
36 | int result = tmpfoo->watch( "/tmp/foo", false, CreateFile, 2 ); | 36 | int result = tmpfoo->watch( "/tmp/foo", false, CreateFile, 2 ); |
37 | |||
38 | if ( result != -1 ) | ||
39 | { | ||
37 | QObject::connect( tmpfoo, SIGNAL(triggered(const QString&,unsigned int,const QString&)), | 40 | QObject::connect( tmpfoo, SIGNAL(triggered(const QString&,unsigned int,const QString&)), |
@@ -39,2 +42,7 @@ App::App( int argc, char** argv ) : QApplication( argc, argv ) | |||
39 | } | 42 | } |
43 | else | ||
44 | { | ||
45 | QMessageBox::warning( qApp->desktop(), "info", "Couldn't watch /tmp/foo\nDoes it exist?" ); | ||
46 | } | ||
47 | } | ||
40 | 48 | ||
@@ -43,2 +51,3 @@ App::~App() | |||
43 | odebug << "~App()" << oendl; | 51 | odebug << "~App()" << oendl; |
52 | delete tmpfoo; | ||
44 | } | 53 | } |
@@ -47,3 +56,4 @@ void App::triggered( const QString& str1, unsigned int id, const QString& str2 ) | |||
47 | { | 56 | { |
48 | QMessageBox::information( qApp->desktop(), "info", QString( "%1\n%2\n%3" ).arg( str1 ).arg( id ).arg( str2 ) ); | 57 | QMessageBox::information( qApp->desktop(), "info", QString().sprintf( "%s\n0x%08x\n%s", |
58 | (const char*) str1, id, (const char*) str2 ) ); | ||
49 | } | 59 | } |