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.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp
index 84cab48..c3cacce 100644
--- a/libopie2/opiecore/oapplication.cpp
+++ b/libopie2/opiecore/oapplication.cpp
@@ -33,53 +33,49 @@
33#include <opie2/odebug.h> 33#include <opie2/odebug.h>
34 34
35#include <signal.h> 35#include <signal.h>
36#include <stdio.h> 36#include <stdio.h>
37 37
38OApplication* OApplication::_instance = 0; 38OApplication* OApplication::_instance = 0;
39 39
40/**************************************************************************************************/ 40/**************************************************************************************************/
41/* OApplicationPrivate 41/* OApplicationPrivate
42/**************************************************************************************************/ 42/**************************************************************************************************/
43 43
44class OApplicationPrivate 44class OApplicationPrivate
45{ 45{
46 public: 46 public:
47 OApplicationPrivate() {}; 47 OApplicationPrivate() {};
48 ~OApplicationPrivate() {}; 48 ~OApplicationPrivate() {};
49}; 49};
50 50
51/**************************************************************************************************/ 51/**************************************************************************************************/
52/* OApplication 52/* OApplication
53/**************************************************************************************************/ 53/**************************************************************************************************/
54 54
55 55
56OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) 56OApplication::OApplication( int& argc, char** argv, const QCString& rAppName )
57#ifdef QWS
58 :QPEApplication( argc, argv ), 57 :QPEApplication( argc, argv ),
59#else
60 :QApplication( argc, argv ),
61#endif
62 _appname( rAppName ), 58 _appname( rAppName ),
63 _config( 0 ) 59 _config( 0 )
64{ 60{
65 init(); 61 init();
66} 62}
67 63
68 64
69OApplication::~OApplication() 65OApplication::~OApplication()
70{ 66{
71 delete d; 67 delete d;
72 if ( _config ) 68 if ( _config )
73 delete _config; 69 delete _config;
74 OApplication::_instance = 0; 70 OApplication::_instance = 0;
75 // after deconstruction of the one-and-only application object, 71 // after deconstruction of the one-and-only application object,
76 // the construction of another object is allowed 72 // the construction of another object is allowed
77} 73}
78 74
79 75
80OConfig* OApplication::config() 76OConfig* OApplication::config()
81{ 77{
82 if ( !_config ) 78 if ( !_config )
83 { 79 {
84 _config = new OConfig( _appname ); 80 _config = new OConfig( _appname );
85 } 81 }
@@ -91,47 +87,40 @@ void OApplication::init()
91{ 87{
92 d = new OApplicationPrivate(); 88 d = new OApplicationPrivate();
93 if ( !OApplication::_instance ) 89 if ( !OApplication::_instance )
94 { 90 {
95 OApplication::_instance = this; 91 OApplication::_instance = this;
96 92
97 /* register SIGSEGV handler to give programs an option 93 /* register SIGSEGV handler to give programs an option
98 * to exit gracefully, e.g. save or close devices or files. 94 * to exit gracefully, e.g. save or close devices or files.
99 struct sigaction sa; 95 struct sigaction sa;
100 sa.sa_handler = ( void (*)(int) ) &segv_handler; 96 sa.sa_handler = ( void (*)(int) ) &segv_handler;
101 sa.sa_flags = SA_SIGINFO | SA_RESTART; 97 sa.sa_flags = SA_SIGINFO | SA_RESTART;
102 sigemptyset(&sa.sa_mask); 98 sigemptyset(&sa.sa_mask);
103 sigaction(SIGSEGV, &sa, NULL); 99 sigaction(SIGSEGV, &sa, NULL);
104 */ 100 */
105 } 101 }
106 else 102 else
107 { 103 {
108 qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); 104 qFatal( "OApplication: Can't create more than one OApplication object. Aborting." );
109 } 105 }
110} 106}
111 107
112 108
113void OApplication::showMainWidget( QWidget* widget, bool nomax ) 109void OApplication::showMainWidget( QWidget* widget, bool nomax )
114{ 110{
115#ifdef QWS
116 QPEApplication::showMainWidget( widget, nomax ); 111 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
123 widget->setCaption( _appname ); 112 widget->setCaption( _appname );
124} 113}
125 114
126 115
127void OApplication::setTitle( const QString& title ) const 116void OApplication::setTitle( const QString& title ) const
128{ 117{
129 if ( mainWidget() ) 118 if ( mainWidget() )
130 { 119 {
131 if ( !title.isNull() ) 120 if ( !title.isNull() )
132 mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); 121 mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title );
133 else 122 else
134 mainWidget()->setCaption( _appname ); 123 mainWidget()->setCaption( _appname );
135 } 124 }
136} 125}
137 126