# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273584918 -10800 # Node ID 52d91a16fec352d78d339c0ebc73a32e44f8a5af # Parent de84881f4ac3e114b2332e403bf55743252ef52d Revision: 201017 Kit: 201019 diff -r de84881f4ac3 -r 52d91a16fec3 XDMEngine/XdmProvisioning/src/xdmprovadapter.cpp --- a/XDMEngine/XdmProvisioning/src/xdmprovadapter.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/XDMEngine/XdmProvisioning/src/xdmprovadapter.cpp Tue May 11 16:35:18 2010 +0300 @@ -28,6 +28,8 @@ #include "xdmprovitem.h" #include "xdmprovadapter.h" +// for CleanupResetAndDestroyPushL +#include #ifdef _DEBUG #include @@ -305,6 +307,9 @@ #ifdef _DEBUG WriteToLog( _L8( "CXdmProvAdapter::GetSavingInfoL" ) ); #endif + + CleanupResetAndDestroyPushL( aSavingInfo ); + if ( aIndex < iProvItems.Count() - 1 ) { #ifdef _DEBUG @@ -339,7 +344,9 @@ CleanupStack::Pop( idBuf ); // >> idBuf idBuf = NULL; } - + + CleanupStack::Pop( &aSavingInfo ); + #ifdef _DEBUG WriteToLog( _L8( "CXdmProvAdapter::GetSavingInfoL done" ) ); #endif diff -r de84881f4ac3 -r 52d91a16fec3 XDMSettingsUI/data/XDMPluginRsc.rss --- a/XDMSettingsUI/data/XDMPluginRsc.rss Tue Apr 27 17:03:39 2010 +0300 +++ b/XDMSettingsUI/data/XDMPluginRsc.rss Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -96,7 +96,6 @@ { command = EGSXDMPluginCmdDelete; txt = qtn_xdm_options_delete; - flags = EEikMenuItemSpecific; }, MENU_ITEM { diff -r de84881f4ac3 -r 52d91a16fec3 XDMSettingsUI/inc/XDMPluginSLContainer.h --- a/XDMSettingsUI/inc/XDMPluginSLContainer.h Tue Apr 27 17:03:39 2010 +0300 +++ b/XDMSettingsUI/inc/XDMPluginSLContainer.h Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -163,6 +163,12 @@ * @return TDes reference to current set */ TDes& GetCurrentSetName(); + + /** + * Returns ETrue is AP used by XDM settings is in use + * @return ETrue if ap in use + */ + TBool SettingsApInUseL(TDesC& aXDMSetName); private: // Most of these methods perform operations using iData diff -r de84881f4ac3 -r 52d91a16fec3 XDMSettingsUI/inc/XDMPluginSettinglist.h --- a/XDMSettingsUI/inc/XDMPluginSettinglist.h Tue Apr 27 17:03:39 2010 +0300 +++ b/XDMSettingsUI/inc/XDMPluginSettinglist.h Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -78,6 +78,13 @@ * otherwise access point name returns here */ void GetAccessPointNameL(TInt32 aAP, TDes& aAccessPoint); + + /** + * For checking if access point is in use + * @param aAP Access point number as integer + * return ETrue if access point is in use + */ + TBool IsAccessPointInUseL(TInt32 aAP); /** * Sets the focus to the first item of the settings list diff -r de84881f4ac3 -r 52d91a16fec3 XDMSettingsUI/src/XDMPlugin.cpp --- a/XDMSettingsUI/src/XDMPlugin.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/XDMSettingsUI/src/XDMPlugin.cpp Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -42,6 +42,9 @@ // Constants + +const TInt KMaxNameLength = 255; + _LIT( KGSXDMPluginResourceFileName, "z:\\resource\\XDMPluginRsc.rsc" ); #ifdef __SCALABLE_ICONS @@ -404,6 +407,35 @@ aMenuPane->SetItemDimmed(EGSXDMPluginCmdNewExisting, ETrue); } } + + if ( iSettingListContainer ) + { + TBool inUse( EFalse ); + HBufC* currentSetName = iMainListContainer->GetCurrentSetNameLC(); + TBuf setName; + setName.Copy( currentSetName->Des() ); + TRAP_IGNORE( inUse = iSettingListContainer->SettingsApInUseL( setName ) ); + CleanupStack::PopAndDestroy( currentSetName ); + + if ( inUse ) + { + TInt pos( KErrNotFound ); + if ( aMenuPane->MenuItemExists( EGSXDMPluginCmdDelete, pos ) ) + { + aMenuPane->SetItemSpecific( EGSXDMPluginCmdDelete, EFalse ); + aMenuPane->SetItemDimmed(EGSXDMPluginCmdDelete, ETrue); + } + } + else + { + TInt pos( KErrNotFound ); + if ( aMenuPane->MenuItemExists( EGSXDMPluginCmdDelete, pos ) ) + { + aMenuPane->SetItemSpecific( EGSXDMPluginCmdDelete, ETrue ); + aMenuPane->SetItemDimmed(EGSXDMPluginCmdDelete, EFalse); + } + } + } } // --------------------------------------------------------- diff -r de84881f4ac3 -r 52d91a16fec3 XDMSettingsUI/src/XDMPluginSLContainer.cpp --- a/XDMSettingsUI/src/XDMPluginSLContainer.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/XDMSettingsUI/src/XDMPluginSLContainer.cpp Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -450,6 +450,36 @@ } // --------------------------------------------------------------------------- +// CXDMPluginSLContainer::IsAccessPointInUseL(TDesC& aXDMSetName) +// --------------------------------------------------------------------------- +// +TBool CXDMPluginSLContainer::SettingsApInUseL(TDesC& aXDMSetName) + { + TBool inUse( EFalse ); + TLex16 myLex; + iData->Reset(); + + iData->iSettingName = aXDMSetName; + AknTextUtils::ConvertDigitsTo(iData->iSettingName, EDigitTypeWestern ); + iData->iSettingId = GetSettingIdL(iData->iSettingName); + + CXdmSettingsCollection* xDMSet = NULL; + + // read the source setting + xDMSet = TXdmSettingsApi::SettingsCollectionL(iData->iSettingId); + CleanupStack::PushL(xDMSet); + iData->iAccessPointDes = xDMSet->Property(EXdmPropToNapId); + myLex.Assign(iData->iAccessPointDes); + myLex.Val(iData->iAccessPoint); + CleanupStack::PopAndDestroy(xDMSet); + + inUse = iSettingList->IsAccessPointInUseL( iData->iAccessPoint ); + iData->Reset(); + + return inUse; + } + +// --------------------------------------------------------------------------- // CXDMPluginSLContainer::SetTitlePaneTextL( const TDesC& aTitleText ) const // --------------------------------------------------------------------------- // @@ -476,6 +506,7 @@ { return ETrue; } + return EFalse; } diff -r de84881f4ac3 -r 52d91a16fec3 XDMSettingsUI/src/XDMPluginSettinglist.cpp --- a/XDMSettingsUI/src/XDMPluginSettinglist.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/XDMSettingsUI/src/XDMPluginSettinglist.cpp Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -289,6 +289,27 @@ } // ----------------------------------------------------------------------------- +// CXDMPluginSettinglist::IsAccessPointInUseL(TInt32 aAP) +// ----------------------------------------------------------------------------- +// +TBool CXDMPluginSettinglist::IsAccessPointInUseL(TInt32 aAP) + { + TBool inUse( EFalse ); + + CCommsDatabase* commsDb = CCommsDatabase::NewL( EDatabaseTypeIAP ); + CleanupStack::PushL(commsDb); + CApUtils* aPUtils = CApUtils::NewLC( *commsDb ); + TInt err(KErrNone); + // to remove id bug + TRAP(err, aAP = aPUtils->WapIdFromIapIdL(aAP)); + inUse = aPUtils->IsAPInUseL( aAP ); + // dont do anything if name not found or if some error occur + CleanupStack::PopAndDestroy(2); // commsDb, aPUtils + + return inUse; + } + +// ----------------------------------------------------------------------------- // CXDMPluginSettinglist::SetTitlePaneTextL( const TDesC& aTitleText ) const // ----------------------------------------------------------------------------- // diff -r de84881f4ac3 -r 52d91a16fec3 presencefwsimpleadpt/src/simpleplugindata.cpp --- a/presencefwsimpleadpt/src/simpleplugindata.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/presencefwsimpleadpt/src/simpleplugindata.cpp Tue May 11 16:35:18 2010 +0300 @@ -531,7 +531,7 @@ for ( TInt i = 0; i < count; i++ ) { MPresenceInfo* info = aPresenceFactory.NewPresenceInfoLC(); // << info - aEntities.Append( info ); + aEntities.AppendL( info ); // aEntities may contain entries even this method leaves CleanupStack::Pop(); // >> info @@ -539,7 +539,7 @@ // Add SIP identity to active users list MXIMPIdentity* active = aFactory.NewIdentityLC(); // << active - aActives.Append( active ); + aActives.AppendL( active ); CleanupStack::Pop(); // >> active // Convert SIP entity URI from UTF to Unicode. @@ -731,7 +731,7 @@ { // Add presentity into terminated list MXIMPIdentity* terminated = aFactory.NewIdentityLC(); // +terminated - aTerminated.Append( terminated ); + aTerminated.AppendL( terminated ); CleanupStack::Pop(); // -terminated // Convert SIP entity URI from UTF to Unicode. diff -r de84881f4ac3 -r 52d91a16fec3 presencesettingsui/data/psuigspluginrsc.rss --- a/presencesettingsui/data/psuigspluginrsc.rss Tue Apr 27 17:03:39 2010 +0300 +++ b/presencesettingsui/data/psuigspluginrsc.rss Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -91,7 +91,6 @@ { command = EPSUICmdDelete; txt = qtn_presence_settings_delete; - flags = EEikMenuItemSpecific; }, MENU_ITEM { diff -r de84881f4ac3 -r 52d91a16fec3 presencesettingsui/group/psuigsplugin.mmp --- a/presencesettingsui/group/psuigsplugin.mmp Tue Apr 27 17:03:39 2010 +0300 +++ b/presencesettingsui/group/psuigsplugin.mmp Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -74,5 +74,6 @@ LIBRARY inetprotutil.lib LIBRARY xdmsettingsapi.lib LIBRARY presencesettingsapi.lib +LIBRARY serviceprovidersettings.lib // End of File diff -r de84881f4ac3 -r 52d91a16fec3 presencesettingsui/inc/psuigspluginmodel.h --- a/presencesettingsui/inc/psuigspluginmodel.h Tue Apr 27 17:03:39 2010 +0300 +++ b/presencesettingsui/inc/psuigspluginmodel.h Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -217,6 +217,14 @@ */ HBufC* SipProfileNameL( TInt aId ); + /** + * Checks if SIP profile used by presence settings is in use + * + * @param aIndex is the index in the array + * @return ETrue if profile is registered + */ + TBool IsSipProfileRegisteredL( TInt aIndex ); + // // // XDM related @@ -280,8 +288,16 @@ * Re-arranges presence settings (name and id arrays) * to alphabetical order. */ - void ReArrangePresenceSettingsL(); - + void ReArrangePresenceSettingsL(); + + /** + * Cleans links to specific presence settings for + * service provider settings. + * + * @param aPresenceId presence settings id. + */ + void CleanServiceProviderSettingsDataL( TInt aPresenceId ); + private: // Functions from base classes /** diff -r de84881f4ac3 -r 52d91a16fec3 presencesettingsui/src/psuigsplugin.cpp --- a/presencesettingsui/src/psuigsplugin.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/presencesettingsui/src/psuigsplugin.cpp Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -398,6 +398,33 @@ { aMenuPane->DeleteMenuItem( EAknCmdHelp ); } + + TInt index( KErrNotFound ); + SettingCountAndIndex( index ); + + if ( KErrNotFound < index ) + { + // Hide delete option if sip profile used with presence settings + // is registered. + if ( iPSModel->IsSipProfileRegisteredL( index ) ) + { + TInt pos( KErrNotFound ); + if ( aMenuPane->MenuItemExists( EPSUICmdDelete, pos ) ) + { + aMenuPane->SetItemSpecific( EPSUICmdDelete, EFalse ); + aMenuPane->SetItemDimmed( EPSUICmdDelete, ETrue ); + } + } + else + { + TInt pos( KErrNotFound ); + if ( aMenuPane->MenuItemExists( EPSUICmdDelete, pos ) ) + { + aMenuPane->SetItemSpecific( EPSUICmdDelete, ETrue ); + aMenuPane->SetItemDimmed( EPSUICmdDelete, EFalse ); + } + } + } } // --------------------------------------------------------------------------- diff -r de84881f4ac3 -r 52d91a16fec3 presencesettingsui/src/psuigspluginmodel.cpp --- a/presencesettingsui/src/psuigspluginmodel.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/presencesettingsui/src/psuigspluginmodel.cpp Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -27,6 +27,10 @@ #include #include #include +#include +#include +#include + #include "psuigspluginmodel.h" // ========================= MEMBER FUNCTIONS ================================ @@ -71,6 +75,7 @@ void CPSUIGSPluginModel::ConstructL() { RetrieveSettingsL(); + ReadSipArrayFromEngineL(); iVisibleSettingName = HBufC::NewL( KPresSetNameMaxLength + 2 );// max chars + KColumnListSeparator } @@ -244,10 +249,12 @@ __ASSERT_DEBUG( aToBeDeleted < iPSIdArray.Count() , User::Panic( KPSUIGSPluginPanicCategory, KErrOverflow )); PresSettingsApi::RemoveSetL( iPSIdArray[ aToBeDeleted ]); + CleanServiceProviderSettingsDataL( iPSIdArray[ aToBeDeleted ] ); } else {// is id PresSettingsApi::RemoveSetL( aToBeDeleted ); + CleanServiceProviderSettingsDataL( aToBeDeleted ); } RefreshPSArraysL(); } @@ -318,6 +325,94 @@ } // --------------------------------------------------------------------------- +// CPSUIGSPluginModel::CleanServiceProviderSettingsDataL() +// See header for details. +// --------------------------------------------------------------------------- +// +void CPSUIGSPluginModel::CleanServiceProviderSettingsDataL( TInt aPresenceId ) + { + CSPSettings* spSettings = CSPSettings::NewLC(); + + RArray serviceIds; + CleanupClosePushL( serviceIds ); + spSettings->FindServiceIdsL( serviceIds ); + + for ( TInt i( 0 ) ; i < serviceIds.Count() ; i++ ) + { + CSPEntry* spEntry = CSPEntry::NewLC(); + CSPProperty* property1 = CSPProperty::NewLC(); + + TInt err = spSettings->FindPropertyL( + serviceIds[ i ], + ESubPropertyPresenceSettingsId, + *property1 ); + + if ( KErrNone == err ) + { + User::LeaveIfError( + spSettings->FindEntryL( serviceIds[ i ], *spEntry ) ); + + TInt presenceId( 0 ); + User::LeaveIfError( property1->GetValue( presenceId ) ); + + if ( presenceId == aPresenceId ) + { + // Delete all presence related properties from services which + // has this presence id (ESubPropertyPresenceSettingsId). + RPropertyNameArray propertyNameArray; + CleanupClosePushL( propertyNameArray ); + RPropertyNameArray propertyNameArrayToBeDeleted; + CleanupClosePushL( propertyNameArrayToBeDeleted ); + + // presence properties to be removed if found + propertyNameArray.Append( EPropertyPCSPluginId ); + propertyNameArray.Append( EPropertyPresenceSubServicePluginId ); + propertyNameArray.Append( ESubPropertyPresenceSettingsId ); + propertyNameArray.Append( ESubPropertyPresencePreferredSNAPId ); + propertyNameArray.Append( ESubPropertyPresencePreferredIAPId ); + propertyNameArray.Append( ESubPropertyPresencePresentityIDFieldType ); + propertyNameArray.Append( ESubPropertyPresenceLaunchMethod ); + propertyNameArray.Append( ESubPropertyPresenceLaunchUid ); + propertyNameArray.Append( ESubPropertyPresenceAddrScheme ); + propertyNameArray.Append( ESubPropertyPresenceEnabled ); + propertyNameArray.Append( ESubPropertyPresenceRequestPreference ); + + for ( TInt j( 0 ) ; j < propertyNameArray.Count() ; j++ ) + { + CSPProperty* property2 = CSPProperty::NewLC(); + + TInt err = spSettings->FindPropertyL( + serviceIds[ i ], + propertyNameArray[ j ], + *property2 ); + + // if property found add to be deleted array + if ( !err ) + { + propertyNameArrayToBeDeleted.Append( + propertyNameArray[ j ] ); + } + + CleanupStack::PopAndDestroy( property2 ); + } + + spSettings->DeleteServicePropertiesL( + serviceIds[ i ], propertyNameArrayToBeDeleted ); + + CleanupStack::PopAndDestroy( &propertyNameArrayToBeDeleted ); + CleanupStack::PopAndDestroy( &propertyNameArray ); + } + } + + CleanupStack::PopAndDestroy( property1 ); + CleanupStack::PopAndDestroy( spEntry ); + } + + CleanupStack::PopAndDestroy( &serviceIds ); + CleanupStack::PopAndDestroy( spSettings ); + } + +// --------------------------------------------------------------------------- // CPSUIGSPluginModel::MdcaCount() // See header for details. // --------------------------------------------------------------------------- @@ -591,6 +686,32 @@ } return HBufC::NewL( 0 );// name not found } + +// --------------------------------------------------------------------------- +// CPSUIGSPluginModel::IsSipProfileRegisteredL() +// See header for details. +// --------------------------------------------------------------------------- +// +TBool CPSUIGSPluginModel::IsSipProfileRegisteredL( TInt aIndex ) + { + TBool registered( EFalse ); + TInt sipProfileId = SipProfileId( aIndex ); + const TInt arrayCount = iSIPProfiles->Count(); + + for ( TInt i = 0; i < arrayCount; i++ ) + { + TUint32 tempValue; + iSIPProfiles->At( i )->GetParameter( KSIPProfileId, tempValue ); + + if ( tempValue == sipProfileId ) + { + iSIPProfiles->At( i )->GetParameter( + KSIPProfileRegistered, registered ); + } + } + + return registered; + } // --------------------------------------------------------------------------- // CPSUIGSPluginModel::ReadSipArrayFromEngineL() diff -r de84881f4ac3 -r 52d91a16fec3 simpledatamodeladapter/src/presencepluginconnection.cpp --- a/simpledatamodeladapter/src/presencepluginconnection.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/simpledatamodeladapter/src/presencepluginconnection.cpp Tue May 11 16:35:18 2010 +0300 @@ -108,7 +108,7 @@ const TDesC8& aETag ) { DP_SDA("CPresencePluginConnection::ConstructL loaded"); - + iETag = aETag.AllocL(); iSession = CPresencePluginSession::NewL( aServiceInfo, *this ); @@ -196,6 +196,8 @@ { DP_SDA("CPresencePluginConnection::~CPresencePluginConnection"); + Cancel(); + delete iSipPresentity; iSipPresentity = NULL; @@ -876,16 +878,17 @@ } // --------------------------------------------------------------------------- -// CPresencePluginPublisher::DoCancel() +// CPresencePluginConnection::DoCancel() // --------------------------------------------------------------------------- // void CPresencePluginConnection::DoCancel( ) { DP_SDA("CPresencePluginConnection::DoCancel CANCEL"); + iPublisher->Cancel(); } // --------------------------------------------------------------------------- -// CPresencePluginSession::RunL() +// CPresencePluginConnection::RunL() // --------------------------------------------------------------------------- // void CPresencePluginConnection::RunL( ) @@ -910,7 +913,7 @@ } // --------------------------------------------------------------------------- -// CPresencePluginSession::RunError +// CPresencePluginConnection::RunError // --------------------------------------------------------------------------- // TInt CPresencePluginConnection::RunError( TInt /*aError*/ ) diff -r de84881f4ac3 -r 52d91a16fec3 simpledatamodeladapter/src/presenceplugindata.cpp --- a/simpledatamodeladapter/src/presenceplugindata.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/simpledatamodeladapter/src/presenceplugindata.cpp Tue May 11 16:35:18 2010 +0300 @@ -800,14 +800,14 @@ { MPresenceInfo* info = aPresenceFactory.NewPresenceInfoLC();//<< info - aEntities.Append( info ); + aEntities.AppendL( info ); // aEntities may contain entries even this method leaves CleanupStack::Pop();// >> info NotifyToPrInfoL( aFactory, aPresenceFactory, *docs[i], *info ); // Add SIp identity to active users list MXIMPIdentity* active = aFactory.NewIdentityLC();// << active - aActives.Append( active ); + aActives.AppendL( active ); CleanupStack::Pop();// >> active // Convert SIP entity URI from UTF to Unicode. @@ -863,7 +863,7 @@ const TDesC8* uri8 = elem2->AttrValue( KPresenceUri8 ); MXIMPIdentity* terminated = aFactory.NewIdentityLC();// << terminated - aTerminated.Append( terminated ); + aTerminated.AppendL( terminated ); CleanupStack::Pop(); // >> terminated // Convert SIP entity URI from UTF to Unicode. diff -r de84881f4ac3 -r 52d91a16fec3 simpledatamodeladapter/src/presencepluginpublisher.cpp --- a/simpledatamodeladapter/src/presencepluginpublisher.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/simpledatamodeladapter/src/presencepluginpublisher.cpp Tue May 11 16:35:18 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -123,6 +123,7 @@ } DeleteWatchers(); + iClientStatus = NULL; } // --------------------------------------------------------------------------- @@ -575,6 +576,7 @@ DP_SDA("CPresencePluginPublisher::DoCancel CANCEL"); iXdmUtils->Cancel(); iPublisher->Close(); + iPublisher = NULL; } // --------------------------------------------------------------------------- diff -r de84881f4ac3 -r 52d91a16fec3 simpleengine/xdmrlspres/src/prescondvalidity.cpp --- a/simpleengine/xdmrlspres/src/prescondvalidity.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/simpleengine/xdmrlspres/src/prescondvalidity.cpp Tue May 11 16:35:18 2010 +0300 @@ -61,6 +61,8 @@ OPENG_DP(D_OPENG_LIT( "TPresCondValidity::GetValidity()" ) ); OPENG_DP(D_OPENG_LIT( " aRuleID = %S"),&aRuleID); + CleanupClosePushL (aValidTimes); + CXdmDocumentNode* validityNode = GetValidityNodeL(aRuleID, EFalse); if(validityNode==NULL) return KErrNotFound; @@ -99,7 +101,7 @@ for(TInt i=0; iSetLeafNode(ETrue); @@ -134,6 +136,8 @@ fromNodes.Close(); untilNodes.Close(); + + CleanupStack::Pop(); return KErrNone; } diff -r de84881f4ac3 -r 52d91a16fec3 simpleengine/xmlutils/src/simpledocument.cpp --- a/simpleengine/xmlutils/src/simpledocument.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/simpleengine/xmlutils/src/simpledocument.cpp Tue May 11 16:35:18 2010 +0300 @@ -196,12 +196,14 @@ void CSimpleDocument::GetDirectContentsL( RPointerArray& aContents ) { + CleanupClosePushL( aContents ); aContents.Reset(); TInt myCount = iContents.Count(); for ( TInt i = 0; iBaseElement(); // externalize the document into stream @@ -676,7 +678,7 @@ // calculate the size of headers TInt headerSize = KContentTypeSize + KCIDSize; HBufC8* headers = HBufC8::NewL( headerSize ); - aBuffers.Append( headers ); + aBuffers.AppendL( headers ); TPtr8 pH(headers->Des()); // append to MIME headers for the root part pH.Append( NSimpleDocument::NSimpleRoot::KContentType ); @@ -689,7 +691,7 @@ { // Let's convert next element into CBodyPart CBodyPart* cp = CBodyPart::NewL(); - aBodies.Append( cp ); + aBodies.AppendL( cp ); // Set Headers headerSize = NSimpleDocument::NSimpleContent::KContentTypeSize + @@ -700,7 +702,7 @@ headers = HBufC8::NewL( headerSize ); // Append to cleanup array - aBuffers.Append( headers ); + aBuffers.AppendL( headers ); pH.Set( headers->Des() ); // _LIT8( KMyContentType, "Content-Type: %S\r\n"); @@ -716,7 +718,7 @@ // BASE64 encode HBufC8* body64 = HBufC8::NewL( (iContents[i])->Body().Length() * KB64Expand ); - aBuffers.Append( body64 ); + aBuffers.AppendL( body64 ); TImCodecB64 codec64; codec64.Initialise(); TPtr8 desti8 = body64->Des(); diff -r de84881f4ac3 -r 52d91a16fec3 simpleengine/xmlutils/src/simpleelement.cpp --- a/simpleengine/xmlutils/src/simpleelement.cpp Tue Apr 27 17:03:39 2010 +0300 +++ b/simpleengine/xmlutils/src/simpleelement.cpp Tue May 11 16:35:18 2010 +0300 @@ -221,6 +221,7 @@ TInt CSimpleElement::SimpleElementsL( RPointerArray& aElementArray ) { + CleanupClosePushL( aElementArray ); // Reset the output array first. aElementArray.Reset(); iElements.ResetAndDestroy(); @@ -234,10 +235,12 @@ CSenElement* pElement = elems[i]; CSimpleElement* simple = CSimpleElement::NewL( pElement, EFalse ); CleanupStack::PushL( simple ); - User::LeaveIfError( aElementArray.Append( simple )); + iElements.AppendL( simple ); CleanupStack::Pop( simple ); - User::LeaveIfError( iElements.Append( simple ) ); + aElementArray.AppendL( simple ); } + CleanupStack::Pop( &aElementArray ); + return elemCount ? KErrNone : KErrNotFound; } @@ -292,6 +295,8 @@ // TInt CSimpleElement::SimpleAttributesL( RPointerArray& aArray ) { + CleanupClosePushL( aArray ); + // Reset the output array first. aArray.Reset(); iAttributes.ResetAndDestroy(); @@ -304,10 +309,12 @@ CSenBaseAttribute* pAttr = elems[i]; CSimpleAttribute* attr = CSimpleAttribute::NewL( pAttr ); CleanupStack::PushL( attr ); - User::LeaveIfError(iAttributes.Append( attr )); + iAttributes.AppendL( attr ); CleanupStack::Pop( attr ); - User::LeaveIfError(aArray.Append( attr )); + aArray.AppendL( attr ); } + CleanupStack::Pop( &aArray ); + return elemCount ? KErrNone : KErrNotFound; }