contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp
branchRCL_3
changeset 23 ace62b58f4b2
parent 19 edd621764147
equal deleted inserted replaced
22:1b207dd38b72 23:ace62b58f4b2
   253             }
   253             }
   254         }
   254         }
   255     else
   255     else
   256         {
   256         {
   257         //notification cannot be sent in this moment
   257         //notification cannot be sent in this moment
       
   258         //append KDataMap if exists
       
   259         if( iDataMapCache.TypeId() == EVariantTypeDesC8 )
       
   260             {
       
   261             TRAP_IGNORE( AppendDataMapL( aListOfMaps ) );
       
   262             }
   258         aListOfMaps->IncRef( );
   263         aListOfMaps->IncRef( );
   259         iNotifications.AppendL( aListOfMaps );
   264         iNotifications.AppendL( aListOfMaps );
   260         }
   265         }
   261     }
   266     }
   262 
   267 
   263 // ----------------------------------------------------------------------------
   268 // ----------------------------------------------------------------------------
   264 //
   269 //
   265 // ----------------------------------------------------------------------------
   270 // ----------------------------------------------------------------------------
   266 //
   271 //
   267 
       
   268 const CLiwGenericParamList* CCPNotificationHandler::GetPointerToChangeInfoList()
   272 const CLiwGenericParamList* CCPNotificationHandler::GetPointerToChangeInfoList()
   269     {
   273     {
   270     return iChangeInfoList;
   274     return iChangeInfoList;
   271     }
   275     }
   272 
   276 
   550         CleanupStack::PopAndDestroy( &value );
   554         CleanupStack::PopAndDestroy( &value );
   551         }
   555         }
   552     CleanupStack::PopAndDestroy( &type );
   556     CleanupStack::PopAndDestroy( &type );
   553     return result;
   557     return result;
   554     }    
   558     }    
       
   559 
       
   560 // ----------------------------------------------------------------------------
       
   561 //
       
   562 // ----------------------------------------------------------------------------
       
   563 //
       
   564 void CCPNotificationHandler::AppendDataMapL( CLiwDefaultList* aListOfMaps )
       
   565     {
       
   566     CP_DEBUG( _L8("CCPNotificationHandler::SendChangeInfoListL()") );
       
   567     //for every observer in session
       
   568     THashMapIter<TInt32, CCPLiwMap*> iter( iFilters );
       
   569     const CCPLiwMap*const* filter = iter.NextValue( );
       
   570     while( filter )
       
   571         {
       
   572         TInt count = aListOfMaps->Count( );
       
   573         //for every item in the input list
       
   574         for ( TInt j = 0; j < count; j++ )
       
   575             {
       
   576             TLiwVariant variant;
       
   577             variant.PushL( );
       
   578             aListOfMaps->AtL( j, variant );
       
   579             if ( variant.TypeId() == EVariantTypeMap )
       
   580                 {
       
   581                 const CLiwMap* map = variant.AsMap();
       
   582                 if ( IsProperForFilterL( *map, **filter ) )
       
   583                     {
       
   584                     if (iExtendedFlags.FindL(*iter.CurrentKey())
       
   585                             && (iDataMapCache.TypeId() == EVariantTypeDesC8))
       
   586                         {
       
   587                         //extended notifications - append data map
       
   588                         CLiwDefaultMap* extendedMap = CLiwDefaultMap::NewLC();
       
   589                         TInt count = map->Count();
       
   590                         for(TInt i=0; i<count;i++)
       
   591                             {
       
   592                             TLiwVariant temporary;
       
   593                             temporary.PushL();
       
   594                             TBuf8<KMaxKeyLength> key;
       
   595                             map->AtL(i,key);
       
   596                             map->FindL(key, temporary);
       
   597                             extendedMap->InsertL(key,temporary);
       
   598                             CleanupStack::PopAndDestroy(&temporary);
       
   599                             }
       
   600                         extendedMap->InsertL( KDataMap,iDataMapCache );
       
   601                         aListOfMaps->Remove( j );
       
   602                         aListOfMaps->AppendL( TLiwVariant( extendedMap ) );
       
   603                         CleanupStack::PopAndDestroy(extendedMap);
       
   604                         }
       
   605                     }
       
   606 
       
   607                 }
       
   608             CleanupStack::PopAndDestroy( &variant );
       
   609             }
       
   610         filter = iter.NextValue( );
       
   611         }
       
   612     }