os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/src/T_FileManData.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 /**
    20 @test
    21 @internalComponent
    22 
    23 This contains CT_FileManData
    24 */
    25 
    26 //	User includes
    27 #include "T_FileManData.h"
    28 #include "T_SfSrvServer.h"
    29 
    30 const TInt KMaxFileNameLength		=255;
    31 
    32 /*@{*/
    33 ///	Parameters
    34 _LIT(KPath,										"path");
    35 _LIT(KFileName,									"filename");
    36 _LIT(KFileFrom,									"filefrom");
    37 _LIT(KFileTo,									"fileto");
    38 _LIT(KOldName,									"oldname");
    39 _LIT(KNewName,									"newname");
    40 _LIT(KRFsObject,								"rfsObject");
    41 _LIT(KRFileObject,								"rfileObject");
    42 _LIT(KUseObserver,								"use_observer");
    43 _LIT(KAsync,									"async");
    44 _LIT(KTime,										"time");
    45 _LIT(KSetMask,									"setmask");
    46 _LIT(KClearMask,								"clearmask");
    47 _LIT(KOperation,								"operation");
    48 _LIT(KCurrentAction,							"current_action");
    49 _LIT(KBytes,									"bytes");
    50 _LIT(KError,									"error");
    51 _LIT(KTarget,									"target");
    52 _LIT(KSource,									"source");
    53 _LIT(KNotifyType,								"notify_type");
    54 _LIT(KReadHistory,								"read_history");
    55 _LIT(KName,										"name");
    56 _LIT(KNullDesCStr,								"KNullDesC");
    57 _LIT(KTotalBytes,								"total_bytes");
    58 _LIT(KFlag,										"flag");
    59 _LIT(KClearHistory,								"clear_history");
    60 _LIT(KSetTcontrol,								"set_tcontrol");
    61 //For searching file names.
    62 _LIT(KPattern, 									"*%S*");
    63 
    64 /// Commands
    65 _LIT(KCmdNewL,									"NewL");
    66 _LIT(KCmdAttribs,								"Attribs");
    67 _LIT(KCmdCopy,									"Copy");
    68 _LIT(KCmdMove,									"Move");
    69 _LIT(KCmdDelete,								"Delete");
    70 _LIT(KCmdRename,								"Rename");
    71 _LIT(KCmdRmDir,									"RmDir");
    72 _LIT(KCmdSetObserver,							"SetObserver");
    73 _LIT(KCmdCurrentAction,							"CurrentAction");
    74 _LIT(KCmdGetCurrentTarget,						"GetCurrentTarget");
    75 _LIT(KCmdGetCurrentSource,						"GetCurrentSource");
    76 _LIT(KCmdBytesTransferredByCopyStep,			"BytesTransferredByCopyStep");
    77 _LIT(KCmdCurrentEntry,							"CurrentEntry");
    78 _LIT(KCmdAbbreviatedPath,						"AbbreviatedPath");
    79 _LIT(KCmdFullPath,								"FullPath");
    80 _LIT(KCmdGetLastError,							"GetLastError");
    81 _LIT(KCmdGetMoreInfoAboutError,					"GetMoreInfoAboutError");
    82 _LIT(KCmdDestructor,							"~");
    83 
    84 // TActions
    85 _LIT(KENone,									"ENone");
    86 _LIT(KEAttribs,									"EAttribs");
    87 _LIT(KECopy,									"ECopy");
    88 _LIT(KEDelete,									"EDelete");
    89 _LIT(KEMove,									"EMove");
    90 _LIT(KERename,									"ERename");
    91 _LIT(KERmDir,									"ERmDir");
    92 _LIT(KERenameInvalidEntry,						"ERenameInvalidEntry");
    93 _LIT(KECopyFromHandle,							"ECopyFromHandle");
    94 
    95 
    96 // TSwitch
    97 _LIT(KEOverWrite,								"EOverWrite");
    98 _LIT(KERecurse,									"ERecurse");
    99 
   100 // TControl
   101 _LIT(KEContinue,								"EContinue");
   102 _LIT(KEAbort,									"EAbort");
   103 _LIT(KECancel,									"ECancel");
   104 _LIT(KERetry,									"ERetry");
   105 
   106 // TFileManError
   107 _LIT(KENoExtraInformation,						"ENoExtraInformation");
   108 _LIT(KEInitializationFailed,					"EInitializationFailed");
   109 _LIT(KEScanNextDirectoryFailed,					"EScanNextDirectoryFailed");
   110 _LIT(KESrcOpenFailed,							"ESrcOpenFailed");
   111 _LIT(KETrgOpenFailed,							"ETrgOpenFailed");
   112 _LIT(KENoFilesProcessed,						"ENoFilesProcessed");
   113 
   114 //Notifys
   115 _LIT(KNotifyStarted,							"started");
   116 _LIT(KNotifyOperation,							"operation");
   117 _LIT(KNotifyEnded,								"ended");
   118 
   119 
   120 
   121 CT_FileManData* CT_FileManData::NewL()
   122 /**
   123 * Two phase constructor
   124 */
   125 	{
   126 	CT_FileManData* ret = new (ELeave) CT_FileManData();
   127 	CleanupStack::PushL(ret);
   128 	ret->ConstructL();
   129 	CleanupStack::Pop(ret);
   130 	return ret;
   131 	}
   132 
   133 
   134 CT_FileManData::CT_FileManData()
   135 :	iFileMan(NULL)
   136 ,	iAsyncErrorIndex(0)
   137 ,	iAsyncCall(EFalse)
   138 ,	iFileManObserver(NULL)
   139 ,	iUseTControl(EFalse)
   140 
   141 /**
   142 * Protected constructor. First phase construction
   143 */
   144 	{
   145 	}
   146 
   147 
   148 void CT_FileManData::ConstructL()
   149 /**
   150 * Protected constructor. Second phase construction
   151 */
   152 	{
   153 	}
   154 
   155 
   156 CT_FileManData::~CT_FileManData()
   157 /**
   158 * Destructor.
   159 */
   160 	{
   161 	DoCleanup();
   162 	
   163 	iAttribs.ResetAndDestroy();
   164 	iCopy.ResetAndDestroy();
   165 	iDelete.ResetAndDestroy();
   166 	iMove.ResetAndDestroy();
   167 	iRename.ResetAndDestroy();
   168 	iRmDir.ResetAndDestroy();
   169 	
   170 	ClearHistory();
   171 	}
   172 	
   173 TAny* CT_FileManData::GetObject()
   174 	{
   175 	return iFileMan;
   176 	}
   177 	
   178 
   179 TBool CT_FileManData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
   180 /**
   181 * Process a command read from the ini file
   182 *
   183 * @param aCommand	the command to process
   184 * @param aSection	the section in the ini file requiring the command to be processed
   185 *
   186 * @return ETrue if the command is processed
   187 */
   188 	{
   189 	TBool retVal = ETrue;
   190 
   191 	if (aCommand == KCmdNewL)
   192 		{
   193 		DoCmdNewL(aSection);
   194 		}
   195 	else if (aCommand == KCmdDestructor)
   196 		{
   197 		DoCleanup();
   198 		}
   199 	else if (aCommand == KCmdAttribs)
   200 		{
   201 		DoCmdAttribsL(aSection, aAsyncErrorIndex);
   202 		}
   203 	else if (aCommand == KCmdCopy)
   204 		{ 
   205 		DoCmdCopyL(aSection, aAsyncErrorIndex);
   206 		}
   207 	else if (aCommand == KCmdMove)
   208 		{
   209 		DoCmdMoveL(aSection, aAsyncErrorIndex);
   210 		}
   211 	else if (aCommand == KCmdDelete)
   212 		{
   213 		DoCmdDeleteL(aSection, aAsyncErrorIndex);
   214 		}
   215 	else if (aCommand == KCmdRename)
   216 		{
   217 		DoCmdRenameL(aSection, aAsyncErrorIndex);
   218 		}	
   219 	else if (aCommand == KCmdRmDir)
   220 		{
   221 		DoCmdRmDirL(aSection, aAsyncErrorIndex);
   222 		}
   223 	else if (aCommand == KCmdSetObserver)
   224 		{
   225 		DoCmdSetObserver();
   226 		}
   227 	else if (aCommand == KCmdCurrentAction)
   228 		{
   229 		DoCmdCurrentAction(aSection);
   230 		}
   231 	else if (aCommand == KCmdGetCurrentTarget)
   232 		{
   233 		DoCmdGetCurrentTarget(aSection);
   234 		}
   235 	else if (aCommand == KCmdGetCurrentSource)
   236 		{
   237 		DoCmdGetCurrentSource(aSection);
   238 		}
   239 	else if (aCommand == KCmdBytesTransferredByCopyStep)
   240 		{
   241 		DoCmdBytesTransferredByCopyStep(aSection);
   242 		}
   243 	else if(aCommand == KCmdCurrentEntry)
   244 		{
   245 		DoCmdCurrentEntryL(aSection);
   246 		}
   247 	else if(aCommand == KCmdAbbreviatedPath)
   248 		{
   249 		DoCmdAbbreviatedPath(aSection);
   250 		}
   251 	else if(aCommand == KCmdFullPath)
   252 		{
   253 		DoCmdFullPath(aSection);
   254 		}
   255 	else if(aCommand == KCmdGetLastError)
   256 		{
   257 		DoCmdGetLastError(aSection);
   258 		}
   259 	else if(aCommand == KCmdGetMoreInfoAboutError)
   260 		{
   261 		DoCmdGetMoreInfoAboutError(aSection);
   262 		}
   263 	return retVal;
   264 	}
   265 
   266 void CT_FileManData::DoCleanup()
   267 	{
   268 	INFO_PRINTF1(_L("Doing cleanup"));
   269 	
   270 	if (iFileMan)
   271 		{
   272 		delete(iFileMan);
   273 		iFileMan = NULL;
   274 		}
   275 	ClearHistory();
   276 	}
   277 	
   278 /**	Inform the observer that an operation is about to start **/
   279 MFileManObserver::TControl CT_FileManData::NotifyFileManStarted()
   280 	{		
   281 	THistoryData *record = new THistoryData();
   282 	CreateHistoryRecord(*record);
   283 	iStartedHistory.Append(record);
   284 	if(record->iLastError != KErrNone)
   285 		{
   286 		if(iAsyncCall)
   287 			{
   288 			SetAsyncError(iAsyncErrorIndex, record->iLastError);
   289 			iAsyncCall = EFalse;
   290 			}
   291 		else
   292 			{
   293 			SetError(record->iLastError);
   294 			}
   295 		}
   296 	TControl ret = EContinue;	
   297 	//Check if we need to return TControl value specified in INI.
   298 	if(iUseTControl && iObserverNotifyType == ENotifyStarted)
   299 		{
   300 		TBuf<KMaxFileNameLength> buffer;
   301 		buffer.Format(KPattern(), &iNotifyFileName);
   302 		//Check if we need to return TControl for this file.
   303 		if(record->iCurrentSource.Match(buffer) != KErrNotFound)
   304 			{
   305 			iUseTControl = EFalse;
   306 			ret = iTControl;
   307 			}
   308 		}
   309 	return ret;
   310 	}
   311 	
   312 /**	Informs the observer that an operation, i.e. a copy or a move, is proceeding.	**/	
   313 MFileManObserver::TControl CT_FileManData::NotifyFileManOperation()
   314 	{	
   315 	THistoryData *record = new THistoryData();
   316 	CreateHistoryRecord(*record);
   317 	iOperationHistory.Append(record);
   318 	if(record->iLastError != KErrNone)
   319 		{
   320 		if(iAsyncCall)
   321 			{
   322 			SetAsyncError(iAsyncErrorIndex, record->iLastError);
   323 			iAsyncCall = EFalse;
   324 			}
   325 		else
   326 			{
   327 			SetError(record->iLastError);
   328 			}
   329 		}
   330 	TControl ret = EContinue;
   331 	//Check if we need to return TControl value specified in INI.
   332 	if(iUseTControl && iObserverNotifyType == ENotifyOperation)
   333 		{
   334 		TBuf<KMaxFileNameLength> buffer;
   335 		buffer.Format(KPattern(), &iNotifyFileName);
   336 		//Check if we need to return TControl for this file.
   337 		if(record->iCurrentSource.Match(buffer) != KErrNotFound)
   338 			{
   339 			iUseTControl = EFalse;
   340 			ret = iTControl;
   341 			}
   342 		}
   343 	return ret;
   344 	}
   345 	
   346 /**	Informs the observer that an operation is complete.	**/	
   347 MFileManObserver::TControl CT_FileManData::NotifyFileManEnded()
   348 	{
   349 	THistoryData *record = new THistoryData();
   350 	CreateHistoryRecord(*record);
   351 	iEndedHistory.Append(record);
   352 	if(record->iLastError != KErrNone)
   353 		{
   354 		if(iAsyncCall)
   355 			{
   356 			SetAsyncError(iAsyncErrorIndex, record->iLastError);
   357 			iAsyncCall = EFalse;
   358 			}
   359 		else
   360 			{
   361 			SetError(record->iLastError);
   362 			}
   363 		}
   364 	TControl ret = EContinue;
   365 	//Check if we need to return TControl value specified in INI.
   366 	if(iUseTControl && iObserverNotifyType == ENotifyEnded)
   367 		{
   368 		TBuf<KMaxFileNameLength> buffer;
   369 		buffer.Format(KPattern(), &iNotifyFileName);
   370 		//Check if we need to return TControl for this file.
   371 		if(record->iCurrentSource.Match(buffer) != KErrNotFound)
   372 			{
   373 			iUseTControl = EFalse;
   374 			ret = iTControl;
   375 			}
   376 		}
   377 	return ret; 
   378 	}
   379 
   380 void CT_FileManData::DoCmdNewL(const TDesC& aSection)
   381 	{	
   382 	DoCleanup();
   383 	TBool useObserver = EFalse;
   384 	
   385 	GET_OPTIONAL_BOOL_PARAMETER(KUseObserver, aSection, useObserver);
   386 	
   387 	TPtrC	rfsObjectName;
   388 	RFs*	rfsObject = NULL;
   389 	if (GET_MANDATORY_STRING_PARAMETER(KRFsObject, aSection, rfsObjectName))
   390 		{
   391 		rfsObject = (RFs*)GetDataObjectL(rfsObjectName);
   392 		}
   393 	
   394 	TInt err = KErrNone;
   395 	if(useObserver)
   396 		{
   397 		INFO_PRINTF1(_L("CFileMan::NewL(RFs, MFileManObserver)"));
   398 		TRAP(err, iFileMan = CFileMan::NewL(*rfsObject, iFileManObserver));
   399 		}
   400 	else
   401 		{
   402 		INFO_PRINTF1(_L("CFileMan::NewL(RFs)"));
   403 		TRAP(err, iFileMan = CFileMan::NewL(*rfsObject));
   404 		}
   405 	if (err != KErrNone)
   406 		{
   407 		ERR_PRINTF1(_L("CFileMan object is not created"));
   408 		SetBlockResult(EFail);
   409 		}
   410 	}
   411 	
   412 void CT_FileManData::DoCmdAttribsL(const TDesC& aSection, TInt aAsyncErrorIndex)
   413 	{
   414 	INFO_PRINTF1(_L("Setting attributes!"));
   415 	
   416 	TBool dataOk = ETrue;
   417 	
   418 	//Reading path for file or files.	
   419 	TPtrC	fileName;
   420 	if (!GET_MANDATORY_STRING_PARAMETER(KFileName, aSection, fileName))
   421 		{
   422 		dataOk = EFalse;
   423 		}
   424 	
   425 	//Reading new TTime from ini
   426 	TPtrC inputTime;
   427 	TTime iniTime;
   428 	if(GET_MANDATORY_STRING_PARAMETER(KTime, aSection, inputTime))
   429 		{	
   430 		TInt err = iniTime.Set(inputTime);
   431 		if (err != KErrNone)
   432 			{
   433 			ERR_PRINTF3(_L("Cannot convert (%S) to time. Error: %d"), &inputTime ,err);
   434 			dataOk = EFalse;
   435 			SetBlockResult(EFail);
   436 			}
   437 		}
   438 	else
   439 		{
   440 		dataOk = EFalse;
   441 		}
   442 		
   443 	//Reading Async parameter (True/False)	
   444 	TBool async = EFalse;
   445 	if(!GET_MANDATORY_BOOL_PARAMETER(KAsync, aSection, async))
   446 		{
   447 		dataOk = EFalse;
   448 		}
   449 	//Read SetMask attribute
   450 	TUint setMask;
   451 	if(!FileserverUtil::GetAttMask(*this, aSection, KSetMask(), setMask))
   452 		{
   453 		dataOk = EFalse;
   454 		}
   455 		
   456 	//Read ClearMask attribute
   457 	TUint clearMask;
   458 	if(!FileserverUtil::GetAttMask(*this, aSection, KClearMask(), clearMask))
   459 		{
   460 		dataOk = EFalse;
   461 		}
   462 		
   463 	//Read operation TSwitch
   464 	TUint operation;
   465 	if(!GetOperationFromConfig(KOperation(), aSection, operation))
   466 		{
   467 		dataOk = EFalse;
   468 		}
   469 	if(dataOk)
   470 		{
   471 		TInt error = KErrNone;
   472 		if(async)
   473 			{
   474 			CActiveCallback* active = CActiveCallback::NewLC(*this);
   475 			iAttribs.AppendL(active);
   476 			CleanupStack::Pop(active);
   477 			error = iFileMan->Attribs(fileName, setMask, clearMask, iniTime, operation, active->iStatus);
   478 			if(error == KErrNone)
   479 				{
   480 				active->Activate(aAsyncErrorIndex);
   481 				iAsyncErrorIndex = aAsyncErrorIndex;
   482 				iAsyncCall = ETrue;
   483 				IncOutstanding();
   484 				}
   485 			}
   486 		else
   487 			{
   488 			error = iFileMan->Attribs(fileName, setMask, clearMask, iniTime, operation);
   489 			}
   490 		if (error != KErrNone)
   491 			{
   492 			ERR_PRINTF3(_L("Attribs(%S) Error: %d"), &fileName, error);
   493 			SetError(error);
   494 			}
   495 		else
   496 			{
   497 			INFO_PRINTF2(_L("Attribs operation on (%S) is successfull!"), &fileName);
   498 			}
   499 		}
   500 	}
   501 void CT_FileManData::DoCmdCopyL(const TDesC& aSection, TInt aAsyncErrorIndex)
   502 	{
   503 	TBool clearHistory = EFalse;
   504 	GET_OPTIONAL_BOOL_PARAMETER(KClearHistory, aSection, clearHistory);
   505 	if(clearHistory)
   506 		{
   507 		ClearHistory();
   508 		}
   509 	TBool setTControl = EFalse;
   510 	GET_OPTIONAL_BOOL_PARAMETER(KSetTcontrol, aSection, setTControl);
   511 	if(setTControl)
   512 		{
   513 		ReadTControl(aSection);
   514 		}
   515 	
   516 	INFO_PRINTF1(_L("Coping files!"));	
   517 	TBool dataOk = ETrue;
   518 	TPtrC oldName;
   519 	TPtrC rfileObjectName;
   520 	RFile*	rfileObject = NULL;
   521 	
   522 	if (!GET_OPTIONAL_STRING_PARAMETER(KOldName, aSection, oldName))
   523 		{
   524 		if (GET_OPTIONAL_STRING_PARAMETER(KRFileObject, aSection, rfileObjectName))
   525 			{
   526 			rfileObject = (RFile*)GetDataObjectL(rfileObjectName);
   527 			}
   528 		else
   529 			{
   530 			ERR_PRINTF1(_L("Cannot read \"oldname\" or \"rfileObject\" arguments!"));
   531 			SetBlockResult(EFail);
   532 			dataOk = EFalse;
   533 			}
   534 		}
   535 		
   536 	TPtrC newName;
   537 	if (!GET_MANDATORY_STRING_PARAMETER(KNewName, aSection, newName))
   538 		{
   539 		dataOk = EFalse;
   540 		}
   541 		
   542 	TUint operation;
   543 	if (!GetOperationFromConfig(KOperation, aSection, operation))
   544 		{
   545 		dataOk = EFalse;
   546 		}
   547 	TBool async;
   548 	if (!GET_MANDATORY_BOOL_PARAMETER(KAsync, aSection, async))
   549 		{
   550 		dataOk = EFalse;
   551 		}
   552 		
   553 	if(dataOk)
   554 		{
   555 		TInt error = KErrNone;
   556 		if(async)
   557 			{
   558 			CActiveCallback* active = CActiveCallback::NewLC(*this);
   559 			iCopy.AppendL(active);
   560 			CleanupStack::Pop(active);
   561 			if(rfileObject)
   562 				{
   563 				error = iFileMan->Copy(*rfileObject, newName, operation, active->iStatus);
   564 				}
   565 			else
   566 				{
   567 				error = iFileMan->Copy(oldName, newName, operation, active->iStatus);	
   568 				}
   569 			if(error == KErrNone)
   570 				{
   571 				active->Activate(aAsyncErrorIndex);
   572 				iAsyncErrorIndex = aAsyncErrorIndex;
   573 				iAsyncCall = ETrue;
   574 	            IncOutstanding();
   575 				}
   576 			}
   577 		else
   578 			{
   579    			if(rfileObject)
   580    				{
   581    				error = iFileMan->Copy(*rfileObject, newName, operation);	
   582    				}
   583    			else
   584    				{
   585    				error = iFileMan->Copy(oldName, newName, operation);
   586    				}
   587 			}
   588 		if (error != KErrNone)
   589 			{
   590 			ERR_PRINTF2(_L("Copy(), Error: %d"), error);
   591 			SetError(error);
   592 			}
   593 		else
   594 			{
   595 			INFO_PRINTF1(_L("Copy() operation is successfully!"));
   596 			}	
   597 		}
   598 	}
   599 		
   600 void CT_FileManData::DoCmdDeleteL(const TDesC& aSection, TInt aAsyncErrorIndex)
   601 	{
   602 	TBool clearHistory = EFalse;
   603 	GET_OPTIONAL_BOOL_PARAMETER(KClearHistory, aSection, clearHistory);
   604 	if(clearHistory)
   605 		{
   606 		ClearHistory();
   607 		}
   608 	TBool setTControl = EFalse;
   609 	GET_OPTIONAL_BOOL_PARAMETER(KSetTcontrol, aSection, setTControl);
   610 	if(setTControl)
   611 		{
   612 		ReadTControl(aSection);
   613 		}
   614 		
   615 	INFO_PRINTF1(_L("Deleting files!"));
   616 	
   617 	TBool dataOk = ETrue;
   618 	TPtrC	fileName;
   619 	if (GET_MANDATORY_STRING_PARAMETER(KFileName, aSection, fileName))
   620 		{
   621 		if(fileName == KNullDesCStr)
   622 			{
   623 			fileName.Set(KNullDesC);	
   624 			}
   625 		}
   626 	else
   627 		{
   628 		dataOk = EFalse;
   629 		}
   630 	TUint operation;
   631 	if(!GetOperationFromConfig(KOperation, aSection, operation))
   632 		{
   633 		dataOk = EFalse;
   634 		}
   635 	TBool async = EFalse;
   636 	if (!GET_MANDATORY_BOOL_PARAMETER(KAsync, aSection, async))
   637 		{
   638 		dataOk = EFalse;
   639 		}
   640 	if(dataOk)
   641 		{
   642 		TInt error = KErrNone;
   643 		if(async)
   644 			{
   645 			CActiveCallback* active = CActiveCallback::NewLC(*this);
   646 			iDelete.AppendL(active);
   647 		    CleanupStack::Pop(active);
   648 		    error = iFileMan->Delete(fileName, operation, active->iStatus);
   649 			if (error == KErrNone)
   650 				{
   651 				active->Activate(aAsyncErrorIndex);
   652 				iAsyncErrorIndex = aAsyncErrorIndex;
   653 				iAsyncCall = ETrue;
   654 	            IncOutstanding();
   655 				}
   656 			}
   657 		else
   658 			{
   659 			error = iFileMan->Delete(fileName, operation);
   660 			}
   661 			
   662 		if (error != KErrNone)
   663 			{
   664 			ERR_PRINTF3(_L("Delete (%S), Error: %d"), &fileName, error);
   665 			SetError(error);
   666 			}
   667 		else
   668 			{
   669 			INFO_PRINTF2(_L("Delete (%S) operation is successfully!"), &fileName);
   670 			}
   671 		}
   672 	}
   673 	
   674 void CT_FileManData::DoCmdMoveL(const TDesC& aSection, TInt aAsyncErrorIndex)
   675 	{
   676 	TBool clearHistory = EFalse;
   677 	GET_OPTIONAL_BOOL_PARAMETER(KClearHistory, aSection, clearHistory);
   678 	if(clearHistory)
   679 		{
   680 		ClearHistory();
   681 		}
   682 	TBool setTControl = EFalse;
   683 	GET_OPTIONAL_BOOL_PARAMETER(KSetTcontrol, aSection, setTControl);
   684 	if(setTControl)
   685 		{
   686 		ReadTControl(aSection);
   687 		}
   688 		
   689 	INFO_PRINTF1(_L("Moving files!"));
   690 	
   691 	TBool	dataOk = ETrue;
   692 	TPtrC	fileFrom;
   693 	if (!GET_MANDATORY_STRING_PARAMETER(KFileFrom, aSection, fileFrom))
   694 		{
   695 		dataOk = EFalse;
   696 		}
   697 		
   698 	TPtrC	fileTo;
   699 	if (!GET_MANDATORY_STRING_PARAMETER(KFileTo, aSection, fileTo))
   700 		{
   701 		dataOk = EFalse;	
   702 		}
   703 	TBool	async;
   704 	if (!GET_MANDATORY_BOOL_PARAMETER(KAsync, aSection, async))
   705 		{
   706 		dataOk = EFalse;	
   707 		}
   708 	TUint operation;
   709 	if (!GetOperationFromConfig(KOperation, aSection, operation))
   710 		{
   711 		dataOk = EFalse;	
   712 		}
   713 	if(dataOk)
   714 		{
   715 		TInt error = KErrNone;
   716 		if(async)
   717 			{
   718 			CActiveCallback*	active = CActiveCallback::NewLC(*this);
   719 			iMove.AppendL(active);
   720 	        CleanupStack::Pop(active);	
   721 	        error = iFileMan->Move(fileFrom, fileTo, operation, active->iStatus);
   722 	        if(error == KErrNone)
   723 	        	{
   724 	        	active->Activate(aAsyncErrorIndex);
   725 				iAsyncErrorIndex = aAsyncErrorIndex;
   726 				iAsyncCall = ETrue;
   727 	            IncOutstanding();
   728 	        	}
   729 			}
   730 		else
   731 			{
   732 			error = iFileMan->Move(fileFrom, fileTo, operation);
   733 			}
   734 		if (error != KErrNone)
   735 			{
   736 			ERR_PRINTF2(_L("Move(), Error: %d"), error);
   737 			SetError(error);
   738 			}
   739 		else
   740 			{
   741 			INFO_PRINTF1(_L("Move() operation is successfully!"));
   742 			}
   743 		}	
   744 	}
   745 		
   746 void CT_FileManData::DoCmdRenameL(const TDesC& aSection, TInt aAsyncErrorIndex)
   747 	{
   748 	TBool clearHistory = EFalse;
   749 	GET_OPTIONAL_BOOL_PARAMETER(KClearHistory, aSection, clearHistory);
   750 	if(clearHistory)
   751 		{
   752 		ClearHistory();
   753 		}
   754 	TBool setTControl = EFalse;
   755 	GET_OPTIONAL_BOOL_PARAMETER(KSetTcontrol, aSection, setTControl);
   756 	if(setTControl)
   757 		{
   758 		ReadTControl(aSection);
   759 		}
   760 	INFO_PRINTF1(_L("Renaming files!"));
   761 		
   762 	TBool dataOk = ETrue;
   763 	
   764 	//Reading Old Name
   765 	TPtrC	oldName;
   766 	if (!GET_MANDATORY_STRING_PARAMETER(KOldName, aSection, oldName))
   767 		{
   768 		dataOk = EFalse;
   769 		}
   770 		
   771 	//Reading New Name
   772 	TPtrC	newName;
   773 	if (!GET_MANDATORY_STRING_PARAMETER(KNewName, aSection, newName))
   774 		{
   775 		dataOk = EFalse;
   776 		}
   777 		
   778 	//Rading TSwitch - Operation
   779 	TUint operation;
   780 	if (!GetOperationFromConfig(KOperation(), aSection, operation))
   781 		{
   782 		dataOk = EFalse;
   783 		}
   784 	//Reading async
   785 	TBool async;
   786 	if (!GET_MANDATORY_BOOL_PARAMETER(KAsync, aSection, async))
   787 		{
   788 		dataOk = EFalse;
   789 		}
   790 	if(dataOk)
   791 		{
   792 		TInt error = KErrNone;
   793 		if(async)
   794 			{
   795 			CActiveCallback* active = CActiveCallback::NewLC(*this);
   796 			iRename.AppendL(active);
   797 			CleanupStack::Pop(active);
   798 			error = iFileMan->Rename(oldName, newName, operation, active->iStatus);
   799 			if(error == KErrNone)	
   800 				{
   801 				active->Activate(aAsyncErrorIndex);
   802 				iAsyncErrorIndex = aAsyncErrorIndex;
   803 				iAsyncCall = ETrue;
   804 				IncOutstanding();
   805 				}			
   806 			}
   807 		else
   808 			{
   809 			error = iFileMan->Rename(oldName, newName, operation);
   810 			}
   811 		if (error != KErrNone)
   812 			{
   813 			ERR_PRINTF2(_L("Rename() Error: %d"), error);
   814 			SetError(error);
   815 			}
   816 		else
   817 			{
   818 			INFO_PRINTF1(_L("Rename() operation is successfully!"));
   819 			}
   820 		}	
   821 	}
   822 		
   823 void CT_FileManData::DoCmdRmDirL(const TDesC& aSection, TInt aAsyncErrorIndex)
   824 	{
   825 	INFO_PRINTF1(_L("Removing directory!"));
   826 	
   827 	TBool	dataOk = ETrue;
   828 	TPtrC	path;
   829 	
   830 	if (!GET_MANDATORY_STRING_PARAMETER(KPath, aSection, path))
   831 		{
   832 		dataOk = EFalse;
   833 		}
   834 		
   835 	TBool async = EFalse;
   836 	if (!GET_MANDATORY_BOOL_PARAMETER(KAsync, aSection, async))
   837 		{
   838 		dataOk = EFalse;
   839 		}
   840 		
   841 	if(dataOk)
   842 		{
   843 		TInt error = KErrNone;
   844 		if(async)
   845 			{
   846 			CActiveCallback* active = CActiveCallback::NewLC(*this);
   847 			iRmDir.AppendL(active);
   848 			CleanupStack::Pop(active);
   849 			error = iFileMan->RmDir(path, active->iStatus);
   850 			if(error == KErrNone)
   851 				{
   852 				active->Activate(aAsyncErrorIndex);
   853 				iAsyncErrorIndex = aAsyncErrorIndex;
   854 				iAsyncCall = ETrue;
   855 				IncOutstanding();
   856 				}
   857 			}
   858 		else
   859 			{
   860 			error = iFileMan->RmDir(path);
   861 			}
   862 		if (error != KErrNone)
   863 			{
   864 			ERR_PRINTF3(_L("RmDir(%S), Error: %d"), &path, error);
   865 			SetError(error);
   866 			}
   867 		else
   868 			{
   869 			INFO_PRINTF2(_L("Callled RmDir(%S)"), &path);
   870 			}
   871 		}
   872 	}
   873 	
   874 void CT_FileManData::DoCmdSetObserver()
   875 	{
   876 	INFO_PRINTF1(_L("Setting observer"));
   877 	
   878 	iFileMan->SetObserver(this);
   879 	}
   880 	
   881 void CT_FileManData::DoCmdCurrentAction(const TDesC& aSection)
   882 	{
   883 	TBool readHistory = EFalse;
   884 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
   885 	CFileMan::TAction currentAction = CFileMan::ENone;
   886 	TBool found = ETrue;
   887 	if(readHistory)
   888 		{
   889 		/** Get needed history array **/
   890 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
   891 		if(history)
   892 			{
   893 			CFileMan::TAction expectedAction;
   894 			found = EFalse;
   895 			if(GetActionFromConfig(KCurrentAction(), aSection, expectedAction))
   896 				{
   897 				CFileMan::TAction action;
   898 				TInt count = history->Count();
   899 				/** Search for expected TAction in history **/
   900 				for(TInt i = 0; (i < count) && (!found); i++)
   901 					{
   902 					action = ((*history)[i])->iCurrentAction;
   903 					if( action == expectedAction)
   904 						{
   905 						currentAction = action;
   906 						found = ETrue;
   907 						}
   908 					}
   909 				if(!found)
   910 					{
   911 					TPtrC expectedActionStr;
   912 					ConvertActionToString(expectedAction, expectedActionStr);
   913 					ERR_PRINTF2(_L("CurrentAction() %S not found in history!"), &expectedActionStr);
   914 					SetBlockResult(EFail);
   915 					}
   916 				}
   917 			else
   918 				{
   919 				ERR_PRINTF2(_L("Cannot read %S"), &KCurrentAction());
   920 				SetBlockResult(EFail);
   921 				}
   922 			}
   923 		}
   924 	else
   925 		{
   926 		currentAction = iFileMan->CurrentAction();	
   927 		}
   928 		
   929 	if(found)
   930 		{
   931 		TPtrC actionStr;
   932 		ConvertActionToString(currentAction, actionStr);
   933 		
   934 		CFileMan::TAction expectedAction;
   935 		if(GetActionFromConfig(KCurrentAction(), aSection, expectedAction))
   936 			{
   937 			TPtrC expectedActionStr;
   938 			ConvertActionToString(expectedAction, expectedActionStr);
   939 			if(expectedAction != currentAction)
   940 				{
   941 				ERR_PRINTF3(_L("CurrentAction(): %S != %S Expected Action"), &actionStr, &expectedActionStr);			
   942 				SetBlockResult(EFail);
   943 				}
   944 			else
   945 				{
   946 				INFO_PRINTF3(_L("CurrentAction(): %S == %S Expected Action"), &actionStr, &expectedActionStr);			
   947 				}
   948 			}
   949 		else
   950 			{
   951 			INFO_PRINTF2(_L("CurrentAction: %S"), &actionStr);
   952 			}
   953 		}
   954 	}
   955 	
   956 void CT_FileManData::DoCmdGetCurrentTarget(const TDesC& aSection)
   957 	{
   958 	TBool readHistory = EFalse;
   959 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
   960 	TFileName target;
   961 	TBool found = ETrue;
   962 	if(readHistory)
   963 		{
   964 		/** Get needed history array **/
   965 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
   966 		if(history)
   967 			{
   968 			TPtrC expectedTarget;
   969 			found = EFalse;
   970 			if(GET_MANDATORY_STRING_PARAMETER(KTarget, aSection, expectedTarget))
   971 				{
   972 				TInt count = history->Count();
   973 				/** Search for expected target in history **/
   974 				for(TInt i = 0; (!found) && (i < count); i++)
   975 					{		
   976 					if( ((*history)[i])->iCurrentTarget == expectedTarget)
   977 						{
   978 						target = ((*history)[i])->iCurrentTarget;
   979 						found = ETrue;
   980 						}
   981 					}
   982 				if(!found)
   983 					{
   984 					ERR_PRINTF2(_L("GetCurrentTarget() %S not found in history!"), &expectedTarget);
   985 					SetBlockResult(EFail);
   986 					}
   987 				}
   988 			}
   989 		}
   990 	else
   991 		{
   992 		iFileMan->GetCurrentTarget(target);
   993 		}
   994 	if(found)
   995 		{
   996 		TPtrC expectedTarget;
   997 		if(GET_OPTIONAL_STRING_PARAMETER(KTarget, aSection, expectedTarget))
   998 			{
   999 			if(target == expectedTarget)
  1000 				{
  1001 				INFO_PRINTF3(_L("GetCurrentTarget() %S == %S ExpectedResult"), &target, &expectedTarget);
  1002 				}
  1003 			else
  1004 				{
  1005 				ERR_PRINTF3(_L("GetCurrentTarget() %S != %S ExpectedResult"), &target, &expectedTarget);
  1006 				SetBlockResult(EFail);
  1007 				}
  1008 			
  1009 			}
  1010 		else
  1011 			{
  1012 			INFO_PRINTF2(_L("GetCurrentTarget() %S"), &target);	
  1013 			}
  1014 		}
  1015 	}
  1016 void CT_FileManData::DoCmdGetCurrentSource(const TDesC& aSection)
  1017 	{
  1018 	TBool readHistory = EFalse;	
  1019 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
  1020 	TFileName source;
  1021 	TBool found = ETrue;
  1022 	if(readHistory)
  1023 		{
  1024 		/** Get needed history array **/
  1025 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
  1026 		if(history)
  1027 			{
  1028 			TPtrC expectedSource;
  1029 			found = EFalse;
  1030 			if(GET_MANDATORY_STRING_PARAMETER(KSource, aSection, expectedSource))
  1031 				{
  1032 				TInt count = history->Count();
  1033 				/** Search for expected source in history **/
  1034 				for(TInt i = 0; (!found) && (i < count); i++)
  1035 					{				
  1036 					if( (*history)[i]->iCurrentSource == expectedSource)
  1037 						{
  1038 						source = (*history)[i]->iCurrentSource;
  1039 						found = ETrue;
  1040 						}
  1041 					}
  1042 				if(!found)
  1043 					{
  1044 					ERR_PRINTF2(_L("GetCurrentSource() %S not found in history!"), &expectedSource);
  1045 					SetBlockResult(EFail);
  1046 					}
  1047 				}
  1048 			}
  1049 		}
  1050 	else
  1051 		{
  1052 		iFileMan->GetCurrentSource(source);
  1053 		}
  1054 		
  1055 	if (found)
  1056 		{
  1057 		TPtrC expectedSource;
  1058 		if(GET_OPTIONAL_STRING_PARAMETER(KSource, aSection, expectedSource))
  1059 			{
  1060 			if(source == expectedSource)
  1061 				{
  1062 				INFO_PRINTF3(_L("GetCurrentSource() %S == %S ExpectedResult"), &source, &expectedSource);
  1063 				}
  1064 			else
  1065 				{
  1066 				ERR_PRINTF3(_L("GetCurrentSource() %S != %S ExpectedResult"), &source, &expectedSource);
  1067 				SetBlockResult(EFail);
  1068 				}
  1069 			
  1070 			}
  1071 		else
  1072 			{
  1073 			INFO_PRINTF2(_L("GetCurrentSource() %S"), &source);	
  1074 			}
  1075 		}
  1076 		
  1077 	}
  1078 void CT_FileManData::DoCmdBytesTransferredByCopyStep(const TDesC& aSection)
  1079 	{
  1080 	TBool readHistory = EFalse;
  1081 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
  1082 	TInt bytes = 0;
  1083 	TBool found = ETrue;
  1084 	if(readHistory)
  1085 		{
  1086 		/** Get needed history array **/
  1087 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
  1088 		if(history)
  1089 			{
  1090 			TInt expectedBytes;
  1091 			found = EFalse;
  1092 			if(GET_MANDATORY_INT_PARAMETER(KBytes, aSection, expectedBytes))
  1093 				{
  1094 				TBool totalBytes = EFalse;
  1095 				GET_OPTIONAL_BOOL_PARAMETER(KTotalBytes, aSection, totalBytes);
  1096 				TInt count = history->Count();
  1097 				TInt bytesTemp;
  1098 				/** Search for expected transferred bytes in history **/
  1099 				for(TInt i = 0; (!found) && (i < count); i++)
  1100 					{
  1101 					bytesTemp = ((*history)[i])->iBytesTransferred;
  1102 					if(totalBytes)
  1103 						{
  1104 						bytes +=bytesTemp;
  1105 						}
  1106 					else
  1107 						{
  1108 						if( bytesTemp == expectedBytes)
  1109 							{
  1110 							bytes = bytesTemp;
  1111 							found = ETrue;
  1112 							}
  1113 						}
  1114 					}
  1115 				if(totalBytes)
  1116 					{
  1117 					found = ETrue;
  1118 					}
  1119 				if(!found)
  1120 					{
  1121 					ERR_PRINTF2(_L("BytesTransferredByCopyStep() %d not found in history!"), expectedBytes);
  1122 					SetBlockResult(EFail);
  1123 					}
  1124 				}
  1125 			}
  1126 		}
  1127 	else
  1128 		{
  1129 		bytes = iFileMan->BytesTransferredByCopyStep();
  1130 		}
  1131 	if (found)
  1132 		{
  1133 		TInt expectedBytes;	
  1134 		if(GET_OPTIONAL_INT_PARAMETER(KBytes, aSection, expectedBytes))
  1135 			{		
  1136 			if(expectedBytes != bytes)
  1137 				{
  1138 				ERR_PRINTF3(_L("BytesTransferredByCopyStep(): %d != %d Expected Bytes"), bytes, expectedBytes);
  1139 				SetBlockResult(EFail);
  1140 				}
  1141 			else
  1142 				{
  1143 				INFO_PRINTF3(_L("BytesTransferredByCopyStep(): %d == %d Expected Bytes"), bytes, expectedBytes);
  1144 				}
  1145 			}
  1146 		else
  1147 			{
  1148 			INFO_PRINTF2(_L("BytesTransferredByCopyStep(): %d"), bytes);
  1149 			}
  1150 		}
  1151 	}
  1152 void CT_FileManData::DoCmdCurrentEntryL(const TDesC& aSection)
  1153 	{
  1154 	
  1155 	TEntry* entryObject = NULL;
  1156 	TBool found = ETrue;
  1157 	TBool readHistory = EFalse;	
  1158 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
  1159 	if(readHistory)
  1160 		{
  1161 		/** Get needed history array **/
  1162 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
  1163 		if(history)
  1164 			{
  1165 			TPtrC expectedName;
  1166 			found = EFalse;
  1167 			if(GET_MANDATORY_STRING_PARAMETER(KName, aSection, expectedName))
  1168 				{
  1169 				TInt count = history->Count();
  1170 				TEntry entry;
  1171 				/** Search for expected TEntry.iName in history **/
  1172 				for(TInt i = 0; (!found) && (i < count); i++)
  1173 					{
  1174 					entry = ((*history)[i])->iCurrentEntry;
  1175 					if( entry.iName == expectedName)
  1176 						{
  1177 						entryObject = &entry;
  1178 						found = ETrue;
  1179 						}
  1180 					}
  1181 				if(!found)
  1182 					{
  1183 					ERR_PRINTF1(_L("CurrentEntry() not found in history!"));
  1184 					SetBlockResult(EFail);
  1185 					}
  1186 				}	
  1187 			}
  1188 		}
  1189 	else
  1190 		{
  1191 		*entryObject = iFileMan->CurrentEntry();
  1192 		}
  1193 	if(found)
  1194 		{
  1195 		if(!FileserverUtil::VerifyTEntryDataFromIniL(*this, aSection, *entryObject))
  1196 			{
  1197 			SetBlockResult(EFail);	
  1198 			}
  1199 		}
  1200 		
  1201 	}
  1202 void CT_FileManData::DoCmdAbbreviatedPath(const TDesC& aSection)
  1203 	{
  1204 	TBool readHistory = EFalse;	
  1205 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
  1206 	TPtrC path;
  1207 	TBool found = ETrue;
  1208 	if(readHistory)
  1209 		{
  1210 		/** Get needed history array **/
  1211 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
  1212 		if(history)
  1213 			{
  1214 			TPtrC expectedPath;
  1215 			found = EFalse;
  1216 			if(GET_MANDATORY_STRING_PARAMETER(KPath, aSection, expectedPath))
  1217 				{
  1218 				TInt count = history->Count();
  1219 				/** Search for expected abbreviated path in history **/
  1220 				for(TInt i = 0; (!found) && (i < count); i++)
  1221 					{	
  1222 					if( ((*history)[i])->iAbbreviatedPath == expectedPath)
  1223 						{
  1224 						path.Set(((*history)[i])->iAbbreviatedPath);
  1225 						found = ETrue;
  1226 						}
  1227 					}
  1228 				if(!found)
  1229 					{
  1230 					ERR_PRINTF2(_L("AbbreviatedPath() %S not found in history!"), &expectedPath);
  1231 					SetBlockResult(EFail);
  1232 					}
  1233 				}
  1234 			}
  1235 		}
  1236 	else
  1237 		{
  1238 		path.Set(iFileMan->AbbreviatedPath());
  1239 		}
  1240 		
  1241 	if (found)
  1242 		{
  1243 		TPtrC expectedPath;
  1244 		if(GET_OPTIONAL_STRING_PARAMETER(KPath, aSection, expectedPath))
  1245 			{		
  1246 			if(expectedPath.Compare(path) != 0)
  1247 				{
  1248 				ERR_PRINTF3(_L("AbbreviatedPath(): %S != %S Expected Path"), &path, &expectedPath);
  1249 				SetBlockResult(EFail);
  1250 				}
  1251 			else
  1252 				{
  1253 				INFO_PRINTF3(_L("AbbreviatedPath(): %S == %S Expected Path"), &path, &expectedPath);
  1254 				}
  1255 			}
  1256 		else
  1257 			{
  1258 			INFO_PRINTF2(_L("AbbreviatedPath(): %S"), &path);
  1259 			}
  1260 		}
  1261 	}
  1262 void CT_FileManData::DoCmdFullPath(const TDesC& aSection)
  1263 	{
  1264 	TBool readHistory = EFalse;	
  1265 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
  1266 	TPtrC fullPath;
  1267 	TBool found = ETrue;
  1268 	if(readHistory)
  1269 		{
  1270 		/** Get needed history array **/
  1271 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
  1272 		if(history)
  1273 			{
  1274 			TPtrC expectedPath;
  1275 			found = EFalse;
  1276 			if(GET_MANDATORY_STRING_PARAMETER(KPath, aSection, expectedPath))
  1277 				{
  1278 				TInt count = history->Count();
  1279 				/** Search for expected full path in history **/
  1280 				for(TInt i = 0; (!found) && (i < count); i++)
  1281 					{	
  1282 					if( ((*history)[i])->iFullPath == expectedPath)
  1283 						{
  1284 						fullPath.Set(((*history)[i])->iFullPath);
  1285 						found = ETrue;
  1286 						}
  1287 					}
  1288 				if(!found)
  1289 					{
  1290 					ERR_PRINTF2(_L("FullPath() %S not found in history!"), &expectedPath);
  1291 					SetBlockResult(EFail);
  1292 					}	
  1293 				}
  1294 			}
  1295 		}
  1296 	else
  1297 		{
  1298 		fullPath.Set(iFileMan->FullPath());
  1299 		}
  1300 	if(found)
  1301 		{
  1302 		TPtrC expectedPath;
  1303 		if(GET_OPTIONAL_STRING_PARAMETER(KPath, aSection, expectedPath))
  1304 			{		
  1305 			if(expectedPath.Compare(fullPath) != 0)
  1306 				{
  1307 				ERR_PRINTF3(_L("FullPath(): %S != %S Expected Path"), &fullPath, &expectedPath);
  1308 				SetBlockResult(EFail);
  1309 				}
  1310 			else
  1311 				{
  1312 				INFO_PRINTF3(_L("FullPath(): %S == %S Expected Path"), &fullPath, &expectedPath);
  1313 				}
  1314 			}
  1315 		else
  1316 			{
  1317 			INFO_PRINTF2(_L("FullPath(): %S"), &fullPath);
  1318 			}
  1319 		}
  1320 	}
  1321 void CT_FileManData::DoCmdGetLastError(const TDesC& aSection)
  1322 	{
  1323 	TBool readHistory = EFalse;	
  1324 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
  1325 	TInt lastError = KErrNone;
  1326 	TBool found = ETrue;
  1327 	if(readHistory)
  1328 		{
  1329 		/** Get needed history array **/
  1330 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
  1331 		if(history)
  1332 			{
  1333 			TInt expectedError;
  1334 			found = EFalse;
  1335 			if(GET_MANDATORY_INT_PARAMETER(KError, aSection, expectedError))
  1336 				{
  1337 				TInt count = history->Count();
  1338 				TInt err;
  1339 				/** Search for expected error in history **/
  1340 				for(TInt i = 0; (!found) && (i < count); i++)
  1341 					{	
  1342 					err = (*history)[i]->iLastError;			
  1343 					if( err == expectedError)
  1344 						{
  1345 						lastError = err;
  1346 						found = ETrue;
  1347 						}
  1348 					}
  1349 				if(!found)
  1350 					{
  1351 					ERR_PRINTF2(_L("GetLastError() %d not found in history!"), expectedError);
  1352 					SetBlockResult(EFail);
  1353 					}
  1354 				}
  1355 			}
  1356 		}
  1357 	else
  1358 		{
  1359 		lastError = iFileMan->GetLastError();
  1360 		}
  1361 	if (found)
  1362 		{
  1363 		TInt expectedError;	
  1364 		if(GET_OPTIONAL_INT_PARAMETER(KError, aSection, expectedError))
  1365 			{		
  1366 			if(expectedError != lastError)
  1367 				{
  1368 				ERR_PRINTF3(_L("GetLastError(): %d != %d Expected Error"), lastError, expectedError);
  1369 				SetBlockResult(EFail);
  1370 				}
  1371 			else
  1372 				{
  1373 				INFO_PRINTF3(_L("GetLastError(): %d == %d Expected Error"), lastError, expectedError);
  1374 				}
  1375 			}
  1376 		else
  1377 			{
  1378 			INFO_PRINTF2(_L("GetLastError(): %d"), lastError);
  1379 			}
  1380 		}
  1381 	}
  1382 		
  1383 void CT_FileManData::DoCmdGetMoreInfoAboutError(const TDesC& aSection)
  1384 	{
  1385 	TBool readHistory = EFalse;	
  1386 	GET_OPTIONAL_BOOL_PARAMETER(KReadHistory, aSection, readHistory);
  1387 	TFileManError lastError;
  1388 	TBool found = ETrue;
  1389 	if(readHistory)
  1390 		{
  1391 		/** Get needed history array **/
  1392 		RPointerArray<THistoryData>* history = GetHistoryDataByType(aSection);
  1393 		if(history)
  1394 			{
  1395 			TFileManError expectedError;
  1396 			found = EFalse;
  1397 			if(GetFileManErrorFromConfig(KError, aSection, expectedError))
  1398 				{
  1399 				TInt count = history->Count();
  1400 				TFileManError error;
  1401 				/** Search for expected error in history **/
  1402 				for(TInt i = 0; (!found) && (i < count); i++)
  1403 					{
  1404 					error = (*history)[i]->iMoreInfoAboutError;
  1405 					if( (error == expectedError))
  1406 						{
  1407 						lastError = error;
  1408 						found = ETrue;
  1409 						}
  1410 					}
  1411 				if(!found)
  1412 					{
  1413 					ERR_PRINTF2(_L("GetMoreInfoAboutError() %S not found in history!"), expectedError);
  1414 					SetBlockResult(EFail);
  1415 					}
  1416 				}
  1417 			}
  1418 		}
  1419 	else
  1420 		{
  1421 		lastError = iFileMan->GetMoreInfoAboutError();
  1422 		}
  1423 	if (found)
  1424 		{
  1425 		TPtrC errorStr;
  1426 		ConvertFileManErrorToString(lastError, errorStr);
  1427 		TFileManError expectedError;
  1428 		if(GetFileManErrorFromConfig(KError, aSection, expectedError))
  1429 			{
  1430 			TPtrC expectedErrorStr;
  1431 			ConvertFileManErrorToString(expectedError, expectedErrorStr);
  1432 			
  1433 			if(expectedError != lastError)
  1434 				{
  1435 				ERR_PRINTF3(_L("GetMoreInfoAboutError(): %S != %S Expected Error"), &errorStr, &expectedErrorStr);
  1436 				SetBlockResult(EFail);
  1437 				}
  1438 			else
  1439 				{
  1440 				INFO_PRINTF3(_L("GetMoreInfoAboutError(): %S == %S Expected Error"), &errorStr, &expectedErrorStr);
  1441 				}
  1442 			}
  1443 		else
  1444 			{
  1445 			INFO_PRINTF2(_L("GetMoreInfoAboutError(): %S"), &errorStr);
  1446 			}
  1447 		}
  1448 		
  1449 	}
  1450 void CT_FileManData::RunL(CActive* aActive, TInt aIndex)
  1451 /**
  1452  Virtual RunL - Called on completion of an asynchronous command
  1453  @internalComponent
  1454  @see MActiveCallback
  1455  @param aActive Active Object that RunL has been called on
  1456  @pre N/A
  1457  @post N/A
  1458  @leave system wide error code
  1459 */
  1460 	{
  1461 	INFO_PRINTF1(_L("CT_FileManData::RunL Called"));
  1462 	TBool	foundActiveObject = EFalse;
  1463 	TInt	index=0;
  1464 	TInt	count=0;
  1465 	TBool	completed=ETrue;
  1466 	
  1467 	count = iAttribs.Count();
  1468 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1469  		{
  1470  		if( aActive == iAttribs[index] )
  1471 			{   
  1472 			INFO_PRINTF1(_L("RunL iAttribs called"));
  1473 			foundActiveObject = ETrue;
  1474 			iAttribs.Remove(index);
  1475 	 		}
  1476 		}
  1477 
  1478 	count = iCopy.Count();
  1479 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1480  		{
  1481  		if( aActive == iCopy[index] )
  1482 			{						    
  1483 			INFO_PRINTF1(_L("RunL iCopy called"));
  1484 			foundActiveObject = ETrue;
  1485 			iCopy.Remove(index);
  1486 	 		}
  1487 		}	
  1488 	
  1489 	count = iDelete.Count();
  1490 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1491  		{
  1492  		if( aActive == iDelete[index] )
  1493 			{						    
  1494 			INFO_PRINTF1(_L("RunL iDelete called"));
  1495 			foundActiveObject = ETrue;
  1496 			iDelete.Remove(index);
  1497 	 		}
  1498 		}
  1499 		
  1500 	count = iMove.Count();
  1501 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1502  		{
  1503  		if( aActive == iMove[index] )
  1504 			{						    
  1505 			INFO_PRINTF1(_L("RunL iMove called"));
  1506 			foundActiveObject = ETrue;
  1507 			iMove.Remove(index);
  1508 	 		}
  1509 		}
  1510 		
  1511 	count = iRename.Count();
  1512 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1513  		{
  1514  		if( aActive == iRename[index] )
  1515 			{						    
  1516 			INFO_PRINTF1(_L("RunL iRename called"));
  1517 			foundActiveObject = ETrue;
  1518 			iRename.Remove(index);
  1519 	 		}
  1520 		}	
  1521 	
  1522 	count = iRmDir.Count();
  1523 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1524  		{
  1525  		if( aActive == iRmDir[index] )
  1526 			{						    
  1527 			INFO_PRINTF1(_L("RunL iRmDir called"));
  1528 			foundActiveObject = ETrue;
  1529 			iRmDir.Remove(index);
  1530 	 		}
  1531 		}
  1532 	
  1533 	if( foundActiveObject )
  1534  		{
  1535 		TInt	err = aActive->iStatus.Int();
  1536 		if( err != KErrNone )
  1537 			{
  1538 			ERR_PRINTF2(_L("RunL Error %d"), err);
  1539 			SetAsyncError( aIndex, err );
  1540 			iAsyncCall = EFalse;
  1541 			}
  1542 
  1543 		if ( completed )
  1544 			{
  1545 			// Reset the outstanding request state
  1546 			DecOutstanding();
  1547 			delete aActive;
  1548 			}
  1549 		}
  1550 	else
  1551 		{
  1552  		ERR_PRINTF1(_L("Stray RunL signal"));
  1553  		SetBlockResult(EFail);
  1554 		}
  1555 	}
  1556 	
  1557 	
  1558 void CT_FileManData::DoCancel(CActive* aActive, TInt aIndex)
  1559 /**
  1560  Virtual DoCancel - Request to cancel the asynchronous command
  1561  @internalComponent
  1562  @see - MActiveCallback
  1563  @param aActive Active Object that DoCancel has been called on
  1564  @pre - N/A
  1565  @post - N/A
  1566  @leave system wide error code
  1567 */
  1568 	{
  1569 	INFO_PRINTF1(_L("CT_FileManData::DoCancelL Called"));
  1570 	
  1571 	TBool	foundActiveObject = EFalse;
  1572 	TInt	index=0;
  1573 	TInt	count=0;
  1574 	
  1575 	
  1576 	// See if it is in iAttribs
  1577 	count = iAttribs.Count();
  1578 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1579  		{
  1580  		if( aActive == iAttribs[index] )
  1581 			{  
  1582 			INFO_PRINTF1(_L("DoCancel iAttribs called"));
  1583 			foundActiveObject = ETrue;
  1584 			iAttribs.Remove(index);
  1585 	 		}
  1586 		}
  1587 	
  1588 	// See if it is in iCopy2
  1589 	count = iCopy.Count();
  1590 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1591  		{
  1592  		if( aActive == iCopy[index] )
  1593 			{  
  1594 			INFO_PRINTF1(_L("DoCancel iCopy called"));
  1595 			foundActiveObject = ETrue;
  1596 			iCopy.Remove(index);
  1597 	 		}
  1598 		}
  1599 				
  1600 	// See if it is in iDelete
  1601 	count = iDelete.Count();
  1602 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1603  		{
  1604  		if( aActive == iDelete[index] )
  1605 			{  
  1606 			INFO_PRINTF1(_L("DoCancel iDelete called"));
  1607 			foundActiveObject = ETrue;
  1608 			iDelete.Remove(index);
  1609 	 		}
  1610 		}
  1611 		
  1612 	// See if it is in iMove
  1613 	count = iMove.Count();
  1614 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1615  		{
  1616  		if( aActive == iMove[index] )
  1617 			{  
  1618 			INFO_PRINTF1(_L("DoCancel iMove called"));
  1619 			foundActiveObject = ETrue;
  1620 			iMove.Remove(index);
  1621 	 		}
  1622 		}
  1623 		
  1624 	// See if it is in iRename
  1625 	count = iRename.Count();
  1626 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1627  		{
  1628  		if( aActive == iRename[index] )
  1629 			{  
  1630 			INFO_PRINTF1(_L("DoCancel iRename called"));
  1631 			foundActiveObject = ETrue;
  1632 			iRename.Remove(index);
  1633 	 		}
  1634 		}
  1635 		
  1636 	// See if it is in iRmDir
  1637 	count = iRmDir.Count();
  1638 	for( index=0; (index<count) && (!foundActiveObject); ++index )
  1639  		{
  1640  		if( aActive == iRmDir[index] )
  1641 			{  
  1642 			INFO_PRINTF1(_L("DoCancel iRmDir called"));
  1643 			foundActiveObject = ETrue;
  1644 			iRmDir.Remove(index);
  1645 	 		}
  1646 		}
  1647 		
  1648 	if( foundActiveObject )
  1649  		{
  1650 		TInt	err = aActive->iStatus.Int();
  1651 		if( err != KErrNone )
  1652 			{
  1653 			ERR_PRINTF2(_L("DoCancel Error %d"), err);
  1654 			SetAsyncError( aIndex, err );
  1655 			}
  1656 
  1657 		// Reset the outstanding request state
  1658 		DecOutstanding();
  1659 
  1660 		delete aActive;
  1661 		}
  1662 	else
  1663 		{
  1664  		ERR_PRINTF1(_L("Stray DoCancel signal"));
  1665  		SetBlockResult(EFail);
  1666 		}
  1667 	}
  1668 		
  1669 /** Reads TFileManError from INI and converts it to TFileManError type. **/	
  1670 TBool CT_FileManData::GetFileManErrorFromConfig(const TDesC& aParameterName, const TDesC& aSection, TFileManError& aError)
  1671 	{
  1672 	TPtrC errorStr;
  1673 	TBool ret = GET_OPTIONAL_STRING_PARAMETER(aParameterName, aSection, errorStr);
  1674 	if(ret)
  1675 		{
  1676 		if(errorStr == KENoExtraInformation)
  1677 			{
  1678 			aError = ENoExtraInformation;
  1679 			}
  1680 		else if(errorStr == KEInitializationFailed)
  1681 			{
  1682 			aError = EInitializationFailed;
  1683 			}
  1684 		else if (errorStr == KEScanNextDirectoryFailed)
  1685 			{
  1686 			aError = EScanNextDirectoryFailed;
  1687 			}
  1688 		else if (errorStr == KESrcOpenFailed)
  1689 			{
  1690 			aError = ESrcOpenFailed;
  1691 			}
  1692 		else if (errorStr == KETrgOpenFailed)
  1693 			{
  1694 			aError = ETrgOpenFailed;
  1695 			}
  1696 		else if (errorStr == KENoFilesProcessed)
  1697 			{
  1698 			aError = ENoFilesProcessed;
  1699 			}
  1700 		else
  1701 			{
  1702 			ret = EFalse;	
  1703 			}
  1704 		}
  1705 	return ret;	
  1706 	}
  1707 
  1708 /** Converts TFileManError type to string **/
  1709 void CT_FileManData::ConvertFileManErrorToString(TFileManError& aError, TPtrC& aErrorStr)
  1710 	{
  1711 	if(aError == ENoExtraInformation)
  1712 		{
  1713 		aErrorStr.Set(KENoExtraInformation());
  1714 		}
  1715 	else if(aError == EInitializationFailed)
  1716 		{
  1717 		aErrorStr.Set(KEInitializationFailed());
  1718 		}
  1719 	else if (aError == EScanNextDirectoryFailed)
  1720 		{
  1721 		aErrorStr.Set(KEScanNextDirectoryFailed());
  1722 		}
  1723 	else if (aError == ESrcOpenFailed)
  1724 		{
  1725 		aErrorStr.Set(KESrcOpenFailed());
  1726 		}
  1727 	else if (aError == ETrgOpenFailed)
  1728 		{
  1729 		aErrorStr.Set(KETrgOpenFailed());
  1730 		}
  1731 	else if (aError == ENoFilesProcessed)
  1732 		{
  1733 		aErrorStr.Set(KENoFilesProcessed());
  1734 		}
  1735 	}
  1736 	
  1737 /** Converts CFileMan::TAction type to string **/
  1738 void CT_FileManData::ConvertActionToString(CFileMan::TAction aAction, TPtrC& aActionStr)
  1739 	{
  1740 	if (aAction == CFileMan::EAttribs)
  1741 		{
  1742 		aActionStr.Set(KEAttribs());
  1743 		}
  1744 	else if (aAction == CFileMan::ECopy)
  1745 		{
  1746 		aActionStr.Set(KECopy());
  1747 		}
  1748 	else if (aAction == CFileMan::EDelete)
  1749 		{
  1750 		aActionStr.Set(KEDelete());
  1751 		}
  1752 	else if (aAction == CFileMan::EMove)
  1753 		{
  1754 		aActionStr.Set(KEMove());
  1755 		}
  1756 	else if (aAction == CFileMan::ERename)
  1757 		{
  1758 		aActionStr.Set(KERename());
  1759 		}
  1760 	else if (aAction == CFileMan::ERmDir)
  1761 		{
  1762 		aActionStr.Set(KERmDir());
  1763 		}
  1764 	else if (aAction == CFileMan::ERenameInvalidEntry)
  1765 		{
  1766 		aActionStr.Set(KERenameInvalidEntry());
  1767 		}
  1768 	else if (aAction == CFileMan::ECopyFromHandle)
  1769 		{
  1770 		aActionStr.Set(KECopyFromHandle());
  1771 		}
  1772 	else
  1773 		{
  1774 		aActionStr.Set(KENone());
  1775 		}
  1776 		
  1777 	}
  1778 	
  1779 /** Reads CFileMan::TAction from INI and converts it to CFileMan::TAction type. **/
  1780 TBool CT_FileManData::GetActionFromConfig(const TDesC& aParameterName, const TDesC& aSection, CFileMan::TAction& aAction)
  1781 	{
  1782 	TPtrC actionStr;
  1783 	TBool ret = GET_OPTIONAL_STRING_PARAMETER(aParameterName, aSection, actionStr);
  1784 	if(ret)
  1785 		{		
  1786 		if (actionStr == KEAttribs)
  1787 			{
  1788 			aAction = CFileMan::EAttribs;
  1789 			}
  1790 		else if (actionStr == KECopy)
  1791 			{
  1792 			aAction = CFileMan::ECopy;
  1793 			}
  1794 		else if (actionStr == KEDelete)
  1795 			{
  1796 			aAction = CFileMan::EDelete;
  1797 			}
  1798 		else if (actionStr == KEMove)
  1799 			{
  1800 			aAction = CFileMan::EMove;
  1801 			}
  1802 		else if (actionStr == KERename)
  1803 			{
  1804 			aAction = CFileMan::ERename;
  1805 			}
  1806 		else if (actionStr == KERmDir)
  1807 			{
  1808 			aAction = CFileMan::ERmDir;
  1809 			}
  1810 		else if (actionStr == KERenameInvalidEntry)
  1811 			{
  1812 			aAction = CFileMan::ERenameInvalidEntry;
  1813 			}
  1814 		else if (actionStr == KECopyFromHandle)
  1815 			{
  1816 			aAction = CFileMan::ECopyFromHandle;
  1817 			}
  1818 		else if (actionStr == KENone)
  1819 			{
  1820 			aAction = CFileMan::ENone;
  1821 			}
  1822 		else
  1823 			{
  1824 			ret = EFalse;
  1825 			}
  1826 		}
  1827 		return ret;
  1828 	}
  1829 	
  1830 /** Reads CFileMan::TSwitch from INI and converts it to CFileMan::TSwitch type. **/
  1831 TBool CT_FileManData::GetOperationFromConfig(const TDesC& aParameterName, const TDesC& aSection, TUint& aSwitch)
  1832 	{
  1833 	TPtrC	operation;
  1834 	TBool	ret=GET_MANDATORY_STRING_PARAMETER(aParameterName, aSection, operation);
  1835 	if(ret)
  1836 		{	
  1837 		if (operation == KEOverWrite)
  1838 			{
  1839 			aSwitch = CFileMan::EOverWrite;
  1840 			}
  1841 		else if (operation == KERecurse)
  1842 			{
  1843 			aSwitch = CFileMan::ERecurse;
  1844 			}
  1845 		else
  1846 			{
  1847 			TInt operationInt=0;
  1848 			ret = GET_MANDATORY_INT_PARAMETER(aParameterName, aSection, operationInt);
  1849 			if (ret)
  1850 				{
  1851 				aSwitch = (CFileMan::TSwitch) operationInt;
  1852 				}
  1853 			}
  1854 		}
  1855 	return ret;	
  1856 	}
  1857 	
  1858 /** Clears all arrays with history **/
  1859 void CT_FileManData::ClearHistory()
  1860 	{
  1861 	INFO_PRINTF1(_L("Clearing history!"));
  1862 	
  1863 	iStartedHistory.ResetAndDestroy();
  1864 	iOperationHistory.ResetAndDestroy();
  1865 	iEndedHistory.ResetAndDestroy();	
  1866 	}
  1867 	
  1868 /**
  1869 * Creates a history entry.
  1870 * This method runs only from NotifyFileManStarted(), NotifyFileManOperation(), NotifyFileManEnded().
  1871 **/
  1872 void CT_FileManData::CreateHistoryRecord(THistoryData& aRecord)
  1873 	{
  1874 	TFileName source;
  1875 	iFileMan->GetCurrentSource(source);
  1876 	aRecord.iCurrentSource = source;
  1877 	
  1878 	TFileName target;
  1879 	iFileMan->GetCurrentTarget(target);
  1880 	aRecord.iCurrentTarget = target;
  1881 	
  1882 	aRecord.iCurrentEntry = iFileMan->CurrentEntry();
  1883 	aRecord.iBytesTransferred = iFileMan->BytesTransferredByCopyStep();
  1884 	aRecord.iCurrentAction = iFileMan->CurrentAction();
  1885 	aRecord.iLastError = iFileMan->GetLastError();
  1886 	aRecord.iMoreInfoAboutError = iFileMan->GetMoreInfoAboutError();
  1887 	aRecord.iFullPath.Set( iFileMan->FullPath() );
  1888 	aRecord.iAbbreviatedPath.Set( iFileMan->AbbreviatedPath() );	
  1889 	}
  1890 	
  1891 /** Reads type of notification from INI and converts it to TObserverNotifyType **/
  1892 TBool CT_FileManData::GetNotifyType(const TDesC& aParameterName, const TDesC& aSection, TObserverNotifyType& aType)
  1893 	{
  1894 	TPtrC	type;
  1895 	TBool	ret=GET_MANDATORY_STRING_PARAMETER(aParameterName, aSection, type);
  1896 	if(ret)
  1897 		{	
  1898 		if (type == KNotifyStarted)
  1899 			{
  1900 			aType = ENotifyStarted;
  1901 			}
  1902 		else if (type == KNotifyOperation)
  1903 			{
  1904 			aType = ENotifyOperation;
  1905 			}
  1906 		else if (type == KNotifyEnded)
  1907 			{
  1908 			aType = ENotifyEnded;
  1909 			}
  1910 		else
  1911 			{
  1912 			ret = EFalse;
  1913 			}
  1914 		}
  1915 	return ret;	
  1916 	}
  1917 
  1918 /** Returns specific array of history using TObserverNotifyType value   **/	
  1919 RPointerArray<THistoryData>* CT_FileManData::GetHistoryDataByType(const TDesC& aSection)
  1920 	{	
  1921 	TObserverNotifyType type;
  1922 	RPointerArray<THistoryData>* history = NULL;
  1923 	//Reads history name which must be returned.
  1924 	if (GetNotifyType(KNotifyType(), aSection, type))
  1925 		{
  1926 		if(type == ENotifyStarted)
  1927 			{
  1928 			history = (RPointerArray<THistoryData>*)&iStartedHistory;
  1929 			}
  1930 		else if(type == ENotifyOperation)
  1931 			{
  1932 			history = (RPointerArray<THistoryData>*)&iOperationHistory;
  1933 			}
  1934 		else if(type == ENotifyEnded)
  1935 			{
  1936 			history = (RPointerArray<THistoryData>*)&iEndedHistory;
  1937 			}
  1938 		}
  1939 	return history;
  1940 	}
  1941 /** Reads TControl from config and converts it to TControl type  **/
  1942 TBool CT_FileManData::GetTControlFromConfig(const TDesC& aParameterName, const TDesC& aSection, TControl& aFlag)
  1943 	{
  1944 	TPtrC flag;
  1945 	TBool	ret=GET_MANDATORY_STRING_PARAMETER(aParameterName, aSection, flag);
  1946 	if(ret)
  1947 		{	
  1948 		if (flag == KEContinue)
  1949 			{
  1950 			aFlag = EContinue;
  1951 			}
  1952 		else if (flag == KEAbort)
  1953 			{
  1954 			aFlag = EAbort;
  1955 			}
  1956 		else if (flag == KECancel)
  1957 			{
  1958 			aFlag = ECancel;
  1959 			}
  1960 		else if (flag == KERetry)
  1961 			{
  1962 			aFlag = ERetry;
  1963 			}
  1964 		else
  1965 			{
  1966 			ret = EFalse;
  1967 			}
  1968 		}
  1969 	return ret;	
  1970 	}
  1971 
  1972 /** Reads TControl and file name from INI  **/	
  1973 void CT_FileManData::ReadTControl(const TDesC& aSection)
  1974 	{
  1975 	TBool dataOk = ETrue;
  1976 	if(!GetNotifyType(KNotifyType(), aSection, iObserverNotifyType))
  1977 		{
  1978 			dataOk = EFalse;
  1979 		}
  1980 	TPtrC fileName;
  1981 	if(GET_MANDATORY_STRING_PARAMETER(KFileName(), aSection, fileName))
  1982 		{
  1983 		iNotifyFileName = fileName;
  1984 		}
  1985 	else
  1986 		{
  1987 		dataOk = EFalse;	
  1988 		}
  1989 	if(!GetTControlFromConfig(KFlag(), aSection, iTControl))
  1990 		{
  1991 		dataOk = EFalse;
  1992 		}
  1993 	if(dataOk)
  1994 		{
  1995 		iUseTControl = ETrue;
  1996 		}
  1997 	}
  1998 
  1999