-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 | |||
@@ -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 | |||
34 | OApplication* OApplication::_instance = 0; | 37 | OApplication* OApplication::_instance = 0; |
35 | 38 | ||
36 | /**************************************************************************************************/ | 39 | /**************************************************************************************************/ |
37 | /* OApplicationPrivate | 40 | /* OApplicationPrivate |
38 | /**************************************************************************************************/ | 41 | /**************************************************************************************************/ |
39 | 42 | ||
40 | class OApplicationPrivate | 43 | class 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 | ||
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 | } |
94 | 106 | ||
95 | 107 | ||
96 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) | 108 | void 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 ); |
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 | |||
@@ -32,25 +32,25 @@ | |||
32 | #define OAPPLICATION_H | 32 | #define OAPPLICATION_H |
33 | 33 | ||
34 | #define oApp OApplication::oApplication() | 34 | #define oApp OApplication::oApplication() |
35 | 35 | ||
36 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
37 | 37 | ||
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 |
51 | * | 51 | * |
52 | */ | 52 | */ |
53 | OApplication( int& argc, char** argv, const QCString& rAppName ); | 53 | OApplication( int& argc, char** argv, const QCString& rAppName ); |
54 | /** | 54 | /** |
55 | * Destructor. Destroys the application object and its children. | 55 | * Destructor. Destroys the application object and its children. |
56 | */ | 56 | */ |