9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Application entry point |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 #include <QtCore> |
17 #include "activityserver.h" |
18 #include <QCoreApplication> |
18 #include <e32base.h> |
19 |
19 |
20 #include "hsactivityserver.h" |
20 // ----------------------------------------------------------------------------- |
21 #include "hsactivitystorage.h" |
21 // |
|
22 // ----------------------------------------------------------------------------- |
|
23 // |
|
24 LOCAL_C void StartActivityServerL() |
|
25 { |
|
26 CActiveScheduler* activeScheduler = new( ELeave ) CActiveScheduler; |
|
27 CleanupStack::PushL( activeScheduler ); |
|
28 CActiveScheduler::Install( activeScheduler ); |
|
29 CActivityServer* serverObject = CActivityServer::NewLC(); |
|
30 RProcess::Rendezvous( KErrNone ); |
|
31 CActiveScheduler::Start(); |
|
32 CleanupStack::PopAndDestroy( serverObject ); |
|
33 CleanupStack::PopAndDestroy( activeScheduler ); |
|
34 } |
22 |
35 |
23 #ifdef Q_OS_SYMBIAN |
36 // ----------------------------------------------------------------------------- |
24 #include <coemain.h> |
37 // |
25 #include <coedef.h> |
38 // ----------------------------------------------------------------------------- |
26 #endif |
39 // |
|
40 LOCAL_C TInt StartActivityServer() |
|
41 { |
|
42 __UHEAP_MARK; |
|
43 TInt errNo(KErrNoMemory); |
|
44 CTrapCleanup* cleanupStack = CTrapCleanup::New(); |
|
45 if (cleanupStack) { |
|
46 TRAP(errNo, StartActivityServerL()); |
|
47 delete cleanupStack; |
|
48 } |
|
49 __UHEAP_MARKEND; |
|
50 if (KErrNone != errNo) { |
|
51 RProcess::Rendezvous(errNo); |
|
52 } |
|
53 return errNo; |
|
54 } |
27 |
55 |
28 int main(int argc, char *argv[]) |
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 TInt E32Main() |
29 { |
61 { |
30 #ifdef Q_OS_SYMBIAN |
62 return StartActivityServer(); |
31 CCoeEnv::Static()->RootWin().SetOrdinalPosition(0, ECoeWinPriorityNeverAtFront); |
|
32 #endif |
|
33 |
|
34 QCoreApplication app(argc, argv); |
|
35 HsActivityStorage storage; |
|
36 HsActivityServer server(storage); |
|
37 int retVal(KErrGeneral); |
|
38 if (server.start()) { |
|
39 retVal = app.exec(); |
|
40 } |
|
41 return retVal; |
|
42 } |
63 } |