syncmlfw/syncmlnotifier/src/SyncMLPreSyncPluginInterface.cpp
branchRCL_3
changeset 28 915074efc433
parent 21 504e41245867
equal deleted inserted replaced
23:007508d6e57b 28:915074efc433
   104     TRAPD(error, ListAllImplementationsL( infoArray ));
   104     TRAPD(error, ListAllImplementationsL( infoArray ));
   105     
   105     
   106     if (error != KErrNone)
   106     if (error != KErrNone)
   107         {
   107         {
   108 		CleanupStack::PopAndDestroy( &infoArray );
   108 		CleanupStack::PopAndDestroy( &infoArray );
   109         return NULL;
   109 		User::Leave( error );
   110         }
   110         }
   111 
   111 
   112     // Instantiate plugins for all impUIds by calling 
   112     // Instantiate plugins for all impUIds by calling 
   113     // InstantiatePlugInFromImpUidL
   113     // InstantiatePlugInFromImpUidL
   114     for ( TInt i=0; i<infoArray.Count(); i++ )
   114     for ( TInt i=0; i<infoArray.Count(); i++ )
   121 
   121 
   122         if ( info.DisplayName().Compare(kDefault) == 0 )
   122         if ( info.DisplayName().Compare(kDefault) == 0 )
   123         {			
   123         {			
   124 	        //instantiate plugin for impUid
   124 	        //instantiate plugin for impUid
   125 	        defaultSyncPlugin = InstantiatePlugInFromImpUidL( impUid );
   125 	        defaultSyncPlugin = InstantiatePlugInFromImpUidL( impUid );
   126 	        defaultSyncPlugin->SetProfile(aProfileId);
   126 			defaultSyncPlugin->SetProfile(aProfileId);
       
   127 			break;
   127         }
   128         }
   128 		else
   129 		else
   129 		{
   130 		{
   130 			syncPlugin = InstantiatePlugInFromImpUidL( impUid );
   131 			syncPlugin = InstantiatePlugInFromImpUidL( impUid );
   131 			syncPlugin->SetProfile(aProfileId);
   132 			syncPlugin->SetProfile(aProfileId);
   142     }
   143     }
   143 
   144 
   144     CleanupStack::PopAndDestroy( &infoArray );
   145     CleanupStack::PopAndDestroy( &infoArray );
   145 	if(bHandleSync == true)
   146 	if(bHandleSync == true)
   146 	{		
   147 	{		
   147 		//delete defaultSyncPlugin;
   148 		
   148 	    if(defaultSyncPlugin != NULL)
   149 	     delete defaultSyncPlugin;
   149 	    {
   150 		CleanupStack::PushL(syncPlugin);
   150 	    delete defaultSyncPlugin;
       
   151 	    }
       
   152 	    CleanupStack::PushL(syncPlugin);
       
   153 		return syncPlugin;
   151 		return syncPlugin;
   154 	}
   152 	}
   155 	else
   153 	else
   156 	{      
   154 	{      
   157         CleanupStack::PushL(defaultSyncPlugin);
   155         CleanupStack::PushL(defaultSyncPlugin);