Diffstat (limited to 'libopie2/opiecore/oapplication.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/oapplication.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp index c3cacce..1b85057 100644 --- a/libopie2/opiecore/oapplication.cpp +++ b/libopie2/opiecore/oapplication.cpp | |||
@@ -1,28 +1,27 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> | |
4 | Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de> | ||
5 | =. | 4 | =. |
6 | .=l. | 5 | .=l. |
7 | .>+-= | 6 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 13 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 21 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
@@ -80,47 +79,49 @@ OConfig* OApplication::config() | |||
80 | _config = new OConfig( _appname ); | 79 | _config = new OConfig( _appname ); |
81 | } | 80 | } |
82 | return _config; | 81 | return _config; |
83 | } | 82 | } |
84 | 83 | ||
85 | 84 | ||
86 | void OApplication::init() | 85 | void OApplication::init() |
87 | { | 86 | { |
88 | d = new OApplicationPrivate(); | 87 | d = new OApplicationPrivate(); |
89 | if ( !OApplication::_instance ) | 88 | if ( !OApplication::_instance ) |
90 | { | 89 | { |
91 | OApplication::_instance = this; | 90 | OApplication::_instance = this; |
92 | 91 | ||
93 | /* register SIGSEGV handler to give programs an option | 92 | /* register SIGSEGV handler to give programs an option |
94 | * to exit gracefully, e.g. save or close devices or files. | 93 | * to exit gracefully, e.g. save or close devices or files. |
95 | struct sigaction sa; | 94 | struct sigaction sa; |
96 | sa.sa_handler = ( void (*)(int) ) &segv_handler; | 95 | sa.sa_handler = ( void (*)(int) ) &segv_handler; |
97 | sa.sa_flags = SA_SIGINFO | SA_RESTART; | 96 | sa.sa_flags = SA_SIGINFO | SA_RESTART; |
98 | sigemptyset(&sa.sa_mask); | 97 | sigemptyset(&sa.sa_mask); |
99 | sigaction(SIGSEGV, &sa, NULL); | 98 | sigaction(SIGSEGV, &sa, NULL); |
100 | */ | 99 | */ |
101 | } | 100 | } |
102 | else | 101 | else |
103 | { | 102 | { |
104 | qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); | 103 | ofatal << "OApplication: Can't create more than one OApplication object. Aborting." << oendl; |
104 | //FIXME exit gracefully ? | ||
105 | ::exit( -1 ); | ||
105 | } | 106 | } |
106 | } | 107 | } |
107 | 108 | ||
108 | 109 | ||
109 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) | 110 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) |
110 | { | 111 | { |
111 | QPEApplication::showMainWidget( widget, nomax ); | 112 | QPEApplication::showMainWidget( widget, nomax ); |
112 | widget->setCaption( _appname ); | 113 | widget->setCaption( _appname ); |
113 | } | 114 | } |
114 | 115 | ||
115 | 116 | ||
116 | void OApplication::setTitle( const QString& title ) const | 117 | void OApplication::setTitle( const QString& title ) const |
117 | { | 118 | { |
118 | if ( mainWidget() ) | 119 | if ( mainWidget() ) |
119 | { | 120 | { |
120 | if ( !title.isNull() ) | 121 | if ( !title.isNull() ) |
121 | mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); | 122 | mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); |
122 | else | 123 | else |
123 | mainWidget()->setCaption( _appname ); | 124 | mainWidget()->setCaption( _appname ); |
124 | } | 125 | } |
125 | } | 126 | } |
126 | 127 | ||