179 // -------------------------------------------------------------------------- |
179 // -------------------------------------------------------------------------- |
180 // |
180 // |
181 TBool CUpnpCommandImplementation::IsAvailableL( |
181 TBool CUpnpCommandImplementation::IsAvailableL( |
182 UpnpCommand::TUpnpCommandId aCommandId ) |
182 UpnpCommand::TUpnpCommandId aCommandId ) |
183 { |
183 { |
|
184 TBool available( EFalse ); |
184 switch( aCommandId ) |
185 switch( aCommandId ) |
185 { |
186 { |
186 case UpnpCommand::ECommandShow: // flow through |
187 case UpnpCommand::ECommandShow: // flow through |
187 case UpnpCommand::ECommandCopy: // flow through |
188 case UpnpCommand::ECommandCopy: // flow through |
188 case UpnpCommand::ECommandMove: // flow through |
189 case UpnpCommand::ECommandMove: // flow through |
189 case UpnpCommand::ECommandBrowse: |
190 case UpnpCommand::ECommandBrowse: |
190 { |
191 { |
191 // available if upnp is configured |
192 // available if upnp is configured |
192 return IsUpnpConfiguredL(); |
193 available = IsUpnpConfiguredL(); |
193 } |
194 } |
|
195 break; |
194 case UpnpCommand::ECommandSetup: |
196 case UpnpCommand::ECommandSetup: |
195 { |
197 { |
196 // setup is always available |
198 // setup is always available |
197 return ETrue; |
199 available = ETrue; |
198 } |
200 } |
|
201 break; |
199 default: |
202 default: |
200 __PANICD( __FILE__, __LINE__ ); |
203 { |
201 } |
204 __PANIC( __FILE__, __LINE__ ); |
202 |
205 } |
203 return EFalse; |
206 break; |
|
207 } |
|
208 |
|
209 return available; |
204 } |
210 } |
205 |
211 |
206 // -------------------------------------------------------------------------- |
212 // -------------------------------------------------------------------------- |
207 // CUpnpCommandImplementation::AllocateResourcesL |
213 // CUpnpCommandImplementation::AllocateResourcesL |
208 // Allocates the Upnp Framework resources. |
214 // Allocates the Upnp Framework resources. |
256 |
262 |
257 // If allocating resources failed, delete the task and forward the |
263 // If allocating resources failed, delete the task and forward the |
258 // leave code. |
264 // leave code. |
259 if( allocateError != KErrNone ) |
265 if( allocateError != KErrNone ) |
260 { |
266 { |
261 __LOG1( "[UpnpCommand]\t CUpnpCommandImplementation::AllocateResourcesL \ |
267 __LOG1( "[UpnpCommand]\t AllocateResourcesL \ |
262 failed %d", allocateError ); |
268 failed %d", allocateError ); |
263 // show note only if operation was not cancelled by user |
269 // show note only if operation was not cancelled by user |
264 if( allocateError != KErrCancel ) |
270 if( allocateError != KErrCancel ) |
265 { |
271 { |
266 TRAP_IGNORE( iNoteHandler->ShowConnectionLostNoteL() ); |
272 TRAP_IGNORE( iNoteHandler->ShowConnectionLostNoteL() ); |
306 __LOG( "[UpnpCommand]\t CUpnpCommandImplementation::ExecuteL" ); |
312 __LOG( "[UpnpCommand]\t CUpnpCommandImplementation::ExecuteL" ); |
307 |
313 |
308 // Allocates Upnp Fw resources if not yet allocated |
314 // Allocates Upnp Fw resources if not yet allocated |
309 if( !iTask ) |
315 if( !iTask ) |
310 { |
316 { |
311 __LOG( "[UpnpCommand]\t CUpnpCommandImplementation::ExecuteL task deleted, leave" ); |
317 __LOG( "[UpnpCommand]\t ExecuteL task deleted, leave" ); |
312 User::Leave( KErrNotReady ); |
318 User::Leave( KErrNotReady ); |
313 } |
319 } |
314 |
320 |
315 // Update the state |
321 // Update the state |
316 iState = UpnpCommand::EStateExecuting; |
322 iState = UpnpCommand::EStateExecuting; |