Diffstat (limited to 'libopie2/opiecore/oapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/oapplication.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp index 06d8ba2..84cab48 100644 --- a/libopie2/opiecore/oapplication.cpp +++ b/libopie2/opiecore/oapplication.cpp | |||
@@ -21,48 +21,53 @@ | |||
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <opie2/oapplication.h> | 31 | #include <opie2/oapplication.h> |
32 | #include <opie2/oconfig.h> | 32 | #include <opie2/oconfig.h> |
33 | #include <opie2/odebug.h> | ||
33 | 34 | ||
34 | #include <signal.h> | 35 | #include <signal.h> |
35 | #include <stdio.h> | 36 | #include <stdio.h> |
36 | 37 | ||
37 | OApplication* OApplication::_instance = 0; | 38 | OApplication* OApplication::_instance = 0; |
38 | 39 | ||
39 | /**************************************************************************************************/ | 40 | /**************************************************************************************************/ |
40 | /* OApplicationPrivate | 41 | /* OApplicationPrivate |
41 | /**************************************************************************************************/ | 42 | /**************************************************************************************************/ |
42 | 43 | ||
43 | class OApplicationPrivate | 44 | class OApplicationPrivate |
44 | { | 45 | { |
45 | public: | 46 | public: |
46 | OApplicationPrivate() {}; | 47 | OApplicationPrivate() {}; |
47 | ~OApplicationPrivate() {}; | 48 | ~OApplicationPrivate() {}; |
48 | }; | 49 | }; |
49 | 50 | ||
50 | /**************************************************************************************************/ | 51 | /**************************************************************************************************/ |
51 | /* OApplication | 52 | /* OApplication |
52 | /**************************************************************************************************/ | 53 | /**************************************************************************************************/ |
53 | 54 | ||
54 | 55 | ||
55 | OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) | 56 | OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) |
57 | #ifdef QWS | ||
56 | :QPEApplication( argc, argv ), | 58 | :QPEApplication( argc, argv ), |
59 | #else | ||
60 | :QApplication( argc, argv ), | ||
61 | #endif | ||
57 | _appname( rAppName ), | 62 | _appname( rAppName ), |
58 | _config( 0 ) | 63 | _config( 0 ) |
59 | { | 64 | { |
60 | init(); | 65 | init(); |
61 | } | 66 | } |
62 | 67 | ||
63 | 68 | ||
64 | OApplication::~OApplication() | 69 | OApplication::~OApplication() |
65 | { | 70 | { |
66 | delete d; | 71 | delete d; |
67 | if ( _config ) | 72 | if ( _config ) |
68 | delete _config; | 73 | delete _config; |
@@ -98,25 +103,32 @@ void OApplication::init() | |||
98 | sigaction(SIGSEGV, &sa, NULL); | 103 | sigaction(SIGSEGV, &sa, NULL); |
99 | */ | 104 | */ |
100 | } | 105 | } |
101 | else | 106 | else |
102 | { | 107 | { |
103 | qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); | 108 | qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); |
104 | } | 109 | } |
105 | } | 110 | } |
106 | 111 | ||
107 | 112 | ||
108 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) | 113 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) |
109 | { | 114 | { |
115 | #ifdef QWS | ||
110 | QPEApplication::showMainWidget( widget, nomax ); | 116 | QPEApplication::showMainWidget( widget, nomax ); |
117 | #else | ||
118 | // tille: I am quit sure if this is the right way to do.. | ||
119 | odDebug(nomax,7) << "ignoring nomax"; | ||
120 | setMainWidget( widget ); | ||
121 | widget->show(); | ||
122 | #endif | ||
111 | widget->setCaption( _appname ); | 123 | widget->setCaption( _appname ); |
112 | } | 124 | } |
113 | 125 | ||
114 | 126 | ||
115 | void OApplication::setTitle( const QString& title ) const | 127 | void OApplication::setTitle( const QString& title ) const |
116 | { | 128 | { |
117 | if ( mainWidget() ) | 129 | if ( mainWidget() ) |
118 | { | 130 | { |
119 | if ( !title.isNull() ) | 131 | if ( !title.isNull() ) |
120 | mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); | 132 | mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); |
121 | else | 133 | else |
122 | mainWidget()->setCaption( _appname ); | 134 | mainWidget()->setCaption( _appname ); |