summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/main.cpp
blob: 2be60456e3bcf6e12e2043dd15f75c5b0f005742 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#ifdef USEQPE
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#include "QTReaderApp.h"

#include "signal.h"
#include "stdio.h"
#include "time.h"


#ifdef USEQPE
QTReaderApp* app = NULL;

void handler(int signum)
{
    if (app != NULL)
    {
	app->suspend();
	app->saveprefs();
    }
    signal(signum, handler);
}
#endif

int main( int argc, char ** argv )
{

#ifdef USEQPE
    signal(SIGCONT, handler);
    QPEApplication a( argc, argv );
    QTReaderApp m;
    a.showMainDocumentWidget( &m );
    app = &m;
#else
    QApplication a( argc, argv );
    QTReaderApp m;
    a.setMainWidget( &m );
	if (argc > 1)
	{
	    m.setDocument(argv[1]);
	}
#endif


    return a.exec();
}