realtimenetprots/sipfw/ProfileAgent/Client/Src/SIPProfileCleanupItem.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2002-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 // Name        : sipprofilecleanupitem
       
    15 // Part of     : SIP Profile Client
       
    16 // implementation
       
    17 // Version     : 1.0
       
    18 // INCLUDE FILES
       
    19 //
       
    20 
       
    21 
       
    22 
       
    23 #include "SipProfileCleanupItem.h"
       
    24 #include "sipmanagedprofile.h"
       
    25 #include "sipconcreteprofile.h"
       
    26 #include "SIPProfileITC.h"
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // CSIPProfileCleanupItem::CSIPProfileCleanupItem
       
    30 // -----------------------------------------------------------------------------
       
    31 //	
       
    32 CSIPProfileCleanupItem::CSIPProfileCleanupItem (CSIPProfileITC* aITC)
       
    33 	{
       
    34 	iITC = aITC;
       
    35 	iStored = EFalse;
       
    36 	}
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CSIPProfileCleanupItem::CrashRevert
       
    40 // -----------------------------------------------------------------------------
       
    41 //	
       
    42 void CSIPProfileCleanupItem::CrashRevertL()
       
    43 	{
       
    44 	if (iManagedProfile)
       
    45 		{
       
    46 		if (iStored)
       
    47 			{
       
    48 			delete iManagedProfile;
       
    49 			iManagedProfile = NULL;
       
    50 			}
       
    51 		else
       
    52 			{
       
    53 			iITC->DeleteSIPProfileL(iProfileId);
       
    54 			delete iManagedProfile;
       
    55 			iManagedProfile = NULL;
       
    56 			}
       
    57 		}
       
    58 	else if (iConcreteProfile)
       
    59 		{
       
    60 		iITC->DeleteSIPProfileL(iProfileId);
       
    61 		delete iConcreteProfile;
       
    62 		iConcreteProfile = NULL;
       
    63 		}
       
    64 	else if (iProfileId)
       
    65 		{
       
    66 		iITC->DeleteSIPProfileL(iProfileId);
       
    67 		}
       
    68 	else
       
    69 		{
       
    70 		// do nothing!
       
    71 		}
       
    72 	}