author | tille <tille> | 2003-09-02 15:38:07 (UTC) |
---|---|---|
committer | tille <tille> | 2003-09-02 15:38:07 (UTC) |
commit | e87caebc920ad256d210eeb31aeb134318f0c104 (patch) (unidiff) | |
tree | 2776167f9277b41cb03d4afbb5626ccb6a88b8ea /libopie2/opiecore | |
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/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 |
11 files changed, 273 insertions, 15 deletions
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 | |||
56 | OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) | 56 | OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) |
57 | :QPEApplication( argc, argv ), | 57 | :OpieApplication( argc, argv ), |
58 | _appname( rAppName ), | 58 | _appname( rAppName ), |
@@ -110,3 +110,3 @@ void 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 ); |
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 @@ | |||
36 | 36 | ||
37 | #include <qpe/qpeapplication.h> | 37 | #include "opieapplication.h" |
38 | 38 | ||
@@ -43,3 +43,3 @@ class OConfig; | |||
43 | 43 | ||
44 | class OApplication : public QPEApplication | 44 | class OApplication : public OpieApplication |
45 | { | 45 | { |
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 @@ | |||
41 | OConfig::OConfig( const QString &name, Domain domain ) | 41 | OConfig::OConfig( const QString &name, Domain domain ) |
42 | :Config( name, domain ) | 42 | :OpieConfig( name, domain ) |
43 | { | 43 | { |
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 @@ | |||
37 | 37 | ||
38 | #include <qpe/config.h> | 38 | #include "opieconfig.h" |
39 | 39 | ||
@@ -47,3 +47,3 @@ class QFont; | |||
47 | 47 | ||
48 | class OConfig : public Config | 48 | class OConfig : public OpieConfig |
49 | { | 49 | { |
@@ -65,3 +65,3 @@ class OConfig : public Config | |||
65 | */ | 65 | */ |
66 | const QString& group() { return git.key(); }; | 66 | const QString& group() { return group(); }; |
67 | /** | 67 | /** |
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() | |||
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 | |||
@@ -36,3 +36,3 @@ | |||
36 | 36 | ||
37 | static OConfig globalconfig = OConfig( "global" ); | 37 | static OConfig *globalconfig = new OConfig( "global" ); |
38 | 38 | ||
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 | |||
34 | OpieApplication::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 | ||
43 | void 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 | |||
40 | class 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 | |||
34 | OpieConfig::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 | |||
55 | void OpieConfig::setGroup( const QString& key) | ||
56 | { | ||
57 | if (hasGroup) endGroup(); | ||
58 | hasGroup = true; | ||
59 | beginGroup( key ); | ||
60 | }; | ||
61 | |||
62 | bool 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 | |||
41 | class 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 | |||
@@ -3,3 +3,6 @@ CONFIG += qt warn_on debug | |||
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = oconfig.h \ | 4 | HEADERS = oapplication.h \ |
5 | opieapplication.h \ | ||
6 | oconfig.h \ | ||
7 | opieconfig.h \ | ||
5 | ocompletionbase.h \ | 8 | ocompletionbase.h \ |
@@ -11,3 +14,7 @@ HEADERS = oconfig.h \ | |||
11 | 14 | ||
12 | SOURCES = oconfig.cpp \ | 15 | |
16 | SOURCES = oapplication.cpp \ | ||
17 | opieapplication.cpp \ | ||
18 | oconfig.cpp \ | ||
19 | opieconfig.cpp \ | ||
13 | ocompletionbase.cpp \ | 20 | ocompletionbase.cpp \ |
@@ -28,4 +35,2 @@ OBJECTS_DIR = obj | |||
28 | !contains( platform, x11 ) { | 35 | !contains( platform, x11 ) { |
29 | HEADERS += oapplication.h | ||
30 | SOURCES += oapplication.cpp | ||
31 | LIBS = -lqpe | 36 | LIBS = -lqpe |
@@ -35,3 +40,2 @@ OBJECTS_DIR = obj | |||
35 | contains( platform, x11 ) { | 40 | contains( 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 |