summaryrefslogtreecommitdiff
path: root/libopie2/examples/opiecore
Side-by-side diff
Diffstat (limited to 'libopie2/examples/opiecore') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp2
-rw-r--r--libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp2
-rw-r--r--libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp4
-rw-r--r--libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp4
4 files changed, 10 insertions, 2 deletions
diff --git a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp
index a3f8e10..6712870 100644
--- a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp
+++ b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp
@@ -1,28 +1,30 @@
#include <opie2/oapplication.h>
#include <opie2/oconfig.h>
#include <qpe/config.h>
+using namespace Opie::Core;
+
int main( int argc, char** argv )
{
OApplication* app = new OApplication( argc, argv, "MyConfigDemoApplication" );
OConfigGroupSaver c1( app->config(), "MyGroup" );
app->config()->writeEntry( "AnEntry", "InMyGroup" );
{
OConfigGroupSaver c2( c1.config(), "AnotherGroup" );
app->config()->writeEntry( "AnEntry", "InAnotherGroup" );
} // closing the scope returns to the last group
app->config()->writeEntry( "AnotherEntry", "InMyGroup" );
// do more stuff ...
// in this (special) case it is necessary to manually call OConfig::write() (see below)
app->config()->write();
// can't delete the app when using the OConfigGroupSaver on top level scope,
// because the destructor of the OConfigGroupSaver needs an application object
//delete app; // destructor deletes config which writes changes back to disk
return 0;
diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp
index e8bf04f..0b8e1fe 100644
--- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp
+++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp
@@ -1,43 +1,45 @@
/* QT */
#include <qvbox.h>
#include <qhbox.h>
#include <qvbuttongroup.h>
#include <qhbuttongroup.h>
#include <qlineedit.h>
#include <qradiobutton.h>
#include <qpushbutton.h>
/* OPIE */
#include <qpe/config.h>
#include <opie2/odebug.h>
#include <opie2/oapplication.h>
#include <opie2/oglobal.h>
#include <opie2/oglobalsettings.h>
+using namespace Opie::Core;
+
class DemoApp : public OApplication
{
Q_OBJECT
public:
DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" )
{
// you have access to your OApplication object via oApp
qDebug( "Process-wide OApplication object @ %0x", oApp );
// you have access to global settings via OGlobalSettings
int mode = OGlobalSettings::debugMode();
QVBox* vbox = new QVBox();
setMainWidget( vbox );
g = new QVButtonGroup( "Output Strategy", vbox );
QRadioButton* r0 = new QRadioButton( "file", g );
QRadioButton* r1 = new QRadioButton( "messagebox", g );
QRadioButton* r2 = new QRadioButton( "stderr", g );
QRadioButton* r3 = new QRadioButton( "syslog", g );
QRadioButton* r4 = new QRadioButton( "socket", g );
g->insert( r0, 0 );
g->insert( r1, 1 );
g->insert( r2, 2 );
diff --git a/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp b/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp
index 2f5220b..56f1a0b 100644
--- a/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp
+++ b/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp
@@ -1,13 +1,15 @@
#include <opie2/oglobalsettings.h>
-#include <iostream.h>
+#include <iostream>
+
+using namespace Opie::Core;
int main( int argc, char** argv )
{
printf( "current debugmode seems to be '%d'\n", OGlobalSettings::debugMode() );
printf( "output information for this mode is '%s'\n", (const char*) OGlobalSettings::debugOutput() );
return 0;
}
//#include "moc/oconfigdemo.moc"
diff --git a/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp b/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp
index 0abf53e..2193565 100644
--- a/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp
+++ b/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp
@@ -1,11 +1,13 @@
#include <opie2/oprocess.h>
-#include <iostream.h>
+#include <iostream>
+
+using namespace Opie::Core;
int main( int argc, char** argv )
{
printf( "my own PID seems to be '%d'\n", OProcess::processPID( "oprocessdemo" ) );
printf( "the PID of process 'Mickey' seems to be '%d'\n\n", OProcess::processPID( "Mickey" ) );
return 0;
}