author | mickeyl <mickeyl> | 2003-05-01 18:55:39 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-01 18:55:39 (UTC) |
commit | 8266da96576ad43a768da37000cef4e8eba000ac (patch) (unidiff) | |
tree | 904f07a06eb9e18e650c123bad8e901a5da56bf1 | |
parent | 95e533a6ac257d3b95cd8905660008fb7dcd33f1 (diff) | |
download | opie-8266da96576ad43a768da37000cef4e8eba000ac.zip opie-8266da96576ad43a768da37000cef4e8eba000ac.tar.gz opie-8266da96576ad43a768da37000cef4e8eba000ac.tar.bz2 |
remove stupid approach to encapsulate X11/Embedded differences into OApplication
thanks to zecke reminding me (once again) that moc does not preprocess...
if I ever forget it again, I owe you a beer :-)
-rw-r--r-- | libopie2/opiecore/oapplication.cpp | 13 | ||||
-rw-r--r-- | libopie2/opiecore/oapplication.h | 46 |
2 files changed, 8 insertions, 51 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp index ce26420..7a6c174 100644 --- a/libopie2/opiecore/oapplication.cpp +++ b/libopie2/opiecore/oapplication.cpp | |||
@@ -52,3 +52,3 @@ class OApplicationPrivate | |||
52 | OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) | 52 | OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) |
53 | :OApplicationBaseClass( argc, argv ), | 53 | :QPEApplication( argc, argv ), |
54 | _appname( rAppName ), | 54 | _appname( rAppName ), |
@@ -95,16 +95,5 @@ void OApplication::init() | |||
95 | 95 | ||
96 | void OApplication::setMainWidget( QWidget* widget ) | ||
97 | { | ||
98 | showMainWidget( widget ); | ||
99 | } | ||
100 | |||
101 | |||
102 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) | 96 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) |
103 | { | 97 | { |
104 | #ifdef Q_WS_QWS | ||
105 | QPEApplication::showMainWidget( widget, nomax ); | 98 | QPEApplication::showMainWidget( widget, nomax ); |
106 | #else | ||
107 | QApplication::setMainWidget( widget ); | ||
108 | widget->show(); | ||
109 | #endif | ||
110 | widget->setCaption( _appname ); | 99 | widget->setCaption( _appname ); |
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h index 8326847..94ac488 100644 --- a/libopie2/opiecore/oapplication.h +++ b/libopie2/opiecore/oapplication.h | |||
@@ -35,12 +35,3 @@ | |||
35 | 35 | ||
36 | // the below stuff will fail with moc because moc does not pre process headers | ||
37 | // This will make usage of signal and slots hard inside QPEApplication -zecke | ||
38 | |||
39 | #ifdef QWS | ||
40 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
41 | #define OApplicationBaseClass QPEApplication | ||
42 | #else | ||
43 | #include <qapplication.h> | ||
44 | #define OApplicationBaseClass QApplication | ||
45 | #endif | ||
46 | 37 | ||
@@ -49,7 +40,7 @@ class OConfig; | |||
49 | 40 | ||
50 | class OApplication: public OApplicationBaseClass | 41 | class OApplication: public QPEApplication |
51 | { | 42 | { |
52 | // Q_OBJECT would fail -zecke | 43 | Q_OBJECT |
53 | public: | ||
54 | 44 | ||
45 | public: | ||
55 | /** | 46 | /** |
@@ -66,5 +57,4 @@ class OApplication: public OApplicationBaseClass | |||
66 | virtual ~OApplication(); | 57 | virtual ~OApplication(); |
67 | |||
68 | /** | 58 | /** |
69 | * Returns the current application object. | 59 | * @returns the process-wide application object |
70 | * | 60 | * |
@@ -75,7 +65,4 @@ class OApplication: public OApplicationBaseClass | |||
75 | * to every function that may require it. | 65 | * to every function that may require it. |
76 | * | ||
77 | * @return the current application object | ||
78 | */ | 66 | */ |
79 | static const OApplication* oApplication() { return _instance; }; | 67 | static const OApplication* oApplication() { return _instance; }; |
80 | |||
81 | /** | 68 | /** |
@@ -83,11 +70,8 @@ class OApplication: public OApplicationBaseClass | |||
83 | * | 70 | * |
84 | * @return A reference to the application name | 71 | * @returns a reference to the application name |
85 | */ | 72 | */ |
86 | const QCString& appName() const { return _appname; }; | 73 | const QCString& appName() const { return _appname; }; |
87 | |||
88 | /** | 74 | /** |
89 | * Returns the application session config object. | 75 | * @returns the application session config object. |
90 | * | 76 | * |
91 | * @return A pointer to the application's instance specific | ||
92 | * @ref OConfig object. | ||
93 | * @see OConfig | 77 | * @see OConfig |
@@ -95,21 +79,6 @@ class OApplication: public OApplicationBaseClass | |||
95 | OConfig* config(); | 79 | OConfig* config(); |
96 | |||
97 | /** | 80 | /** |
98 | * Sets the main widget - reimplemented to call showMainWidget() | 81 | * Shows the main @a widget and sets the name of the application as window caption. |
99 | * on Qt/Embedded. | ||
100 | * | ||
101 | * @param mainWidget the widget to become the main widget | ||
102 | * @see QWidget object | ||
103 | */ | ||
104 | virtual void setMainWidget( QWidget *mainWidget ); | ||
105 | |||
106 | /** | ||
107 | * Shows the main widget - reimplemented to call setMainWidget() | ||
108 | * on platforms other than Qt/Embedded. | ||
109 | * | ||
110 | * @param mainWidget the widget to become the main widget | ||
111 | * @see QWidget object | ||
112 | */ | 82 | */ |
113 | virtual void showMainWidget( QWidget* widget, bool nomax = false ); | 83 | virtual void showMainWidget( QWidget* widget, bool nomax = false ); |
114 | |||
115 | /** | 84 | /** |
@@ -121,3 +90,2 @@ class OApplication: public OApplicationBaseClass | |||
121 | virtual void setTitle( const QString& title = QString::null ) const; | 90 | virtual void setTitle( const QString& title = QString::null ) const; |
122 | //virtual void setTitle() const; | ||
123 | 91 | ||