messagingfw/msgtestfw/TestActionUtils/src/MtfTestActionUtilsUser.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 
       
    21 #include "MtfTestActionUtilsUser.h"
       
    22 
       
    23 #include <msvuids.h>
       
    24 
       
    25 
       
    26 TInt MtfTestActionUtilsUser::CopyDescriptor16To8(const TDesC16& aDesc16,TDes8& aDesc8)
       
    27 	{
       
    28 	for (TInt i=0; i<aDesc16.Length(); i++)
       
    29 		if (aDesc16[i] > 255)
       
    30 			return KErrOverflow;
       
    31 	aDesc8.Copy(aDesc16);
       
    32 	return KErrNone;
       
    33 	}
       
    34 
       
    35 
       
    36 TInt MtfTestActionUtilsUser::FinalProgressStatus(CMsvOperation& aOperation,const TRequestStatus& aStatus)
       
    37 	{
       
    38 	TInt err;
       
    39 
       
    40 	if (aOperation.Mtm() == KUidMsvLocalServiceMtm)
       
    41 		{
       
    42 		TPckgBuf<TMsvLocalOperationProgress> progress;
       
    43 		progress.Copy(aOperation.FinalProgress());
       
    44 		err = progress().iError;
       
    45 		}
       
    46 	else
       
    47 		err = aStatus.Int();
       
    48 
       
    49 	return (err);
       
    50 	}
       
    51