248 |
250 |
249 void CCommandFactory::ConstructL() |
251 void CCommandFactory::ConstructL() |
250 { |
252 { |
251 User::LeaveIfError(iLock.CreateLocal()); |
253 User::LeaveIfError(iLock.CreateLocal()); |
252 User::LeaveIfError(iFs.DriveList(iDriveList)); |
254 User::LeaveIfError(iFs.DriveList(iDriveList)); |
|
255 iThreadPool = CThreadPool::NewL(); |
253 |
256 |
254 AddThreadCommandL(CCmdExit::NewLC); // Note, this command should never execute as 'exit' has handled explicitly by CParser. It exists so that 'exit' appears in fshell's help list and also to support 'exit --help'. |
257 AddThreadCommandL(CCmdExit::NewLC); // Note, this command should never execute as 'exit' has handled explicitly by CParser. It exists so that 'exit' appears in fshell's help list and also to support 'exit --help'. |
255 AddThreadCommandL(CCmdHelp::NewLC, CThreadCommand::ESharedHeap); |
258 AddThreadCommandL(CCmdHelp::NewLC, CThreadCommand::ESharedHeap); |
256 AddThreadCommandL(CCmdCd::NewLC, CThreadCommand::EUpdateEnvironment); |
259 AddThreadCommandL(CCmdCd::NewLC, CThreadCommand::EUpdateEnvironment); |
257 AddThreadCommandL(CCmdClear::NewLC); |
260 AddThreadCommandL(CCmdClear::NewLC); |
427 } |
430 } |
428 } |
431 } |
429 |
432 |
430 void CCommandFactory::AddThreadCommandL(TCommandConstructor aConstructor, TUint aFlags) |
433 void CCommandFactory::AddThreadCommandL(TCommandConstructor aConstructor, TUint aFlags) |
431 { |
434 { |
432 CCommandConstructorBase* constructor = CThreadCommandConstructor::NewLC(aConstructor, aFlags); |
435 CCommandConstructorBase* constructor = CThreadCommandConstructor::NewLC(aConstructor, aFlags, iThreadPool); |
433 AddCommandL(constructor); |
436 AddCommandL(constructor); |
434 CleanupStack::Pop(constructor); |
437 CleanupStack::Pop(constructor); |
435 } |
438 } |
436 |
439 |
437 void CCommandFactory::AddThreadCommandL(const TDesC& aCommandName, TCommandConstructor aConstructor, TUint aAttributes, TUint aFlags) |
440 void CCommandFactory::AddThreadCommandL(const TDesC& aCommandName, TCommandConstructor aConstructor, TUint aAttributes, TUint aFlags) |
438 { |
441 { |
439 CCommandConstructorBase* constructor = CThreadCommandConstructor::NewLC(aCommandName, aConstructor, aFlags); |
442 CCommandConstructorBase* constructor = CThreadCommandConstructor::NewLC(aCommandName, aConstructor, aFlags, iThreadPool); |
440 constructor->SetAttributes(aAttributes); |
443 constructor->SetAttributes(aAttributes); |
441 AddCommandL(constructor); |
444 AddCommandL(constructor); |
442 CleanupStack::Pop(constructor); |
445 CleanupStack::Pop(constructor); |
443 } |
446 } |
444 |
447 |
445 void CCommandFactory::AddAliasCommandL(const TDesC& aAliasName, TCommandConstructor aConstructor, const TDesC* aAdditionalArguments, const TDesC* aReplacementArguments, TUint aAttributes, TUint aFlags) |
448 void CCommandFactory::AddAliasCommandL(const TDesC& aAliasName, TCommandConstructor aConstructor, const TDesC* aAdditionalArguments, const TDesC* aReplacementArguments, TUint aAttributes, TUint aFlags) |
446 { |
449 { |
447 CCommandConstructorBase* aliasedCommand = CThreadCommandConstructor::NewLC(aConstructor, aFlags); |
450 CCommandConstructorBase* aliasedCommand = CThreadCommandConstructor::NewLC(aConstructor, aFlags, iThreadPool); |
448 CCommandConstructorBase* constructor = CAliasCommandConstructor::NewLC(aAliasName, aliasedCommand, aAdditionalArguments, aReplacementArguments); |
451 CCommandConstructorBase* constructor = CAliasCommandConstructor::NewLC(aAliasName, aliasedCommand, aAdditionalArguments, aReplacementArguments); |
449 CleanupStack::Pop(2, aliasedCommand); // Now owned by "constructor". |
452 CleanupStack::Pop(2, aliasedCommand); // Now owned by "constructor". |
450 CleanupStack::PushL(constructor); |
453 CleanupStack::PushL(constructor); |
451 constructor->SetAttributes(aAttributes); |
454 constructor->SetAttributes(aAttributes); |
452 AddCommandL(constructor); |
455 AddCommandL(constructor); |