idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp
branchRCL_3
changeset 31 8baec10861af
parent 30 a5a39a295112
equal deleted inserted replaced
30:a5a39a295112 31:8baec10861af
   239               }
   239               }
   240 
   240 
   241           if ( icon != NULL ) // Syntax correct but icon not found
   241           if ( icon != NULL ) // Syntax correct but icon not found
   242               {
   242               {
   243               aObserver->PublishPtr( *this, aContentId, icon , aContentId );
   243               aObserver->PublishPtr( *this, aContentId, icon , aContentId );
   244               iIconArray.Append(icon);
   244               CleanupStack::PushL( icon );
       
   245               iIconArray.AppendL( icon );
       
   246               CleanupStack::Pop( icon );
   245               } 
   247               } 
   246           else
   248           else
   247               {
   249               {
   248               err = KErrNotFound;   
   250               err = KErrNotFound;   
   249               aObserver->Clean( *this, aContentId, aContentId );
   251               aObserver->Clean( *this, aContentId, aContentId );
   283             CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
   285             CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
   284             if( KErrNone == bitmap->Duplicate( aHandle) )
   286             if( KErrNone == bitmap->Duplicate( aHandle) )
   285                 {
   287                 {
   286                 // Take the ownership
   288                 // Take the ownership
   287                 CGulIcon* icon = CGulIcon::NewL(bitmap);
   289                 CGulIcon* icon = CGulIcon::NewL(bitmap);
       
   290                 CleanupStack::PushL( icon );
   288                 if( aMaskHandle != KErrBadHandle )
   291                 if( aMaskHandle != KErrBadHandle )
   289                     {
   292                     {
   290                     CFbsBitmap* mask = new (ELeave) CFbsBitmap();
   293                     CFbsBitmap* mask = new (ELeave) CFbsBitmap();
   291                     if (KErrNone == mask->Duplicate( aMaskHandle) )
   294                     if (KErrNone == mask->Duplicate( aMaskHandle) )
   292                         {
   295                         {
   293                         icon->SetMask( mask );            
   296                         icon->SetMask( mask );            
   294                         }
   297                         }
   295                     }
   298                     }
   296                 aObserver->PublishPtr( *this, aContentId, icon , aContentId );
   299                 aObserver->PublishPtr( *this, aContentId, icon , aContentId );
   297                 iIconArray.Append(icon);
   300                 iIconArray.AppendL( icon );
       
   301                 CleanupStack::Pop( icon );
   298                 }
   302                 }
   299             else
   303             else
   300                 {
   304                 {
   301                 delete bitmap;
   305                 delete bitmap;
   302                 bitmap = NULL;
   306                 bitmap = NULL;
   482 // ----------------------------------------------------------------------------
   486 // ----------------------------------------------------------------------------
   483 //
   487 //
   484 void CSapiDataPlugin::Stop( TStopReason aReason )
   488 void CSapiDataPlugin::Stop( TStopReason aReason )
   485     {
   489     {
   486     TRAP_IGNORE( StopL( aReason ) );
   490     TRAP_IGNORE( StopL( aReason ) );
   487     
       
   488     iPluginState = EStopped;
       
   489     }
   491     }
   490 
   492 
   491 // ----------------------------------------------------------------------------
   493 // ----------------------------------------------------------------------------
   492 // CSapiDataPlugin::StopL
   494 // CSapiDataPlugin::StopL
   493 //
   495 //
   494 // ----------------------------------------------------------------------------
   496 // ----------------------------------------------------------------------------
   495 //
   497 //
   496 void CSapiDataPlugin::StopL( TStopReason aReason )
   498 void CSapiDataPlugin::StopL( TStopReason aReason )
   497     {
   499     {
   498     if ( aReason == ESystemShutdown )
   500     if ( iPluginState != EStopped )
   499         {
   501         {
   500         iData->ChangePublisherStatusL( KSystemShutdown );
   502         if ( aReason == ESystemShutdown )
   501         }
   503             {
   502     else if ( aReason == EPageShutdown )
   504             iData->ChangePublisherStatusL( KSystemShutdown );
   503         {
   505             }
   504         iData->ChangePublisherStatusL( KPageShutdown );
   506         else if ( aReason == EPageShutdown )
   505         }
   507             {
   506     else if ( aReason == EPluginShutdown )
   508             iData->ChangePublisherStatusL( KPageShutdown );
   507         {
   509             }
   508         iData->ChangePublisherStatusL( KPluginShutdown );
   510         else if ( aReason == EPluginShutdown )
   509         }
   511             {
   510 
   512             iData->ChangePublisherStatusL( KPluginShutdown );
   511     if ( iData )
   513             }
   512         {
   514     
   513         iData->ChangePublisherStatusL( KDeActive );
   515         if ( iData )
   514         }          
   516             {
       
   517             iData->ChangePublisherStatusL( KDeActive );
       
   518             }
       
   519         
       
   520         iPluginState = EStopped;
       
   521         }
   515     }
   522     }
   516 
   523 
   517 // ----------------------------------------------------------------------------
   524 // ----------------------------------------------------------------------------
   518 // CSapiDataPlugin::Resume
   525 // CSapiDataPlugin::Resume
   519 //
   526 //