-rw-r--r-- | libopie2/opiecore/oapplication.cpp | 12 | ||||
-rw-r--r-- | libopie2/opiecore/oapplication.h | 2 |
2 files changed, 13 insertions, 1 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 | |||
@@ -28,12 +28,15 @@ | |||
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 | |||
34 | OApplication* OApplication::_instance = 0; | 37 | OApplication* OApplication::_instance = 0; |
35 | 38 | ||
36 | /**************************************************************************************************/ | 39 | /**************************************************************************************************/ |
37 | /* OApplicationPrivate | 40 | /* OApplicationPrivate |
38 | /**************************************************************************************************/ | 41 | /**************************************************************************************************/ |
39 | 42 | ||
@@ -82,12 +85,21 @@ OConfig* OApplication::config() | |||
82 | void OApplication::init() | 85 | void 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 | } |
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h index 94ac488..1bd34e2 100644 --- a/libopie2/opiecore/oapplication.h +++ b/libopie2/opiecore/oapplication.h | |||
@@ -38,13 +38,13 @@ | |||
38 | class OApplicationPrivate; | 38 | class OApplicationPrivate; |
39 | class OConfig; | 39 | class OConfig; |
40 | 40 | ||
41 | class OApplication: public QPEApplication | 41 | class OApplication: public QPEApplication |
42 | { | 42 | { |
43 | Q_OBJECT | 43 | Q_OBJECT |
44 | 44 | ||
45 | public: | 45 | public: |
46 | /** | 46 | /** |
47 | * Constructor. Parses command-line arguments and sets the window caption. | 47 | * Constructor. Parses command-line arguments and sets the window caption. |
48 | * | 48 | * |
49 | * @param rAppName application name. Will be used for finding the | 49 | * @param rAppName application name. Will be used for finding the |
50 | * associated message, icon and configuration files | 50 | * associated message, icon and configuration files |