summaryrefslogtreecommitdiff
authortille <tille>2003-09-02 15:38:07 (UTC)
committer tille <tille>2003-09-02 15:38:07 (UTC)
commite87caebc920ad256d210eeb31aeb134318f0c104 (patch) (unidiff)
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 @@
1TEMPLATE = subdirs 1TEMPLATE = subdirs
2unix:SUBDIRS = opieui opienet opiecore opiemm opiedb 2unix:SUBDIRS = opieui opienet opiecore opiemm opiedb
3 3
4#include ( ../../../include.pro ) 4
5!contains( platform, x11 ) {
6 include ( $(OPIEDIR)/include.pro )
7}
8
9contains( platform, x11 ) {
10 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
11}
12
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
@@ -10,5 +10,11 @@ TARGET = oconfigdemo
10MOC_DIR = moc 10MOC_DIR = moc
11OBJECTS_DIR = obj 11OBJECTS_DIR = obj
12 12
13include ( $(OPIEDIR)/include.pro ) 13!contains( platform, x11 ) {
14 include ( $(OPIEDIR)/include.pro )
15}
16
17contains( platform, x11 ) {
18 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
19}
14 20
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
@@ -7,7 +7,13 @@ DEPENDPATH += $(OPIEDIR)/include
7LIBS += -lopiecore2 7LIBS += -lopiecore2
8TARGET = odebugdemo 8TARGET = odebugdemo
9 9
10include ( $(OPIEDIR)/include.pro )
11
12MOC_DIR = moc 10MOC_DIR = moc
13OBJECTS_DIR = obj 11OBJECTS_DIR = obj
12
13!contains( platform, x11 ) {
14 include ( $(OPIEDIR)/include.pro )
15}
16
17contains( platform, x11 ) {
18 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
19}
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
@@ -10,6 +10,14 @@ TARGET = olistviewdemo
10MOC_DIR = moc 10MOC_DIR = moc
11OBJECTS_DIR = obj 11OBJECTS_DIR = obj
12 12
13include ( $(OPIEDIR)/include.pro )
14 13
15 14
15
16!contains( platform, x11 ) {
17 include ( $(OPIEDIR)/include.pro )
18}
19
20contains( platform, x11 ) {
21 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
22}
23
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
@@ -54,7 +54,7 @@ class OApplicationPrivate
54 54
55 55
56OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) 56OApplication::OApplication( int& argc, char** argv, const QCString& rAppName )
57 :QPEApplication( argc, argv ), 57 :OpieApplication( argc, argv ),
58 _appname( rAppName ), 58 _appname( rAppName ),
59 _config( 0 ) 59 _config( 0 )
60{ 60{
@@ -108,7 +108,7 @@ void OApplication::init()
108 108
109void OApplication::showMainWidget( QWidget* widget, bool nomax ) 109void OApplication::showMainWidget( QWidget* widget, bool nomax )
110{ 110{
111 QPEApplication::showMainWidget( widget, nomax ); 111 OpieApplication::showMainWidget( widget, nomax );
112 widget->setCaption( _appname ); 112 widget->setCaption( _appname );
113} 113}
114 114
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
@@ -34,14 +34,14 @@
34#define oApp OApplication::oApplication() 34#define oApp OApplication::oApplication()
35 35
36 36
37#include <qpe/qpeapplication.h> 37#include "opieapplication.h"
38 38
39 39
40class OApplicationPrivate; 40class OApplicationPrivate;
41class OConfig; 41class OConfig;
42 42
43 43
44class OApplication : public QPEApplication 44class OApplication : public OpieApplication
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
47 47
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
@@ -39,7 +39,7 @@
39#include <opie2/oconfig.h> 39#include <opie2/oconfig.h>
40 40
41OConfig::OConfig( const QString &name, Domain domain ) 41OConfig::OConfig( const QString &name, Domain domain )
42 :Config( name, domain ) 42 :OpieConfig( name, domain )
43{ 43{
44} 44}
45 45
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
@@ -35,7 +35,7 @@
35//FIXME: Implement for X11 or reuse libqpe/Config there also? 35//FIXME: Implement for X11 or reuse libqpe/Config there also?
36//FIXME: Or rather use QSettings also for libqpe? 36//FIXME: Or rather use QSettings also for libqpe?
37 37
38#include <qpe/config.h> 38#include "opieconfig.h"
39 39
40class QColor; 40class QColor;
41class QFont; 41class QFont;
@@ -45,7 +45,7 @@ class QFont;
45 * featuring additional handling of color and font entries 45 * featuring additional handling of color and font entries
46 */ 46 */
47 47
48class OConfig : public Config 48class OConfig : public OpieConfig
49{ 49{
50 public: 50 public:
51 /** 51 /**
@@ -63,7 +63,7 @@ class OConfig : public Config
63 * @returns the name of the current group. 63 * @returns the name of the current group.
64 * The current group is used for searching keys and accessing entries. 64 * The current group is used for searching keys and accessing entries.
65 */ 65 */
66 const QString& group() { return git.key(); }; 66 const QString& group() { return group(); };
67 /** 67 /**
68 * @returns a @ref QColor entry or a @a default value if the key is not found. 68 * @returns a @ref QColor entry or a @a default value if the key is not found.
69 */ 69 */
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
@@ -32,5 +32,5 @@
32 32
33OConfig* OGlobal::config() 33OConfig* OGlobal::config()
34{ 34{
35 return &globalconfig; 35 return globalconfig;
36} 36}
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
@@ -34,7 +34,7 @@
34#include <qpe/global.h> 34#include <qpe/global.h>
35#include <opie2/oconfig.h> 35#include <opie2/oconfig.h>
36 36
37static OConfig globalconfig = OConfig( "global" ); 37static OConfig *globalconfig = new OConfig( "global" );
38 38
39//FIXME: Is it wise or even necessary to inherit OGlobal from Global? 39//FIXME: Is it wise or even necessary to inherit OGlobal from Global?
40// once we totally skip libqpe it should ideally swallow Global -zecke 40// once we totally skip libqpe it should ideally swallow Global -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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31
32#include "opieapplication.h"
33
34OpieApplication::OpieApplication( int& argc, char** argv)
35#ifdef QWS
36 : QPEApplication(argc,argv)
37#else
38 : QApplication(argc,argv)
39#endif
40{};
41
42#ifndef QWS
43void OpieApplication::showMainWidget( QWidget* widget, bool nomax )
44{
45 setMainWidget( widget );
46 widget->show();
47};
48#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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#ifndef OPIE_APPLICATION_H
32#define OPIE_APPLICATION_H
33
34#ifdef QWS
35#include <qpe/qpeapplication.h>
36#else
37#include <qapplication.h>
38#endif
39
40class OpieApplication
41#ifdef QWS
42: public QPEApplication
43#else
44: public QApplication
45#endif
46{
47 public:
48 OpieApplication( int& argc, char** argv );
49
50#ifndef QWS
51 void showMainWidget( QWidget* widget, bool nomax=false );
52#endif
53};
54
55
56#endif
57
58
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 @@
1/*
2                 This file is part of the Opie Project
3
4              Copyright (C) 2003 Patrick S. Vogt <tille@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31
32#include "opieconfig.h"
33
34OpieConfig::OpieConfig( const QString &name, Domain domain )
35#ifdef QWS
36 :Config( name, domain )
37{
38#else
39 :QSettings(Native), hasGroup(false)
40{
41 Scope s;
42 switch (domain) {
43 case File: s = QSettings::Global;
44 break;
45 case User: s = QSettings::User;
46 break;
47 }
48 setPath("libopie2", name, s );
49#endif
50}
51
52
53#ifndef QWS
54
55void OpieConfig::setGroup( const QString& key)
56{
57 if (hasGroup) endGroup();
58 hasGroup = true;
59 beginGroup( key );
60};
61
62bool OpieConfig::hasKey ( const QString & key ) const
63{
64 bool *ok;
65 readEntry( key, QString::null, ok );
66 return *ok;
67};
68#endif
69
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 @@
1/*
2                 This file is part of the Opie Project
3
4 (C) 2003 Patrick S. Vogt
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28*/
29
30#ifndef OPIECONFIG_H
31#define OPIECONFIG_H
32
33
34#ifdef QWS
35#include <qpe/config.h>
36#else
37#include <qsettings.h>
38#endif
39
40
41class OpieConfig
42#ifdef QWS
43 : public Config
44#else
45: public QSettings
46#endif
47{
48
49 public:
50#ifndef QWS
51 enum Domain { File, User };
52#endif
53
54 OpieConfig( const QString&, Domain );
55
56#ifndef QWS
57 void setGroup( const QString& key);
58 bool hasKey ( const QString & key ) const;
59#endif
60
61 /**
62 * @returns the name of the current group.
63 * The current group is used for searching keys and accessing entries.
64 */
65 const QString& group()
66#ifdef QWS
67 { return git.key(); };
68#else
69 { return group(); };
70#endif
71
72#ifndef QWS
73 private:
74 bool hasGroup;
75#endif
76
77};
78
79#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,7 +1,10 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on debug 2CONFIG += qt warn_on debug
3DESTDIR = $(OPIEDIR)/lib 3DESTDIR = $(OPIEDIR)/lib
4HEADERS = oconfig.h \ 4HEADERS = oapplication.h \
5 opieapplication.h \
6 oconfig.h \
7 opieconfig.h \
5 ocompletionbase.h \ 8 ocompletionbase.h \
6 ocompletion.h \ 9 ocompletion.h \
7 odebug.h \ 10 odebug.h \
@@ -9,7 +12,11 @@ HEADERS = oconfig.h \
9 oglobalsettings.h \ 12 oglobalsettings.h \
10 osortablevaluelist.h 13 osortablevaluelist.h
11 14
12SOURCES = oconfig.cpp \ 15
16SOURCES = oapplication.cpp \
17 opieapplication.cpp \
18 oconfig.cpp \
19 opieconfig.cpp \
13 ocompletionbase.cpp \ 20 ocompletionbase.cpp \
14 ocompletion.cpp \ 21 ocompletion.cpp \
15 odebug.cpp \ 22 odebug.cpp \
@@ -26,14 +33,11 @@ OBJECTS_DIR = obj
26 33
27 34
28!contains( platform, x11 ) { 35!contains( platform, x11 ) {
29 HEADERS += oapplication.h
30 SOURCES += oapplication.cpp
31 LIBS = -lqpe 36 LIBS = -lqpe
32 include ( $(OPIEDIR)/include.pro ) 37 include ( $(OPIEDIR)/include.pro )
33} 38}
34 39
35contains( platform, x11 ) { 40contains( platform, x11 ) {
36 message( NOT building oapplication for X11 )
37 LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib 41 LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
38} 42}
39 43