106 TInt errCode(KErrArgument); |
104 TInt errCode(KErrArgument); |
107 TUid appUid= TUid::Null( ); |
105 TUid appUid= TUid::Null( ); |
108 |
106 |
109 if ( !ExtractUidL( aMap, appUid, KApplicationUid ) ) |
107 if ( !ExtractUidL( aMap, appUid, KApplicationUid ) ) |
110 { |
108 { |
111 TApaTaskList taskList( iEnv->WsSession() ); |
109 // app not yet running |
112 TApaTask task = taskList.FindApp( appUid ); |
110 RApaLsSession appSession; |
113 if ( task.Exists( ) ) |
111 CleanupClosePushL( appSession ); |
114 { |
112 User::LeaveIfError( appSession.Connect( ) ); |
115 GfxTransEffect::BeginFullScreen( |
113 |
116 AknTransEffect::EApplicationStart, |
114 CApaCommandLine* cmd = CApaCommandLine::NewLC( ); |
117 TRect(), |
115 cmd->SetCommandL( GetCommandL( aMap ) ); |
118 AknTransEffect::EParameterType, |
116 RBuf documentNameValue; |
119 AknTransEffect::GfxTransParam( appUid, |
117 CleanupClosePushL( documentNameValue ); |
120 AknTransEffect::TParameter::EActivateExplicitContinue )); |
118 if( !ExtractDesL( aMap, documentNameValue, KDocumentName ) ) |
121 |
119 { |
122 errCode = KErrNone; |
120 cmd->SetDocumentNameL( documentNameValue ); |
123 task.BringToForeground(); |
121 } |
124 } |
122 TApaAppInfo appInfo; |
125 else |
123 appSession.GetAppInfo( appInfo, appUid ); |
126 { |
124 cmd->SetExecutableNameL( appInfo.iFullName ); |
127 // app not yet running |
125 errCode = appSession.StartApp( *cmd ); |
128 RApaLsSession appSession; |
126 |
129 CleanupClosePushL( appSession ); |
127 CleanupStack::PopAndDestroy( &documentNameValue ); |
130 User::LeaveIfError( appSession.Connect( ) ); |
128 CleanupStack::PopAndDestroy( cmd ); |
131 |
129 CleanupStack::PopAndDestroy( &appSession ); |
132 CApaCommandLine* cmd = CApaCommandLine::NewLC( ); |
130 } |
133 cmd->SetCommandL( GetCommandL( aMap ) ); |
131 |
134 RBuf documentNameValue; |
|
135 CleanupClosePushL( documentNameValue ); |
|
136 if( !ExtractDesL( aMap, documentNameValue, KDocumentName ) ) |
|
137 { |
|
138 cmd->SetDocumentNameL( documentNameValue ); |
|
139 } |
|
140 TApaAppInfo appInfo; |
|
141 appSession.GetAppInfo( appInfo, appUid ); |
|
142 cmd->SetExecutableNameL( appInfo.iFullName ); |
|
143 errCode = appSession.StartApp( *cmd ); |
|
144 |
|
145 CleanupStack::PopAndDestroy( &documentNameValue ); |
|
146 CleanupStack::PopAndDestroy( cmd ); |
|
147 CleanupStack::PopAndDestroy( &appSession ); |
|
148 } |
|
149 } |
|
150 return errCode; |
132 return errCode; |
151 } |
133 } |
152 |
134 |
153 // --------------------------------------------------------------------------- |
135 // --------------------------------------------------------------------------- |
154 // Executes provided apa message action |
136 // Executes provided apa message action |