From 5398d63dbd79eb166ab1c36517f60c6e850a2ca7 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Fri, 04 Feb 2005 16:36:03 +0000 Subject: improve coding style --- (limited to 'examples') diff --git a/examples/opiecore/onotifydemo/onotifydemo.cpp b/examples/opiecore/onotifydemo/onotifydemo.cpp index b9ff9db..a38ffee 100644 --- a/examples/opiecore/onotifydemo/onotifydemo.cpp +++ b/examples/opiecore/onotifydemo/onotifydemo.cpp @@ -1,3 +1,5 @@ +#include "onotifydemo.h" + /* OPIE */ #include #include @@ -16,11 +18,7 @@ using namespace Opie::Ui; #include #include -class DemoApp : public OApplication -{ - Q_OBJECT -public: - DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 notify demo" ) +DemoApp::DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 notify demo" ) { QVBox* vbox = new QVBox(); @@ -70,8 +68,7 @@ public: showMainWidget( vbox ); } -public: - void addTrigger( bool multi = false ) + void DemoApp::addTrigger( bool multi ) { if ( !m ) { @@ -100,12 +97,11 @@ public: } } -public slots: - void modifierClicked( int modifier ) { m = static_cast( (int)m ^ int(modifier) ); }; - void addSingle() { addTrigger(); }; - void addMulti() { addTrigger( true ); }; + void DemoApp::modifierClicked( int modifier ) { m = static_cast( (int)m ^ int(modifier) ); }; + void DemoApp::addSingle() { addTrigger(); }; + void DemoApp::addMulti() { addTrigger( true ); }; - void delTrigger() + void DemoApp::delTrigger() { QListViewItem* item = l->selectedItem(); if ( !item ) @@ -120,18 +116,11 @@ public slots: } } - void trigger() + void DemoApp::trigger() { owarn << "FIRE!" << oendl; } -private: - OListView* l; - QButtonGroup* g1; - QButtonGroup* g2; - OFileNotificationType m; -}; - int main( int argc, char** argv ) { DemoApp* app = new DemoApp( argc, argv ); @@ -141,4 +130,3 @@ int main( int argc, char** argv ) } -#include "moc/onotifydemo.moc" diff --git a/examples/opiecore/onotifydemo/onotifydemo.h b/examples/opiecore/onotifydemo/onotifydemo.h new file mode 100644 index 0000000..c4e3456 --- a/dev/null +++ b/examples/opiecore/onotifydemo/onotifydemo.h @@ -0,0 +1,29 @@ +/* OPIE */ +#include +#include +#include +#include + +class QButtonGroup; + +class DemoApp : public Opie::Core::OApplication +{ + Q_OBJECT +public: + DemoApp( int argc, char** argv ); + +public: + void addTrigger( bool multi = false ); +public slots: + void modifierClicked( int modifier ); + void addSingle(); + void addMulti(); + void delTrigger(); + void trigger(); + +private: + Opie::Ui::OListView* l; + QButtonGroup* g1; + QButtonGroup* g2; + Opie::Core::OFileNotificationType m; +}; diff --git a/examples/opiecore/onotifydemo/onotifydemo.pro b/examples/opiecore/onotifydemo/onotifydemo.pro index 1c1040c..8e7e487 100644 --- a/examples/opiecore/onotifydemo/onotifydemo.pro +++ b/examples/opiecore/onotifydemo/onotifydemo.pro @@ -1,6 +1,6 @@ TEMPLATE = app CONFIG = qt warn_on -HEADERS = +HEADERS = onotifydemo.h SOURCES = onotifydemo.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -- cgit v0.9.0.2