From 11304d02942e9fa493e4e80943a828f9c65f6772 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Fri, 28 Mar 2003 15:11:52 +0000 Subject: skeleton and the start of libopie2, please read README, ROADMAP and STATUS and comment... --- (limited to 'libopie2/examples/opiecore/oconfigdemo') diff --git a/libopie2/examples/opiecore/oconfigdemo/.cvsignore b/libopie2/examples/opiecore/oconfigdemo/.cvsignore new file mode 100644 index 0000000..8f7300c --- a/dev/null +++ b/libopie2/examples/opiecore/oconfigdemo/.cvsignore @@ -0,0 +1,6 @@ +Makefile* +moc* +*moc +*.o +~* + diff --git a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp new file mode 100644 index 0000000..a3f8e10 --- a/dev/null +++ b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp @@ -0,0 +1,31 @@ +#include +#include +#include + +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; + +} + +//#include "moc/oconfigdemo.moc" diff --git a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro new file mode 100644 index 0000000..0109c57 --- a/dev/null +++ b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro @@ -0,0 +1,14 @@ +TEMPLATE = app +CONFIG = qt warn_on debug +HEADERS = +SOURCES = oconfigdemo.cpp + +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lopiecore2 +TARGET = oconfigdemo +MOC_DIR = moc +OBJECTS_DIR = obj + +include ( $(OPIEDIR)/include.pro ) + -- cgit v0.9.0.2