summaryrefslogtreecommitdiff
path: root/examples
Unidiff
Diffstat (limited to 'examples') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/opiecore/onotifytest/main.cpp33
-rw-r--r--examples/opiecore/onotifytest/main.h23
-rw-r--r--examples/opiecore/onotifytest/onotifytest.pro1
-rw-r--r--examples/opiecore/opcmciademo/main.cpp2
4 files changed, 46 insertions, 13 deletions
diff --git a/examples/opiecore/onotifytest/main.cpp b/examples/opiecore/onotifytest/main.cpp
index 467ebc9..8374c59 100644
--- a/examples/opiecore/onotifytest/main.cpp
+++ b/examples/opiecore/onotifytest/main.cpp
@@ -3,2 +3,4 @@
3 3
4#include "main.h"
5
4/* OPIE */ 6/* OPIE */
@@ -10,15 +12,12 @@ using namespace Opie::Core;
10/* QT */ 12/* QT */
13#include <qdir.h>
11#include <qpushbutton.h> 14#include <qpushbutton.h>
15#include <qstringlist.h>
12#include <qtextstream.h> 16#include <qtextstream.h>
17#include <qmessagebox.h>
13 18
14class App : public OApplication 19App::App( int argc, char** argv ) : QApplication( argc, argv )
15{
16
17public:
18OFile* tmpfoo;
19
20App( int argc, char** argv ) : OApplication( argc, argv, "libopie2 notify test" )
21{ 20{
22 odebug << "App()" << oendl; 21 odebug << "App()" << oendl;
23 22#if 0
24 tmpfoo = new OFile( "/tmp/foo" ); 23 tmpfoo = new OFile( "/tmp/foo" );
@@ -32,12 +31,20 @@ App( int argc, char** argv ) : OApplication( argc, argv, "libopie2 notify test"
32 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
33
34 ODirNotification* tmpfoo = new ODirNotification( 0, 0 );
35
36 int result = tmpfoo->watch( "/tmp/foo", false, CreateFile, 1 );
37 QObject::connect( tmpfoo, SIGNAL(triggered(const QString&,unsigned int,const QString&)),
38 this, SLOT(triggered(const QString&,unsigned int,const QString&)) );
33} 39}
34 40
35~App() 41App::~App()
36{ 42{
37 odebug << "~App()" << oendl; 43 odebug << "~App()" << oendl;
38
39 delete tmpfoo;
40} 44}
41 45
42}; 46void App::triggered( const QString& str1, unsigned int id, const QString& str2 )
47{
48 QMessageBox::information( qApp->desktop(), "info", QString( "%1\n%2\n%3" ).arg( str1 ).arg( id ).arg( str2 ) );
49}
43 50
@@ -47,3 +54,3 @@ int main( int argc, char** argv )
47 QPushButton* b = new QPushButton( "Click me to close", 0 ); 54 QPushButton* b = new QPushButton( "Click me to close", 0 );
48 QObject::connect( b, SIGNAL(clicked()), app, SLOT(quit()) ); 55 QObject::connect( b, SIGNAL(clicked()), qApp, SLOT(quit()) );
49 b->resize( 200, 200 ); 56 b->resize( 200, 200 );
diff --git a/examples/opiecore/onotifytest/main.h b/examples/opiecore/onotifytest/main.h
new file mode 100644
index 0000000..afad947
--- a/dev/null
+++ b/examples/opiecore/onotifytest/main.h
@@ -0,0 +1,23 @@
1// (C) Michael 'Mickey' Lauer <mickey@Vanille.de>
2// LICENSE = "GPLv2"
3
4#ifndef MAIN_H
5#define MAIN_H
6
7/* QT */
8#include <qapplication.h>
9#include <qpushbutton.h>
10#include <qtextstream.h>
11
12class App : public QApplication
13{
14 Q_OBJECT
15public:
16 App( int argc, char** argv );
17 ~App();
18
19public slots:
20 void triggered( const QString&, unsigned int, const QString& );
21};
22
23#endif
diff --git a/examples/opiecore/onotifytest/onotifytest.pro b/examples/opiecore/onotifytest/onotifytest.pro
index 4e0faec..51bda92 100644
--- a/examples/opiecore/onotifytest/onotifytest.pro
+++ b/examples/opiecore/onotifytest/onotifytest.pro
@@ -2,2 +2,3 @@ TEMPLATE = app
2CONFIG = qt warn_on 2CONFIG = qt warn_on
3HEADERS = main.h
3SOURCES = main.cpp 4SOURCES = main.cpp
diff --git a/examples/opiecore/opcmciademo/main.cpp b/examples/opiecore/opcmciademo/main.cpp
index 3ee22c2..dfc4287 100644
--- a/examples/opiecore/opcmciademo/main.cpp
+++ b/examples/opiecore/opcmciademo/main.cpp
@@ -17,2 +17,4 @@ int main( int argc, char** argv )
17 odebug << "card in socket # " << sock->number() << " is '" << sock->identity() << "'" << oendl; 17 odebug << "card in socket # " << sock->number() << " is '" << sock->identity() << "'" << oendl;
18 odebug << "card status is " << sock->status() << oendl;
19 odebug << "card function is " << sock->function() << oendl;
18 ++it; 20 ++it;