profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp
branchRCL_3
changeset 10 c8b9b0986973
parent 8 f62c3a3d66b8
child 11 23553eb4e470
--- a/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp	Fri Feb 19 23:06:10 2010 +0200
+++ b/profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp	Fri Mar 12 15:43:47 2010 +0200
@@ -306,41 +306,11 @@
 void CProfileEngineImpl::SetActiveProfileL( TInt aId )
     {
     PRODEBUG1( "SetActiveProfileL( %d )", aId );
-    const TInt KProEngPreviousActiveNameLength( 128 );
     CreatePubSubKeysIfNeededL(); 
 
     iMutex.Wait();
     TInt err( CheckProfileIdL( aId ) );
-    TInt nameCompare = 0;
-    if( this->IsActiveProfileTimedL() )
-        {
-		HBufC* tempProfileName = HBufC::NewL(KProEngPreviousActiveNameLength);
-		CleanupStack::PushL(tempProfileName);  
-		TPtr tempName = tempProfileName->Des();
-		TInt cenrepErr = iCenRep->Get( KProEngPreviousActiveName,tempName );
-		if( tempName.Length() )
-			{
-			TBuf<64> activeProfileName = this->ProfileLC(aId)->ProfileName().Name();
-			nameCompare = activeProfileName.Compare( tempName );
-			CleanupStack::PopAndDestroy();
-			}
-		CleanupStack::PopAndDestroy();
-		User::LeaveIfError( iCenRep->StartTransaction(
-											CRepository::EReadWriteTransaction ) );
-		iCenRep->CleanupCancelTransactionPushL();
-		iCenRep->Set(KProEngPreviousActiveName,_L(""));
-		TUint32 ignore( 0 );
     if( !err )
-			{
-			err = iCenRep->CommitTransaction( ignore );
-			}
-		else
-			{
-			iCenRep->CancelTransaction();
-			}
-		CleanupStack::PopAndDestroy();
-        }
-    if( !err && !nameCompare )
         {
         TRAP( err, DoSetActiveProfileL( aId ) );
         }
@@ -389,21 +359,7 @@
 
     if( !err )
         {
-        User::LeaveIfError( iCenRep->StartTransaction(
-                        CRepository::EReadWriteTransaction ) );
-        iCenRep->CleanupCancelTransactionPushL();
-        iCenRep->Set(KProEngPreviousActiveName,this->ActiveProfileLC()->ProfileName().Name());
-        TUint32 ignore( 0 );
-        err = iCenRep->CommitTransaction( ignore );
-        if( !err )
-            {
         TRAP( err, DoSetActiveProfileL( aId, &aTime ) );
-            }
-        else
-        	{
-        	iCenRep->CancelTransaction();
-        	}
-        CleanupStack::PopAndDestroy(2); 
         }
     iMutex.Signal();
 
@@ -789,7 +745,9 @@
         TInt activeId( ( previousId != KErrNotFound )
                        ? previousId
                        : User::LeaveIfError( ActiveProfileId() ) );
-        iProfileTiming->SetTimedProfileL( activeId, *aTime );
+        iProfileTiming->SetTimedProfileL( activeId,
+        		                          *aTime, 
+        		                          ActiveProfileL()->ProfileName().Name() );
         }
 
     TRAPD( error, UpdateActiveProfileSettingsL( *profile, ETrue ) );