summaryrefslogtreecommitdiff
path: root/examples
Unidiff
Diffstat (limited to 'examples') (more/less context) (show whitespace changes)
-rw-r--r--examples/opiecore/onotifytest/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/opiecore/onotifytest/main.cpp b/examples/opiecore/onotifytest/main.cpp
index 8374c59..b773da9 100644
--- a/examples/opiecore/onotifytest/main.cpp
+++ b/examples/opiecore/onotifytest/main.cpp
@@ -12,49 +12,49 @@ using namespace Opie::Core;
12/* QT */ 12/* QT */
13#include <qdir.h> 13#include <qdir.h>
14#include <qpushbutton.h> 14#include <qpushbutton.h>
15#include <qstringlist.h> 15#include <qstringlist.h>
16#include <qtextstream.h> 16#include <qtextstream.h>
17#include <qmessagebox.h> 17#include <qmessagebox.h>
18 18
19App::App( int argc, char** argv ) : QApplication( argc, argv ) 19App::App( int argc, char** argv ) : QApplication( argc, argv )
20{ 20{
21 odebug << "App()" << oendl; 21 odebug << "App()" << oendl;
22#if 0 22#if 0
23 tmpfoo = new OFile( "/tmp/foo" ); 23 tmpfoo = new OFile( "/tmp/foo" );
24 if ( tmpfoo->open( IO_ReadWrite ) ) 24 if ( tmpfoo->open( IO_ReadWrite ) )
25 { 25 {
26 QTextStream stream( tmpfoo ); 26 QTextStream stream( tmpfoo );
27 stream << "This is my content"; 27 stream << "This is my content";
28 } 28 }
29 29
30 QObject::connect( tmpfoo, SIGNAL(accessed(const QString&)), this, SLOT(quit()) ); 30 QObject::connect( tmpfoo, SIGNAL(accessed(const QString&)), this, SLOT(quit()) );
31 QObject::connect( tmpfoo, SIGNAL(closed(const QString&,bool)), this, SLOT(quit()) ); 31 QObject::connect( tmpfoo, SIGNAL(closed(const QString&,bool)), this, SLOT(quit()) );
32#endif 32#endif
33 33
34 ODirNotification* tmpfoo = new ODirNotification( 0, 0 ); 34 ODirNotification* tmpfoo = new ODirNotification( 0, 0 );
35 35
36 int result = tmpfoo->watch( "/tmp/foo", false, CreateFile, 1 ); 36 int result = tmpfoo->watch( "/tmp/foo", false, CreateFile, 2 );
37 QObject::connect( tmpfoo, SIGNAL(triggered(const QString&,unsigned int,const QString&)), 37 QObject::connect( tmpfoo, SIGNAL(triggered(const QString&,unsigned int,const QString&)),
38 this, SLOT(triggered(const QString&,unsigned int,const QString&)) ); 38 this, SLOT(triggered(const QString&,unsigned int,const QString&)) );
39} 39}
40 40
41App::~App() 41App::~App()
42{ 42{
43 odebug << "~App()" << oendl; 43 odebug << "~App()" << oendl;
44} 44}
45 45
46void App::triggered( const QString& str1, unsigned int id, const QString& str2 ) 46void App::triggered( const QString& str1, unsigned int id, const QString& str2 )
47{ 47{
48 QMessageBox::information( qApp->desktop(), "info", QString( "%1\n%2\n%3" ).arg( str1 ).arg( id ).arg( str2 ) ); 48 QMessageBox::information( qApp->desktop(), "info", QString( "%1\n%2\n%3" ).arg( str1 ).arg( id ).arg( str2 ) );
49} 49}
50 50
51int main( int argc, char** argv ) 51int main( int argc, char** argv )
52{ 52{
53 App* app = new App( argc, argv ); 53 App* app = new App( argc, argv );
54 QPushButton* b = new QPushButton( "Click me to close", 0 ); 54 QPushButton* b = new QPushButton( "Click me to close", 0 );
55 QObject::connect( b, SIGNAL(clicked()), qApp, SLOT(quit()) ); 55 QObject::connect( b, SIGNAL(clicked()), qApp, SLOT(quit()) );
56 b->resize( 200, 200 ); 56 b->resize( 200, 200 );
57 b->move( 150, 150 ); 57 b->move( 150, 150 );
58 b->show(); 58 b->show();
59 app->setMainWidget( b ); 59 app->setMainWidget( b );
60 app->exec(); 60 app->exec();