From d0f6a0721d7ab67a115d08990143944ee71d54ba Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 02 Jun 2005 21:44:41 +0000 Subject: - move addLanguage.sh and mkipks to scripts/ directory - finish recursive directory locks and mention in ChangeLog beginning with `CVS:' are removed automatically CVS: CVS: Committing in . CVS: CVS: Modified Files: CVS: ChangeLog libopie2/opiecore/linux/ofilenotify.cpp CVS: libopie2/opiecore/linux/ofilenotify.h CVS: examples/opiecore/onotifytest/main.cpp CVS: examples/opiecore/onotifytest/main.h CVS: Added Files: CVS: scripts/addLanguage.sh scripts/mkipks CVS: ---------------------------------------------------------------------- --- (limited to 'examples') 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 @@ -31,21 +31,31 @@ App::App( int argc, char** argv ) : QApplication( argc, argv ) QObject::connect( tmpfoo, SIGNAL(closed(const QString&,bool)), this, SLOT(quit()) ); #endif - ODirNotification* tmpfoo = new ODirNotification( 0, 0 ); + tmpfoo = new ODirNotification( 0, 0 ); int result = tmpfoo->watch( "/tmp/foo", false, CreateFile, 2 ); - QObject::connect( tmpfoo, SIGNAL(triggered(const QString&,unsigned int,const QString&)), - this, SLOT(triggered(const QString&,unsigned int,const QString&)) ); + + if ( result != -1 ) + { + QObject::connect( tmpfoo, SIGNAL(triggered(const QString&,unsigned int,const QString&)), + this, SLOT(triggered(const QString&,unsigned int,const QString&)) ); + } + else + { + QMessageBox::warning( qApp->desktop(), "info", "Couldn't watch /tmp/foo\nDoes it exist?" ); + } } App::~App() { odebug << "~App()" << oendl; + delete tmpfoo; } void App::triggered( const QString& str1, unsigned int id, const QString& str2 ) { - QMessageBox::information( qApp->desktop(), "info", QString( "%1\n%2\n%3" ).arg( str1 ).arg( id ).arg( str2 ) ); + QMessageBox::information( qApp->desktop(), "info", QString().sprintf( "%s\n0x%08x\n%s", + (const char*) str1, id, (const char*) str2 ) ); } int main( int argc, char** argv ) diff --git a/examples/opiecore/onotifytest/main.h b/examples/opiecore/onotifytest/main.h index afad947..7ce4b9f 100644 --- a/examples/opiecore/onotifytest/main.h +++ b/examples/opiecore/onotifytest/main.h @@ -4,6 +4,9 @@ #ifndef MAIN_H #define MAIN_H +/* OPIE */ +#include + /* QT */ #include #include @@ -12,12 +15,15 @@ class App : public QApplication { Q_OBJECT -public: + public: App( int argc, char** argv ); ~App(); -public slots: + public slots: void triggered( const QString&, unsigned int, const QString& ); + + private: + Opie::Core::ODirNotification* tmpfoo; }; #endif -- cgit v0.9.0.2