summaryrefslogtreecommitdiff
authortille <tille>2003-09-02 15:38:07 (UTC)
committer tille <tille>2003-09-02 15:38:07 (UTC)
commite87caebc920ad256d210eeb31aeb134318f0c104 (patch) (side-by-side diff)
tree2776167f9277b41cb03d4afbb5626ccb6a88b8ea
parentaa1be5c49b77368999f068222f5f4e1f0d1ace0d (diff)
downloadopie-e87caebc920ad256d210eeb31aeb134318f0c104.zip
opie-e87caebc920ad256d210eeb31aeb134318f0c104.tar.gz
opie-e87caebc920ad256d210eeb31aeb134318f0c104.tar.bz2
this should make oapplication compile (and run) for qt3/x11
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/examples.pro10
-rw-r--r--libopie2/examples/opiecore/oconfigdemo/oconfigdemo.pro8
-rw-r--r--libopie2/examples/opiecore/odebugdemo/odebugdemo.pro10
-rw-r--r--libopie2/examples/opieui/olistviewdemo/olistviewdemo.pro10
-rw-r--r--libopie2/opiecore/oapplication.cpp4
-rw-r--r--libopie2/opiecore/oapplication.h4
-rw-r--r--libopie2/opiecore/oconfig.cpp2
-rw-r--r--libopie2/opiecore/oconfig.h6
-rw-r--r--libopie2/opiecore/oglobal.cpp2
-rw-r--r--libopie2/opiecore/oglobal.h2
-rw-r--r--libopie2/opiecore/opieapplication.cpp48
-rw-r--r--libopie2/opiecore/opieapplication.h58
-rw-r--r--libopie2/opiecore/opieconfig.cpp69
-rw-r--r--libopie2/opiecore/opieconfig.h79
-rw-r--r--libopie2/opiecore/opiecore.pro14
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
@@ -1,4 +1,12 @@
TEMPLATE = subdirs
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
@@ -5,10 +5,16 @@ SOURCES = oconfigdemo.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lopiecore2
TARGET = oconfigdemo
MOC_DIR = moc
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
@@ -2,12 +2,18 @@ TEMPLATE = app
CONFIG = qt warn_on debug
HEADERS =
SOURCES = odebugdemo.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lopiecore2
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
@@ -5,11 +5,19 @@ SOURCES = olistviewdemo.cpp \
main.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lopieui2 -lopiecore2
TARGET = olistviewdemo
MOC_DIR = moc
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
@@ -49,17 +49,17 @@ class OApplicationPrivate
};
/**************************************************************************************************/
/* OApplication
/**************************************************************************************************/
OApplication::OApplication( int& argc, char** argv, const QCString& rAppName )
- :QPEApplication( argc, argv ),
+ :OpieApplication( argc, argv ),
_appname( rAppName ),
_config( 0 )
{
init();
}
OApplication::~OApplication()
@@ -103,17 +103,17 @@ void OApplication::init()
{
qFatal( "OApplication: Can't create more than one OApplication object. Aborting." );
}
}
void OApplication::showMainWidget( QWidget* widget, bool nomax )
{
- QPEApplication::showMainWidget( widget, nomax );
+ OpieApplication::showMainWidget( widget, nomax );
widget->setCaption( _appname );
}
void OApplication::setTitle( const QString& title ) const
{
if ( mainWidget() )
{
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
@@ -29,24 +29,24 @@
*/
#ifndef OAPPLICATION_H
#define OAPPLICATION_H
#define oApp OApplication::oApplication()
-#include <qpe/qpeapplication.h>
+#include "opieapplication.h"
class OApplicationPrivate;
class OConfig;
-class OApplication : public QPEApplication
+class OApplication : public OpieApplication
{
Q_OBJECT
public:
/**
* Constructor. Parses command-line arguments and sets the window caption.
*
* @param rAppName application name. Will be used for finding the
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
@@ -34,17 +34,17 @@
#include <qfont.h>
#include <qcolor.h>
/* OPIE */
#include <opie2/oconfig.h>
OConfig::OConfig( const QString &name, Domain domain )
- :Config( name, domain )
+ :OpieConfig( name, domain )
{
}
OConfig::~OConfig()
{
}
QColor OConfig::readColorEntry( const QString& key, const QColor* pDefault ) const
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
@@ -30,27 +30,27 @@
*/
#ifndef OCONFIG_H
#define OCONFIG_H
//FIXME: Implement for X11 or reuse libqpe/Config there also?
//FIXME: Or rather use QSettings also for libqpe?
-#include <qpe/config.h>
+#include "opieconfig.h"
class QColor;
class QFont;
/**
* A Configuration class based on the Qtopia @ref Config class
* featuring additional handling of color and font entries
*/
-class OConfig : public Config
+class OConfig : public OpieConfig
{
public:
/**
* Constructs a OConfig object with a @a name.
*/
OConfig( const QString &name, Domain domain = User );
/**
* Destructs the OConfig object.
@@ -58,17 +58,17 @@ class OConfig : public Config
* Writes back any dirty configuration entries, and destroys
* dynamically created objects.
*/
virtual ~OConfig();
/**
* @returns the name of the current group.
* The current group is used for searching keys and accessing entries.
*/
- const QString& group() { return git.key(); };
+ const QString& group() { return group(); };
/**
* @returns a @ref QColor entry or a @a default value if the key is not found.
*/
QColor readColorEntry( const QString& key, const QColor* pDefault ) const;
/**
* @returns a @ref QFont value or a @a default value if the key is not found.
*/
QFont readFontEntry( const QString& key, const QFont* pDefault ) const;
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
@@ -27,10 +27,10 @@
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <opie2/oglobal.h>
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
@@ -29,17 +29,17 @@
*/
#ifndef OGLOBAL_H
#define OGLOBAL_H
#include <qpe/global.h>
#include <opie2/oconfig.h>
-static OConfig globalconfig = OConfig( "global" );
+static OConfig *globalconfig = new OConfig( "global" );
//FIXME: Is it wise or even necessary to inherit OGlobal from Global?
// once we totally skip libqpe it should ideally swallow Global -zecke
class OGlobal : public Global
{
public:
// do we want to put that into OApplication as in KApplication -zecke
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
@@ -1,39 +1,43 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
-HEADERS = oconfig.h \
+HEADERS = oapplication.h \
+ opieapplication.h \
+ oconfig.h \
+ opieconfig.h \
ocompletionbase.h \
ocompletion.h \
odebug.h \
oglobal.h \
oglobalsettings.h \
osortablevaluelist.h
-SOURCES = oconfig.cpp \
+
+SOURCES = oapplication.cpp \
+ opieapplication.cpp \
+ oconfig.cpp \
+ opieconfig.cpp \
ocompletionbase.cpp \
ocompletion.cpp \
odebug.cpp \
oglobal.cpp \
oglobalsettings.cpp
INTERFACES =
TARGET = opiecore2
VERSION = 1.8.1
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
MOC_DIR = moc
OBJECTS_DIR = obj
!contains( platform, x11 ) {
- HEADERS += oapplication.h
- SOURCES += oapplication.cpp
LIBS = -lqpe
include ( $(OPIEDIR)/include.pro )
}
contains( platform, x11 ) {
- message( NOT building oapplication for X11 )
LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
}