summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/oapplication.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/oapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/oapplication.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp
index 7a6c174..06d8ba2 100644
--- a/libopie2/opiecore/oapplication.cpp
+++ b/libopie2/opiecore/oapplication.cpp
@@ -22,24 +22,27 @@
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 33
34#include <signal.h>
35#include <stdio.h>
36
34OApplication* OApplication::_instance = 0; 37OApplication* OApplication::_instance = 0;
35 38
36/**************************************************************************************************/ 39/**************************************************************************************************/
37/* OApplicationPrivate 40/* OApplicationPrivate
38/**************************************************************************************************/ 41/**************************************************************************************************/
39 42
40class OApplicationPrivate 43class OApplicationPrivate
41{ 44{
42 public: 45 public:
43 OApplicationPrivate() {}; 46 OApplicationPrivate() {};
44 ~OApplicationPrivate() {}; 47 ~OApplicationPrivate() {};
45}; 48};
@@ -76,24 +79,33 @@ OConfig* OApplication::config()
76 _config = new OConfig( _appname ); 79 _config = new OConfig( _appname );
77 } 80 }
78 return _config; 81 return _config;
79} 82}
80 83
81 84
82void OApplication::init() 85void OApplication::init()
83{ 86{
84 d = new OApplicationPrivate(); 87 d = new OApplicationPrivate();
85 if ( !OApplication::_instance ) 88 if ( !OApplication::_instance )
86 { 89 {
87 OApplication::_instance = this; 90 OApplication::_instance = this;
91
92 /* register SIGSEGV handler to give programs an option
93 * to exit gracefully, e.g. save or close devices or files.
94 struct sigaction sa;
95 sa.sa_handler = ( void (*)(int) ) &segv_handler;
96 sa.sa_flags = SA_SIGINFO | SA_RESTART;
97 sigemptyset(&sa.sa_mask);
98 sigaction(SIGSEGV, &sa, NULL);
99 */
88 } 100 }
89 else 101 else
90 { 102 {
91 qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); 103 qFatal( "OApplication: Can't create more than one OApplication object. Aborting." );
92 } 104 }
93} 105}
94 106
95 107
96void OApplication::showMainWidget( QWidget* widget, bool nomax ) 108void OApplication::showMainWidget( QWidget* widget, bool nomax )
97{ 109{
98 QPEApplication::showMainWidget( widget, nomax ); 110 QPEApplication::showMainWidget( widget, nomax );
99 widget->setCaption( _appname ); 111 widget->setCaption( _appname );