author | tille <tille> | 2003-09-02 15:38:07 (UTC) |
---|---|---|
committer | tille <tille> | 2003-09-02 15:38:07 (UTC) |
commit | e87caebc920ad256d210eeb31aeb134318f0c104 (patch) (side-by-side diff) | |
tree | 2776167f9277b41cb03d4afbb5626ccb6a88b8ea /libopie2 | |
parent | aa1be5c49b77368999f068222f5f4e1f0d1ace0d (diff) | |
download | opie-e87caebc920ad256d210eeb31aeb134318f0c104.zip opie-e87caebc920ad256d210eeb31aeb134318f0c104.tar.gz opie-e87caebc920ad256d210eeb31aeb134318f0c104.tar.bz2 |
this should make oapplication compile (and run) for qt3/x11
-rw-r--r-- | libopie2/examples/examples.pro | 10 | ||||
-rw-r--r-- | libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro | 8 | ||||
-rw-r--r-- | libopie2/examples/opiecore/odebugdemo/odebugdemo.pro | 10 | ||||
-rw-r--r-- | libopie2/examples/opieui/olistviewdemo/olistviewdemo.pro | 10 | ||||
-rw-r--r-- | libopie2/opiecore/oapplication.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/oapplication.h | 4 | ||||
-rw-r--r-- | libopie2/opiecore/oconfig.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/oconfig.h | 6 | ||||
-rw-r--r-- | libopie2/opiecore/oglobal.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/oglobal.h | 2 | ||||
-rw-r--r-- | libopie2/opiecore/opieapplication.cpp | 48 | ||||
-rw-r--r-- | libopie2/opiecore/opieapplication.h | 58 | ||||
-rw-r--r-- | libopie2/opiecore/opieconfig.cpp | 69 | ||||
-rw-r--r-- | libopie2/opiecore/opieconfig.h | 79 | ||||
-rw-r--r-- | libopie2/opiecore/opiecore.pro | 14 |
15 files changed, 306 insertions, 20 deletions
diff --git a/libopie2/examples/examples.pro b/libopie2/examples/examples.pro index c1ed98e..b2d47b0 100644 --- a/libopie2/examples/examples.pro +++ b/libopie2/examples/examples.pro @@ -3,2 +3,10 @@ unix:SUBDIRS = opieui opienet opiecore opiemm opiedb -#include ( ../../../include.pro ) + +!contains( platform, x11 ) { + include ( $(OPIEDIR)/include.pro ) +} + +contains( platform, x11 ) { + LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib +} + diff --git a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro index 0109c57..9b59106 100644 --- a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro +++ b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro @@ -12,3 +12,9 @@ OBJECTS_DIR = obj -include ( $(OPIEDIR)/include.pro ) +!contains( platform, x11 ) { + include ( $(OPIEDIR)/include.pro ) +} + +contains( platform, x11 ) { + LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib +} diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro b/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro index 4cd815f..c52cd02 100644 --- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro +++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro @@ -9,5 +9,11 @@ TARGET = odebugdemo -include ( $(OPIEDIR)/include.pro ) - MOC_DIR = moc OBJECTS_DIR = obj + +!contains( platform, x11 ) { + include ( $(OPIEDIR)/include.pro ) +} + +contains( platform, x11 ) { + LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib +} diff --git a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.pro b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.pro index aabe733..99eb41a 100644 --- a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.pro +++ b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.pro @@ -12,4 +12,12 @@ OBJECTS_DIR = obj -include ( $(OPIEDIR)/include.pro ) + +!contains( platform, x11 ) { + include ( $(OPIEDIR)/include.pro ) +} + +contains( platform, x11 ) { + LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib +} + diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp index c3cacce..12f33cc 100644 --- a/libopie2/opiecore/oapplication.cpp +++ b/libopie2/opiecore/oapplication.cpp @@ -56,3 +56,3 @@ class OApplicationPrivate OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) - :QPEApplication( argc, argv ), + :OpieApplication( argc, argv ), _appname( rAppName ), @@ -110,3 +110,3 @@ void OApplication::showMainWidget( QWidget* widget, bool nomax ) { - QPEApplication::showMainWidget( widget, nomax ); + OpieApplication::showMainWidget( widget, nomax ); widget->setCaption( _appname ); diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h index 72a659e..da5b905 100644 --- a/libopie2/opiecore/oapplication.h +++ b/libopie2/opiecore/oapplication.h @@ -36,3 +36,3 @@ -#include <qpe/qpeapplication.h> +#include "opieapplication.h" @@ -43,3 +43,3 @@ class OConfig; -class OApplication : public QPEApplication +class OApplication : public OpieApplication { diff --git a/libopie2/opiecore/oconfig.cpp b/libopie2/opiecore/oconfig.cpp index 40edbc7..dc4d0b3 100644 --- a/libopie2/opiecore/oconfig.cpp +++ b/libopie2/opiecore/oconfig.cpp @@ -41,3 +41,3 @@ OConfig::OConfig( const QString &name, Domain domain ) - :Config( name, domain ) + :OpieConfig( name, domain ) { diff --git a/libopie2/opiecore/oconfig.h b/libopie2/opiecore/oconfig.h index 444d280..e7d3be6 100644 --- a/libopie2/opiecore/oconfig.h +++ b/libopie2/opiecore/oconfig.h @@ -37,3 +37,3 @@ -#include <qpe/config.h> +#include "opieconfig.h" @@ -47,3 +47,3 @@ class QFont; -class OConfig : public Config +class OConfig : public OpieConfig { @@ -65,3 +65,3 @@ class OConfig : public Config */ - const QString& group() { return git.key(); }; + const QString& group() { return group(); }; /** diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp index 2eb4108..f6071be 100644 --- a/libopie2/opiecore/oglobal.cpp +++ b/libopie2/opiecore/oglobal.cpp @@ -34,3 +34,3 @@ OConfig* OGlobal::config() { - return &globalconfig; + return globalconfig; } diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h index 34f211e..23cedde 100644 --- a/libopie2/opiecore/oglobal.h +++ b/libopie2/opiecore/oglobal.h @@ -36,3 +36,3 @@ -static OConfig globalconfig = OConfig( "global" ); +static OConfig *globalconfig = new OConfig( "global" ); diff --git a/libopie2/opiecore/opieapplication.cpp b/libopie2/opiecore/opieapplication.cpp new file mode 100644 index 0000000..7ff7b44 --- a/dev/null +++ b/libopie2/opiecore/opieapplication.cpp @@ -0,0 +1,48 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + + +#include "opieapplication.h" + +OpieApplication::OpieApplication( int& argc, char** argv) +#ifdef QWS + : QPEApplication(argc,argv) +#else + : QApplication(argc,argv) +#endif +{}; + +#ifndef QWS +void OpieApplication::showMainWidget( QWidget* widget, bool nomax ) +{ + setMainWidget( widget ); + widget->show(); +}; +#endif diff --git a/libopie2/opiecore/opieapplication.h b/libopie2/opiecore/opieapplication.h new file mode 100644 index 0000000..a864ee9 --- a/dev/null +++ b/libopie2/opiecore/opieapplication.h @@ -0,0 +1,58 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef OPIE_APPLICATION_H +#define OPIE_APPLICATION_H + +#ifdef QWS +#include <qpe/qpeapplication.h> +#else +#include <qapplication.h> +#endif + +class OpieApplication +#ifdef QWS +: public QPEApplication +#else +: public QApplication +#endif +{ + public: + OpieApplication( int& argc, char** argv ); + +#ifndef QWS + void showMainWidget( QWidget* widget, bool nomax=false ); +#endif +}; + + +#endif + + diff --git a/libopie2/opiecore/opieconfig.cpp b/libopie2/opiecore/opieconfig.cpp new file mode 100644 index 0000000..ac65977 --- a/dev/null +++ b/libopie2/opiecore/opieconfig.cpp @@ -0,0 +1,69 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + + +#include "opieconfig.h" + +OpieConfig::OpieConfig( const QString &name, Domain domain ) +#ifdef QWS + :Config( name, domain ) +{ +#else + :QSettings(Native), hasGroup(false) +{ + Scope s; + switch (domain) { + case File: s = QSettings::Global; + break; + case User: s = QSettings::User; + break; + } + setPath("libopie2", name, s ); +#endif +} + + +#ifndef QWS + +void OpieConfig::setGroup( const QString& key) +{ + if (hasGroup) endGroup(); + hasGroup = true; + beginGroup( key ); +}; + +bool OpieConfig::hasKey ( const QString & key ) const +{ + bool *ok; + readEntry( key, QString::null, ok ); + return *ok; +}; +#endif + diff --git a/libopie2/opiecore/opieconfig.h b/libopie2/opiecore/opieconfig.h new file mode 100644 index 0000000..011ac86 --- a/dev/null +++ b/libopie2/opiecore/opieconfig.h @@ -0,0 +1,79 @@ +/* + This file is part of the Opie Project + + (C) 2003 Patrick S. Vogt + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef OPIECONFIG_H +#define OPIECONFIG_H + + +#ifdef QWS +#include <qpe/config.h> +#else +#include <qsettings.h> +#endif + + +class OpieConfig +#ifdef QWS + : public Config +#else +: public QSettings +#endif +{ + + public: +#ifndef QWS + enum Domain { File, User }; +#endif + + OpieConfig( const QString&, Domain ); + +#ifndef QWS + void setGroup( const QString& key); + bool hasKey ( const QString & key ) const; +#endif + + /** + * @returns the name of the current group. + * The current group is used for searching keys and accessing entries. + */ + const QString& group() +#ifdef QWS + { return git.key(); }; +#else + { return group(); }; +#endif + +#ifndef QWS + private: + bool hasGroup; +#endif + +}; + +#endif // OPIECONFIG_H diff --git a/libopie2/opiecore/opiecore.pro b/libopie2/opiecore/opiecore.pro index 18c6986..fe5800e 100644 --- a/libopie2/opiecore/opiecore.pro +++ b/libopie2/opiecore/opiecore.pro @@ -3,3 +3,6 @@ CONFIG += qt warn_on debug DESTDIR = $(OPIEDIR)/lib -HEADERS = oconfig.h \ +HEADERS = oapplication.h \ + opieapplication.h \ + oconfig.h \ + opieconfig.h \ ocompletionbase.h \ @@ -11,3 +14,7 @@ HEADERS = oconfig.h \ -SOURCES = oconfig.cpp \ + +SOURCES = oapplication.cpp \ + opieapplication.cpp \ + oconfig.cpp \ + opieconfig.cpp \ ocompletionbase.cpp \ @@ -28,4 +35,2 @@ OBJECTS_DIR = obj !contains( platform, x11 ) { - HEADERS += oapplication.h - SOURCES += oapplication.cpp LIBS = -lqpe @@ -35,3 +40,2 @@ OBJECTS_DIR = obj contains( platform, x11 ) { - message( NOT building oapplication for X11 ) LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |