diff -r c2817bb2a55c -r cb506ec2d869 idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Wed Mar 31 13:30:40 2010 +0300 +++ b/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Wed May 12 13:35:37 2010 +0300 @@ -34,6 +34,7 @@ #include #include #include +#include #include "sapidatapluginconst.h" #include "sapidatapluginuids.hrh" @@ -78,7 +79,7 @@ // --------------------------------------------------------------------------- // CSapiDataPlugin::CSapiDataPlugin() - : iNetworkStatus( EUnknown ), iPluginState( ENone ) + : iNetworkStatus( EUnknown ), iPluginState( ENone ) { } @@ -101,16 +102,9 @@ CSapiDataPlugin::~CSapiDataPlugin() { // deactivate the publishers - if ( iData ) - { - TRAP_IGNORE( iData->ChangePublisherStatusL( KDeActive )); - - delete iData; - } - + delete iData; iObservers.Close(); Release( iContent ); - iDataArray.ResetAndDestroy(); if ( iContentModel ) @@ -124,7 +118,6 @@ } iIconArray.Reset(); - iRfs.Close(); } @@ -152,9 +145,8 @@ // Release memory of the published text iDataArray.ResetAndDestroy(); // Release memory of the published icons - iIconArray.Reset(); - - } + iIconArray.Reset(); + } } // --------------------------------------------------------------------------- @@ -359,13 +351,18 @@ } // --------------------------------------------------------------------------- -//Refresh a specific image of text in the widget +//Refresh a specific image or text in the widget // --------------------------------------------------------------------------- // void CSapiDataPlugin::RefreshL( TDesC& aContentType, TDesC& aOperation, CLiwDefaultMap* aDataMap ) - { + { + __PRINTS("*** CSapiDataPlugin::RefreshL ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x, content type: %S, operation: %S" ), + &PublisherInfo().Name(), PublisherInfo().Uid().iUid, &aContentType, &aOperation ); + const TInt observerCount( iObservers.Count() ); const TInt transactionId = reinterpret_cast( this ); @@ -398,6 +395,8 @@ iDataArray.ResetAndDestroy(); iIconArray.Reset(); } + + __PRINTS("*** CSapiDataPlugin::RefreshL - done ***"); } // --------------------------------------------------------------------------- @@ -434,6 +433,9 @@ TRAP_IGNORE( PublishL() ); TRAP_IGNORE( iData->SetStartupReasonL( KPluginStartup)); } + + // Listen for publisher registration to resend the events + TRAP_IGNORE( iData->RegisterPublisherObserverL() ); } // ---------------------------------------------------------------------------- @@ -455,6 +457,11 @@ { TRAP_IGNORE( iData->ChangePublisherStatusL( KPluginShutdown )); } + + if ( iData ) + { + TRAP_IGNORE( iData->ChangePublisherStatusL( KDeActive )); + } } // ---------------------------------------------------------------------------- @@ -612,17 +619,15 @@ iData->ConfigureL( configurationItemsArr ); iPluginState = ESuspend; + + // Listen the publisher content update + iData->RegisterContentObserverL(); // Activate the publisher iData->ChangePublisherStatusL( KActive ); - // Register for notifications - iData->RegisterPublisherObserverL(); // Execute the active trigger iData->TriggerActiveL(); - // There must be at least 1 milli second delay - // to register the second observer as both are using the - // same MLiwInterface object - iData->RegisterContentObserverL(); + } contentItemsArr.Reset(); @@ -633,6 +638,18 @@ } // ---------------------------------------------------------------------------- +// CSapiDataPlugin::SetProperty +// +// ---------------------------------------------------------------------------- +// +void CSapiDataPlugin::SetProperty( TProperty aProperty, TAny* aAny ) + { + if (aProperty == ECpsCmdBuffer ) + { + iData->SetCommandBuffer( aAny ); + } + } +// ---------------------------------------------------------------------------- // CSapiDataPlugin::GetProperty // // ----------------------------------------------------------------------------