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, 10 insertions, 1 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp
index d340c0e..e2f6e82 100644
--- a/libopie2/opiecore/oapplication.cpp
+++ b/libopie2/opiecore/oapplication.cpp
@@ -25,36 +25,43 @@
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include <opie2/oapplication.h> 30#include <opie2/oapplication.h>
31#include <opie2/oconfig.h> 31#include <opie2/oconfig.h>
32#include <opie2/odebug.h> 32#include <opie2/odebug.h>
33 33
34#include <signal.h> 34#include <signal.h>
35#include <stdio.h> 35#include <stdio.h>
36 36
37using namespace Opie::Core;
38
39
37OApplication* OApplication::_instance = 0; 40OApplication* OApplication::_instance = 0;
38 41
39/************************************************************************************************** 42/**************************************************************************************************
40 * OApplicationPrivate 43 * OApplicationPrivate
41 **************************************************************************************************/ 44 **************************************************************************************************/
42 45
46namespace Opie {
47namespace Core {
48namespace Private {
43class OApplicationPrivate 49class OApplicationPrivate
44{ 50{
45 public: 51 public:
46 OApplicationPrivate() {}; 52 OApplicationPrivate() {};
47 ~OApplicationPrivate() {}; 53 ~OApplicationPrivate() {};
48}; 54};
55}
49 56
50/************************************************************************************************** 57/**************************************************************************************************
51 * OApplication 58 * OApplication
52 **************************************************************************************************/ 59 **************************************************************************************************/
53 60
54 61
55OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) 62OApplication::OApplication( int& argc, char** argv, const QCString& rAppName )
56 :QPEApplication( argc, argv ), 63 :QPEApplication( argc, argv ),
57 _appname( rAppName ), 64 _appname( rAppName ),
58 _config( 0 ) 65 _config( 0 )
59{ 66{
60 init(); 67 init();
@@ -75,25 +82,25 @@ OApplication::~OApplication()
75OConfig* OApplication::config() 82OConfig* OApplication::config()
76{ 83{
77 if ( !_config ) 84 if ( !_config )
78 { 85 {
79 _config = new OConfig( _appname ); 86 _config = new OConfig( _appname );
80 } 87 }
81 return _config; 88 return _config;
82} 89}
83 90
84 91
85void OApplication::init() 92void OApplication::init()
86{ 93{
87 d = new OApplicationPrivate(); 94 d = new Private::OApplicationPrivate();
88 if ( !OApplication::_instance ) 95 if ( !OApplication::_instance )
89 { 96 {
90 OApplication::_instance = this; 97 OApplication::_instance = this;
91 98
92 /* register SIGSEGV handler to give programs an option 99 /* register SIGSEGV handler to give programs an option
93 * to exit gracefully, e.g. save or close devices or files. 100 * to exit gracefully, e.g. save or close devices or files.
94 struct sigaction sa; 101 struct sigaction sa;
95 sa.sa_handler = ( void (*)(int) ) &segv_handler; 102 sa.sa_handler = ( void (*)(int) ) &segv_handler;
96 sa.sa_flags = SA_SIGINFO | SA_RESTART; 103 sa.sa_flags = SA_SIGINFO | SA_RESTART;
97 sigemptyset(&sa.sa_mask); 104 sigemptyset(&sa.sa_mask);
98 sigaction(SIGSEGV, &sa, NULL); 105 sigaction(SIGSEGV, &sa, NULL);
99 */ 106 */
@@ -116,12 +123,14 @@ void OApplication::showMainWidget( QWidget* widget, bool nomax )
116 123
117void OApplication::setTitle( const QString& title ) const 124void OApplication::setTitle( const QString& title ) const
118{ 125{
119 if ( mainWidget() ) 126 if ( mainWidget() )
120 { 127 {
121 if ( !title.isNull() ) 128 if ( !title.isNull() )
122 mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); 129 mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title );
123 else 130 else
124 mainWidget()->setCaption( _appname ); 131 mainWidget()->setCaption( _appname );
125 } 132 }
126} 133}
127 134
135}
136}