menucontentsrv/handlersrc/menuuninstalloperation.cpp
branchRCL_3
changeset 74 edd621764147
parent 19 502e5d91ad42
child 82 ace62b58f4b2
equal deleted inserted replaced
64:b276298d5729 74:edd621764147
    31 _LIT8( KMidletMimeType, "application/java-archive" );
    31 _LIT8( KMidletMimeType, "application/java-archive" );
    32 _LIT8( KWidgetMimeType, "application/x-nokia-widget");
    32 _LIT8( KWidgetMimeType, "application/x-nokia-widget");
    33 
    33 
    34 const TUid KMidletType = { 0x10210E26 };
    34 const TUid KMidletType = { 0x10210E26 };
    35 
    35 
    36 // ================= MEMBER FUNCTIONS =======================
    36 
       
    37 // ========================= LOCAL FUNCTIONS ===============
       
    38 
       
    39 // ---------------------------------------------------------
       
    40 // CleanupResetAndDestroy()
       
    41 // ---------------------------------------------------------
       
    42 //
       
    43 template<class T>
       
    44 static void CleanupResetAndDestroy( TAny* aObj )
       
    45     {
       
    46     if( aObj )
       
    47         {
       
    48         static_cast<T*>( aObj )->ResetAndDestroy();
       
    49         }
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------
       
    53 // CleanupResetAndDestroyPushL
       
    54 // ---------------------------------------------------------
       
    55 //
       
    56 template<class T>
       
    57 static void CleanupResetAndDestroyPushL(T& aArray)
       
    58     {
       
    59     CleanupStack::PushL( TCleanupItem( &CleanupResetAndDestroy<T>, &aArray ) );
       
    60     }
       
    61 
       
    62 // ========================= MEMBER FUNCTIONS ==============
    37 
    63 
    38 // ---------------------------------------------------------
    64 // ---------------------------------------------------------
    39 // CMenuUninstallOperation::~CMenuUninstallOperation
    65 // CMenuUninstallOperation::~CMenuUninstallOperation
    40 // ---------------------------------------------------------
    66 // ---------------------------------------------------------
    41 //
    67 //
   215     CleanupClosePushL( packageIds );
   241     CleanupClosePushL( packageIds );
   216     
   242     
   217     iSisRegSession.InstalledUidsL( packageIds );
   243     iSisRegSession.InstalledUidsL( packageIds );
   218     
   244     
   219     RPointerArray< HBufC > packageFiles;
   245     RPointerArray< HBufC > packageFiles;
   220     CleanupClosePushL( packageFiles );
   246     CleanupResetAndDestroyPushL( packageFiles );
   221     
   247     
   222     for( TInt i = 0; i < packageIds.Count() && !found; ++i )
   248     for( TInt i = 0; i < packageIds.Count() && !found; ++i )
   223         {
   249         {
   224         const TUid packageId = packageIds[i];
   250         const TUid packageId = packageIds[i];
   225         Swi::RSisRegistryEntry packageEntry;
   251         Swi::RSisRegistryEntry packageEntry;
   237 	                {
   263 	                {
   238 	                aPackageUid = packageId;
   264 	                aPackageUid = packageId;
   239 	                found = ETrue;
   265 	                found = ETrue;
   240 	                }
   266 	                }
   241 	            }
   267 	            }
   242 	        packageFiles.ResetAndDestroy();
       
   243 	        CleanupStack::PopAndDestroy( &packageEntry );    
   268 	        CleanupStack::PopAndDestroy( &packageEntry );    
   244         	}
   269         	}
   245         }
   270         }
   246         
   271         
   247     CleanupStack::PopAndDestroy( &packageFiles );
   272     CleanupStack::PopAndDestroy( &packageFiles );