summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/main.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/main.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/main.cpp b/noncore/apps/opie-reader/main.cpp
index 2440037..3e1f5e7 100644
--- a/noncore/apps/opie-reader/main.cpp
+++ b/noncore/apps/opie-reader/main.cpp
@@ -1,34 +1,50 @@
1#include "useqpe.h"
2#ifdef USEQPE
1#include <qpe/qpeapplication.h> 3#include <qpe/qpeapplication.h>
4#else
5#include <qapplication.h>
6#endif
2#include "QTReaderApp.h" 7#include "QTReaderApp.h"
3 8
4#include "signal.h" 9#include "signal.h"
5#include "stdio.h" 10#include "stdio.h"
6#include "time.h" 11#include "time.h"
7 12
13
14#ifdef USEQPE
8QTReaderApp* app = NULL; 15QTReaderApp* app = NULL;
9 16
10void handler(int signum) 17void handler(int signum)
11{ 18{
12 if (app != NULL) 19 if (app != NULL)
13 { 20 {
14 app->suspend(); 21 app->suspend();
15 app->saveprefs(); 22 app->saveprefs();
16 } 23 }
17 signal(signum, handler); 24 signal(signum, handler);
18} 25}
26#endif
19 27
20int main( int argc, char ** argv ) 28int main( int argc, char ** argv )
21{ 29{
22 signal(SIGCONT, handler);
23 30
31#ifdef USEQPE
32 signal(SIGCONT, handler);
24 QPEApplication a( argc, argv ); 33 QPEApplication a( argc, argv );
25
26 QTReaderApp m; 34 QTReaderApp m;
27
28 a.showMainDocumentWidget( &m ); 35 a.showMainDocumentWidget( &m );
29
30 app = &m; 36 app = &m;
37#else
38 QApplication a( argc, argv );
39 QTReaderApp m;
40 a.setMainWidget( &m );
41 if (argc > 1)
42 {
43 m.setDocument(argv[1]);
44 }
45#endif
46
31 47
32 return a.exec(); 48 return a.exec();
33} 49}
34 50