32 |
32 |
33 void ApplicationLauncherPrivate::startApplication(int applicationId, const QUrl &uri) |
33 void ApplicationLauncherPrivate::startApplication(int applicationId, const QUrl &uri) |
34 { |
34 { |
35 QString commandLine = QString("-activity %1").arg(QString(uri.toEncoded())); |
35 QString commandLine = QString("-activity %1").arg(QString(uri.toEncoded())); |
36 |
36 |
37 QT_TRAP_THROWING( { |
37 TRAP_IGNORE( |
38 HBufC *commandLineAsDescriptor = XQConversions::qStringToS60Desc(commandLine); |
38 HBufC *commandLineAsDescriptor = XQConversions::qStringToS60Desc(commandLine); |
39 CleanupStack::PushL(commandLineAsDescriptor); |
39 CleanupStack::PushL(commandLineAsDescriptor); |
40 |
40 |
41 RApaLsSession apaLsSession; |
41 RApaLsSession apaLsSession; |
42 User::LeaveIfError(apaLsSession.Connect()); |
42 User::LeaveIfError(apaLsSession.Connect()); |
43 CleanupClosePushL(apaLsSession); |
43 CleanupClosePushL(apaLsSession); |
44 |
44 |
45 TApaAppInfo appInfo; |
45 TApaAppInfo appInfo; |
46 TInt retVal = apaLsSession.GetAppInfo(appInfo, TUid::Uid(applicationId)); |
46 User::LeaveIfError(apaLsSession.GetAppInfo(appInfo, TUid::Uid(applicationId))); |
47 |
47 |
48 if (retVal == KErrNone) { |
48 RProcess application; |
49 RProcess application; |
49 User::LeaveIfError(application.Create(appInfo.iFullName, *commandLineAsDescriptor)); |
50 User::LeaveIfError(application.Create(appInfo.iFullName, *commandLineAsDescriptor)); |
50 application.Resume(); |
51 application.Resume(); |
|
52 } else { |
|
53 // @todo ? |
|
54 } |
|
55 |
51 |
56 CleanupStack::PopAndDestroy(&apaLsSession); |
52 CleanupStack::PopAndDestroy(&apaLsSession); |
57 CleanupStack::PopAndDestroy(commandLineAsDescriptor); |
53 CleanupStack::PopAndDestroy(commandLineAsDescriptor); |
58 } |
54 ); |
59 ); |
|
60 } |
55 } |
61 |
56 |
62 void ApplicationLauncherPrivate::bringToForeground(int applicationId) |
57 void ApplicationLauncherPrivate::bringToForeground(int applicationId) |
63 { |
58 { |
64 TApaTaskList taskList(CEikonEnv::Static()->WsSession()); |
59 TApaTaskList taskList(CEikonEnv::Static()->WsSession()); |