contentstorage/casrv/caappscanner/src/casrvappscanner.cpp
changeset 93 82b66994846c
parent 92 782e3408c2ab
child 94 dbb8300717f7
equal deleted inserted replaced
92:782e3408c2ab 93:82b66994846c
   220 // ---------------------------------------------------------
   220 // ---------------------------------------------------------
   221 //
   221 //
   222 void CCaSrvAppScanner::UpdateAppEntryL( CCaInnerEntry* aEntry, TUint aMmcId )
   222 void CCaSrvAppScanner::UpdateAppEntryL( CCaInnerEntry* aEntry, TUint aMmcId )
   223     {
   223     {
   224     TBool toUpdate = HandleMmcAttrUpdateL( aEntry, aMmcId );
   224     TBool toUpdate = HandleMmcAttrUpdateL( aEntry, aMmcId );
   225     toUpdate = HandleHiddenFlagUpdateL( aEntry ) || toUpdate;
   225     TBool missingVisibleFlagChanged =
   226     toUpdate = HandleMissingFlagUpdate( aEntry ) || toUpdate;
   226         HandleMissingVisibleFlagsUpdate( aEntry );
       
   227     toUpdate = missingVisibleFlagChanged || toUpdate;
   227     toUpdate = HandleLockDeleteFlagUpdateL( aEntry ) || toUpdate;
   228     toUpdate = HandleLockDeleteFlagUpdateL( aEntry ) || toUpdate;
   228     toUpdate = SetApaAppInfoL( aEntry ) || toUpdate;
   229     toUpdate = SetApaAppInfoL( aEntry ) || toUpdate;
   229 
   230     
   230     if( iInstalledPackages.Find( aEntry->GetUid() ) != KErrNotFound )
   231     if( iInstalledPackages.Find( aEntry->GetUid() ) != KErrNotFound )
   231         {
   232         {
   232         AddEntryToDownloadedCollectionL( aEntry->GetId() );
   233         AddEntryToDownloadedCollectionL( aEntry->GetId() );
   233         toUpdate = HandleUsedFlagUpdateL( aEntry ) || toUpdate;
   234         toUpdate = HandleUsedFlagUpdate( aEntry ) || toUpdate;
       
   235         AddEntryToPredefinedCollectionL( aEntry, ETrue );
   234         }
   236         }
   235     if( toUpdate )
   237     if( toUpdate )
   236         {
   238         {
   237         //update app in storage
   239         //update app in storage
   238         iCaStorageProxy.AddL( aEntry );
   240         TItemAppearance itemAppearanceChange = EItemAppearanceNotChanged;
       
   241         if( missingVisibleFlagChanged )
       
   242             {
       
   243             itemAppearanceChange = EItemAppeared;
       
   244             }
       
   245         iCaStorageProxy.AddL( aEntry, EFalse, itemAppearanceChange );
   239         RemoveFromInstalledPackages( aEntry->GetUid() );
   246         RemoveFromInstalledPackages( aEntry->GetUid() );
   240         AddEntryToPredefinedCollectionL( aEntry, ETrue );
   247         }
   241         }
   248     }
   242     }
   249 // ---------------------------------------------------------
   243 // ---------------------------------------------------------
   250 //
   244 // CCaSrvAppScanner::HandleHiddenFlagUpdateL
   251 // ---------------------------------------------------------
   245 // ---------------------------------------------------------
   252 //
   246 //
   253 TBool CCaSrvAppScanner::HandleVisibleFlagUpdate( CCaInnerEntry* aItem )
   247 TBool CCaSrvAppScanner::HandleHiddenFlagUpdateL( CCaInnerEntry* aItem )
       
   248     {
   254     {
   249     TBool toChange( EFalse );
   255     TBool toChange( EFalse );
   250     TBool itemHidden = ( 0 == ( aItem->GetFlags() & EVisible ) );
   256     if( !( aItem->GetFlags() & EVisible ) )
   251     if( itemHidden )
       
   252         {
   257         {
   253         aItem->SetFlags( aItem->GetFlags() | EVisible );
   258         aItem->SetFlags( aItem->GetFlags() | EVisible );
   254         toChange = ETrue;
   259         toChange = ETrue;
   255         }
   260         }
   256     return toChange;
   261     return toChange;
   257     }
   262     }
   258 
   263 
   259 // ---------------------------------------------------------
   264 // ---------------------------------------------------------
   260 // CCaSrvAppScanner::HandleUsedFlagUpdateL
   265 //
   261 // ---------------------------------------------------------
   266 // ---------------------------------------------------------
   262 //
   267 //
   263 TBool CCaSrvAppScanner::HandleUsedFlagUpdateL( CCaInnerEntry* aItem )
   268 TBool CCaSrvAppScanner::HandleUsedFlagUpdate( CCaInnerEntry* aItem )
   264     {
   269     {
       
   270     TBool changed( EFalse );
   265     if( aItem->GetFlags() & EUsed )
   271     if( aItem->GetFlags() & EUsed )
   266         {
   272         {
   267         aItem->SetFlags( aItem->GetFlags() & ~EUsed );
   273         aItem->SetFlags( aItem->GetFlags() & ~EUsed );
   268         return ETrue;
   274         changed = ETrue;
   269         }
   275         }
   270     else
   276     return changed;
   271         {
       
   272         return EFalse;
       
   273         }
       
   274     }
   277     }
   275 
   278 
   276 // ---------------------------------------------------------
   279 // ---------------------------------------------------------
   277 // CCaSrvAppScanner::HandleMmcAttrUpdateL
   280 // CCaSrvAppScanner::HandleMmcAttrUpdateL
   278 // ---------------------------------------------------------
   281 // ---------------------------------------------------------
   389 
   392 
   390 // ---------------------------------------------------------
   393 // ---------------------------------------------------------
   391 // CCaSrvAppScanner::HandleMissingFlagUpdateL
   394 // CCaSrvAppScanner::HandleMissingFlagUpdateL
   392 // ---------------------------------------------------------
   395 // ---------------------------------------------------------
   393 //
   396 //
   394 TBool CCaSrvAppScanner::HandleMissingFlagUpdate( CCaInnerEntry* aItem )
   397 TBool CCaSrvAppScanner::HandleMissingVisibleFlagsUpdate( CCaInnerEntry* aItem )
   395     {
   398     {
   396     if( aItem->GetFlags() & EMissing )
   399     TBool ret( EFalse );
   397         {
   400     if( aItem->GetFlags() & EMissing ||
   398         //application found so we unset "missing" flag
   401         !( aItem->GetFlags() & EVisible ) )
   399         aItem->SetFlags( aItem->GetFlags() & ~EMissing );
   402         {
   400         return ETrue;
   403         //application found so we unset "missing" and set "visible" flags
   401         }
   404         aItem->SetFlags( aItem->GetFlags() & ~EMissing | EVisible );
   402     else
   405         ret = ETrue;
   403         {
   406         }
   404         return EFalse;
   407     return ret;
   405         }
       
   406     }
   408     }
   407 
   409 
   408 // ---------------------------------------------------------
   410 // ---------------------------------------------------------
   409 // CCaSrvAppScanner::RemoveApp
   411 // CCaSrvAppScanner::RemoveApp
   410 // ---------------------------------------------------------
   412 // ---------------------------------------------------------
   447     appEntry->SetUid( KHsAppUid.iUid );
   449     appEntry->SetUid( KHsAppUid.iUid );
   448     TInt index = aArray.Find(
   450     TInt index = aArray.Find(
   449             appEntry, TIdentityRelation<CCaInnerEntry>( UidMatch ) );
   451             appEntry, TIdentityRelation<CCaInnerEntry>( UidMatch ) );
   450 
   452 
   451     if ( index != KErrNotFound )
   453     if ( index != KErrNotFound )
   452         { // hs app already in storage - ensure it is hidden and remove from resultArray
   454         {
   453         if ( ( aArray[index]->GetFlags() & EVisible ) != 0 )
   455         // hs app already in storage - ensure it is hidden
       
   456         // and remove from resultArray
       
   457         if ( aArray[index]->GetFlags() & EVisible )
   454             {
   458             {
   455             aArray[index]->SetFlags( aArray[index]->GetFlags() & ~EVisible);
   459             aArray[index]->SetFlags( aArray[index]->GetFlags() & ~EVisible);
   456             iCaStorageProxy.AddL( aArray[index] );
   460             iCaStorageProxy.AddL( aArray[index], EFalse, EItemDisappeared );
   457             }
   461             }
   458         delete aArray[index];
   462         delete aArray[index];
   459         aArray.Remove( index );
   463         aArray.Remove( index );
   460         }
   464         }
   461     else
   465     else
   462         { // if not found add as not visible to the storage
   466         {
       
   467         // if not found add as not visible to the storage
   463         appEntry->SetEntryTypeNameL( KCaTypeApp );
   468         appEntry->SetEntryTypeNameL( KCaTypeApp );
   464         appEntry->SetFlags( 0 );
   469         appEntry->SetFlags( 0 );
   465         appEntry->SetRole( EItemEntryRole );
   470         appEntry->SetRole( EItemEntryRole );
   466         SetApaAppInfoL( appEntry );
   471         SetApaAppInfoL( appEntry );
   467         iCaStorageProxy.AddL( appEntry );
   472         iCaStorageProxy.AddL( appEntry );
   554                 KDefaultGranularity );
   559                 KDefaultGranularity );
   555         CleanupStack::PushL( typenameArray );
   560         CleanupStack::PushL( typenameArray );
   556         typenameArray->AppendL( KCaTypeMenuCollections );
   561         typenameArray->AppendL( KCaTypeMenuCollections );
   557         getAllCollectionIdQuery->SetEntryTypeNames( typenameArray );
   562         getAllCollectionIdQuery->SetEntryTypeNames( typenameArray );
   558         CleanupStack::Pop( typenameArray );
   563         CleanupStack::Pop( typenameArray );
   559         
   564 
   560         RArray<TInt> idArray;
   565         RArray<TInt> idArray;
   561         CleanupClosePushL( idArray );
   566         CleanupClosePushL( idArray );
   562         iCaStorageProxy.GetEntriesIdsL( getAllCollectionIdQuery,
   567         iCaStorageProxy.GetEntriesIdsL( getAllCollectionIdQuery,
   563                 idArray );
   568                 idArray );
   564         if( idArray.Count() )
   569         if( idArray.Count() )
   674     {
   679     {
   675     // Get entries for given aAppUid
   680     // Get entries for given aAppUid
   676     RPointerArray<CCaInnerEntry> resultArray;
   681     RPointerArray<CCaInnerEntry> resultArray;
   677     CleanupResetAndDestroyPushL( resultArray );
   682     CleanupResetAndDestroyPushL( resultArray );
   678     GetCaAppEntriesL( aAppUid, resultArray );
   683     GetCaAppEntriesL( aAppUid, resultArray );
   679     if( resultArray.Count() )
   684     if( resultArray.Count() && ( resultArray[0]->GetFlags() & EVisible ) )
   680         {
   685         {//TODO: this only for icons. This functionality should be change 
   681         iCaStorageProxy.AddL( resultArray[0] );
   686         iCaStorageProxy.AddL( resultArray[0] );
   682         }
   687         }
   683     CleanupStack::PopAndDestroy( &resultArray );
   688     CleanupStack::PopAndDestroy( &resultArray );
   684     }
   689     }
   685 
   690 
   713 
   718 
   714     if( capability().iGroupName.Length() )
   719     if( capability().iGroupName.Length() )
   715         {
   720         {
   716         // appgroup_name is defined for this app. Find or create folder.
   721         // appgroup_name is defined for this app. Find or create folder.
   717         CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC();
   722         CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC();
   718         innerQuery->SetRole( CCaInnerQuery::Group );          
   723         innerQuery->SetRole( CCaInnerQuery::Group );
   719         innerQuery->AddAttributeL( KCaAppGroupName,
   724         innerQuery->AddAttributeL( KCaAppGroupName,
   720                 capability().iGroupName );
   725                 capability().iGroupName );
   721         
   726 
   722         // get entries by attributes
   727         // get entries by attributes
   723         RPointerArray<CCaInnerEntry> resultArrayItems;
   728         RPointerArray<CCaInnerEntry> resultArrayItems;
   724         CleanupResetAndDestroyPushL( resultArrayItems );
   729         CleanupResetAndDestroyPushL( resultArrayItems );
   725         iCaStorageProxy.GetEntriesL( innerQuery, resultArrayItems );
   730         iCaStorageProxy.GetEntriesL( innerQuery, resultArrayItems );
   726 
   731 
   728         CleanupClosePushL( entryIds );
   733         CleanupClosePushL( entryIds );
   729         TInt entryId = aEntry->GetId();
   734         TInt entryId = aEntry->GetId();
   730         entryIds.AppendL( entryId );
   735         entryIds.AppendL( entryId );
   731         TCaOperationParams organizeParams;
   736         TCaOperationParams organizeParams;
   732         organizeParams.iBeforeEntryId = 0;
   737         organizeParams.iBeforeEntryId = 0;
   733         
   738 
   734         if( resultArrayItems.Count() )
   739         if( resultArrayItems.Count() )
   735             {
   740             {
   736             // collection with appgroup_name exist - add entry 
   741             // collection with appgroup_name exist - add entry
   737             // to this collection
   742             // to this collection
   738             organizeParams.iGroupId = resultArrayItems[0]->GetId();
   743             organizeParams.iGroupId = resultArrayItems[0]->GetId();
   739             }
   744             }
   740         else
   745         else
   741             {
   746             {
   742             // create new collection
   747             // create new collection
   743             TInt predefinedCollectionId = CreatePredefinedCollectionL(
   748             TInt predefinedCollectionId = CreatePredefinedCollectionL(
   744                     capability().iGroupName );
   749                     capability().iGroupName );
   745             
   750 
   746             organizeParams.iGroupId = predefinedCollectionId;
   751             organizeParams.iGroupId = predefinedCollectionId;
   747 
   752 
   748             // add new collection to all collection   
   753             // add new collection to all collection
   749             AddCollectionToAllCollectionL( predefinedCollectionId );
   754             AddCollectionToAllCollectionL( predefinedCollectionId );
   750             
   755 
   751             if( aUpdate )
   756             if( aUpdate )
   752                 {
   757                 {
   753                 organizeParams.iOperationType = TCaOperationParams::EAppend;
   758                 organizeParams.iOperationType = TCaOperationParams::EAppend;
   754                 iCaStorageProxy.OrganizeL( entryIds, organizeParams );
   759                 iCaStorageProxy.OrganizeL( entryIds, organizeParams );
   755                 }
   760                 }
   756             }
   761             }
   757         
   762 
   758         if( !aUpdate )
   763         if( !aUpdate )
   759             {
   764             {
   760             organizeParams.iOperationType = TCaOperationParams::EAppend;
   765             organizeParams.iOperationType = TCaOperationParams::EAppend;
   761             iCaStorageProxy.OrganizeL( entryIds, organizeParams );
   766             iCaStorageProxy.OrganizeL( entryIds, organizeParams );
   762             }
   767             }
   763         
   768 
   764         CleanupStack::PopAndDestroy( &entryIds );
   769         CleanupStack::PopAndDestroy( &entryIds );
   765         CleanupStack::PopAndDestroy( &resultArrayItems );
   770         CleanupStack::PopAndDestroy( &resultArrayItems );
   766         CleanupStack::PopAndDestroy( innerQuery );
   771         CleanupStack::PopAndDestroy( innerQuery );
   767         } 
   772         }
   768     }
   773     }
   769 
   774 
   770 // ---------------------------------------------------------
   775 // ---------------------------------------------------------
   771 // CCaSrvAppScanner::CreatePredefinedCollectionL
   776 // CCaSrvAppScanner::CreatePredefinedCollectionL
   772 // ---------------------------------------------------------
   777 // ---------------------------------------------------------
   785             KNullDesC, KNullDesC );
   790             KNullDesC, KNullDesC );
   786     iCaStorageProxy.AddL( innerEntry );
   791     iCaStorageProxy.AddL( innerEntry );
   787     // Get new collection Id
   792     // Get new collection Id
   788     TInt newCollectionId = innerEntry->GetId();
   793     TInt newCollectionId = innerEntry->GetId();
   789     CleanupStack::PopAndDestroy( innerEntry );
   794     CleanupStack::PopAndDestroy( innerEntry );
   790     
   795 
   791     return newCollectionId;
   796     return newCollectionId;
   792     }
   797     }
   793 
   798 
   794 // ---------------------------------------------------------
   799 // ---------------------------------------------------------
   795 // CCaSrvAppScanner::AddCollectionToAllCollectionL
   800 // CCaSrvAppScanner::AddCollectionToAllCollectionL
   798 void CCaSrvAppScanner::AddCollectionToAllCollectionL( TInt aCollectionId )
   803 void CCaSrvAppScanner::AddCollectionToAllCollectionL( TInt aCollectionId )
   799     {
   804     {
   800     RArray<TInt> entryIds;
   805     RArray<TInt> entryIds;
   801     CleanupClosePushL( entryIds );
   806     CleanupClosePushL( entryIds );
   802     entryIds.AppendL( aCollectionId );
   807     entryIds.AppendL( aCollectionId );
   803     
   808 
   804     TCaOperationParams organizeParams;
   809     TCaOperationParams organizeParams;
   805     organizeParams.iBeforeEntryId = 0;
   810     organizeParams.iBeforeEntryId = 0;
   806     organizeParams.iOperationType = TCaOperationParams::EAppend;
   811     organizeParams.iOperationType = TCaOperationParams::EAppend;
   807     organizeParams.iGroupId = GetAllCollectionIdL();
   812     organizeParams.iGroupId = GetAllCollectionIdL();
   808     iCaStorageProxy.OrganizeL( entryIds, organizeParams );
   813     iCaStorageProxy.OrganizeL( entryIds, organizeParams );
   860     SetApaAppInfoL( appEntry );
   865     SetApaAppInfoL( appEntry );
   861     HandleLockDeleteFlagUpdateL( appEntry );
   866     HandleLockDeleteFlagUpdateL( appEntry );
   862     HandleMmcAttrUpdateL( appEntry, aCurrentMmcId );
   867     HandleMmcAttrUpdateL( appEntry, aCurrentMmcId );
   863 
   868 
   864     iCaStorageProxy.AddL( appEntry );
   869     iCaStorageProxy.AddL( appEntry );
   865     
   870 
   866     AddEntryToPredefinedCollectionL( appEntry );
   871     AddEntryToPredefinedCollectionL( appEntry );
   867     
   872 
   868     if( iInstalledPackages.Find( aUid ) != KErrNotFound )
   873     if( iInstalledPackages.Find( aUid ) != KErrNotFound )
   869         {
   874         {
   870         AddEntryToDownloadedCollectionL( appEntry->GetId() );
   875         AddEntryToDownloadedCollectionL( appEntry->GetId() );
   871         }
   876         }
   872     RemoveFromInstalledPackages( aUid );
   877     RemoveFromInstalledPackages( aUid );
   918             if( appTypeUid == KMidletApplicationTypeUid )
   923             if( appTypeUid == KMidletApplicationTypeUid )
   919                 {
   924                 {
   920                 aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueJava );
   925                 aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueJava );
   921                 aEntry->AddAttributeL( KCaAttrAppSettingsPlugin, KCaAttrJavaAppSettingsPluginValue );
   926                 aEntry->AddAttributeL( KCaAttrAppSettingsPlugin, KCaAttrJavaAppSettingsPluginValue );
   922                 }
   927                 }
   923             else if (appTypeUid == KCWRTApplicationTypeUid) 
   928             else if (appTypeUid == KCWRTApplicationTypeUid)
   924                 {
   929                 {
   925                 aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueCWRT );
   930                 aEntry->AddAttributeL( KCaAttrAppType, KCaAttrAppTypeValueCWRT );
   926                 aEntry->AddAttributeL( KCaAttrAppWidgetUri, KCaAttrAppWidgetUriCWRTValue );
   931                 aEntry->AddAttributeL( KCaAttrAppWidgetUri, KCaAttrAppWidgetUriCWRTValue );
   927                 // web id should be taken from SCR when supported
   932                 // web id should be taken from SCR when supported
   928                 RWidgetRegistryClientSession wrtSession;
   933                 RWidgetRegistryClientSession wrtSession;
   946         RPointerArray<CCaInnerEntry>& aCaEntries )
   951         RPointerArray<CCaInnerEntry>& aCaEntries )
   947     {
   952     {
   948     for( TInt i = 0; i < aCaEntries.Count(); i++ )
   953     for( TInt i = 0; i < aCaEntries.Count(); i++ )
   949         {
   954         {
   950         const TInt id = aCaEntries[i]->GetId();
   955         const TInt id = aCaEntries[i]->GetId();
   951         TUint mmcId = 0;
       
   952         RBuf attrVal;
   956         RBuf attrVal;
   953         attrVal.CleanupClosePushL();
   957         attrVal.CleanupClosePushL();
   954         attrVal.CreateL( KCaMaxAttrValueLen );
   958         attrVal.CreateL( KCaMaxAttrValueLen );
   955         if( aCaEntries[i]->FindAttribute( KCaAttrMmcId(), attrVal ) )
   959         if( aCaEntries[i]->FindAttribute( KCaAttrMmcId(), attrVal ) )
   956             {
   960             {
       
   961             TUint mmcId = 0;
   957             MenuUtils::GetTUint( attrVal, mmcId );
   962             MenuUtils::GetTUint( attrVal, mmcId );
   958             if( mmcId && KErrNotFound != iMmcHistory->Find( mmcId )
   963             if( ( mmcId && KErrNotFound != iMmcHistory->Find( mmcId )
   959                     && mmcId != CurrentMmcId() )
   964                     && mmcId != CurrentMmcId() ) ||
       
   965                     ( attrVal == KCaMassStorage() &&
       
   966                     IsDriveInUse( DriveInfo::EDefaultMassStorage ) ) )
   960                 {
   967                 {
   961                 // This item is on an MMC which is currently in the MMC history.
   968                 // This item is on an MMC which is currently
       
   969                 // in the MMC history or on a mass storage in use.
   962                 // Set it "missing" but keep it.
   970                 // Set it "missing" but keep it.
   963                 AddObjectFlagL( aCaEntries[i], EMissing );
   971                 SetMissingFlagL( aCaEntries[i] );
   964                 }
       
   965             else if ( attrVal == KCaMassStorage()
       
   966                     && IsDriveInUse( DriveInfo::EDefaultMassStorage ) )
       
   967                 {
       
   968                 AddObjectFlagL( aCaEntries[i], EMissing );
       
   969                 }
   972                 }
   970             else
   973             else
   971                 {
   974                 {
   972                 //RemoveAppL( aCaEntries[i] );
   975                 aCaEntries[i]->RemoveAttributeL(KCaAttrMmcId());
   973                 AddObjectFlagL( aCaEntries[i], EMissing );
   976                 ClearVisibleFlagL( aCaEntries[i] );
   974                 }
   977                 }
   975             }
   978             }
   976         else
   979         else
   977             {
   980             {
   978             AddObjectFlagL( aCaEntries[i], EMissing );
   981             ClearVisibleFlagL( aCaEntries[i] );
   979             }
   982             }
   980         CleanupStack::PopAndDestroy( &attrVal );
   983         CleanupStack::PopAndDestroy( &attrVal );
   981         }
   984         }
   982     }
   985     }
   983 
   986 
   993     iCaStorageProxy.RemoveL( idsToRemove );
   996     iCaStorageProxy.RemoveL( idsToRemove );
   994     CleanupStack::PopAndDestroy( &idsToRemove );
   997     CleanupStack::PopAndDestroy( &idsToRemove );
   995     }
   998     }
   996 
   999 
   997 // ---------------------------------------------------------
  1000 // ---------------------------------------------------------
   998 // CCaSrvAppScanner::AddObjectFlagL
  1001 //
   999 // ---------------------------------------------------------
  1002 // ---------------------------------------------------------
  1000 //
  1003 //
  1001 void CCaSrvAppScanner::AddObjectFlagL(
  1004 void CCaSrvAppScanner::SetMissingFlagL( CCaInnerEntry* aEntry )
  1002         CCaInnerEntry* aEntry, const TInt& aFlags )
  1005     {
  1003     {
  1006     if( !( aEntry->GetFlags() & EMissing ) )
  1004     TBool itemFlagPresent = ( 0 != ( aEntry->GetFlags() & aFlags ) );
  1007         {
  1005     if( !itemFlagPresent )
  1008         aEntry->SetFlags( aEntry->GetFlags() | EMissing );
  1006         {
  1009         iCaStorageProxy.AddL( aEntry, EFalse, EItemDisappeared );
  1007         aEntry->SetFlags( aEntry->GetFlags() | aFlags );
  1010         }
  1008         iCaStorageProxy.AddL( aEntry );
  1011     }
       
  1012 
       
  1013 // ---------------------------------------------------------
       
  1014 //
       
  1015 // ---------------------------------------------------------
       
  1016 //
       
  1017 void CCaSrvAppScanner::ClearVisibleFlagL( CCaInnerEntry* aEntry )
       
  1018     {
       
  1019     if( aEntry->GetFlags() & EVisible )
       
  1020         {
       
  1021         aEntry->SetFlags( aEntry->GetFlags() & ~EVisible & ~EMissing & ~EUsed );
       
  1022         iCaStorageProxy.AddL( aEntry, EFalse, EItemDisappeared );
  1009         }
  1023         }
  1010     }
  1024     }
  1011 
  1025 
  1012 // ---------------------------------------------------------
  1026 // ---------------------------------------------------------
  1013 // CCaSrvAppScanner::UpdateMmcHistoryL
  1027 // CCaSrvAppScanner::UpdateMmcHistoryL
  1179     visibleEntriesQuery->SetFlagsOff( EMissing );
  1193     visibleEntriesQuery->SetFlagsOff( EMissing );
  1180     iCaStorageProxy.GetEntriesL( visibleEntriesQuery, resultEntriesArray );
  1194     iCaStorageProxy.GetEntriesL( visibleEntriesQuery, resultEntriesArray );
  1181     if( resultEntriesArray.Count() )
  1195     if( resultEntriesArray.Count() )
  1182         {
  1196         {
  1183         // set collection visible if hidden
  1197         // set collection visible if hidden
  1184         if( HandleHiddenFlagUpdateL( aEntry ) )
  1198         if( HandleVisibleFlagUpdate( aEntry ) )
  1185             {
  1199             {
  1186             // update here this collection
  1200             // update here this collection
  1187             iCaStorageProxy.AddL( aEntry, ETrue );
  1201             iCaStorageProxy.AddL( aEntry );
  1188             }
  1202             }
  1189         }
  1203         }
  1190     CleanupStack::PopAndDestroy( visibleEntriesQuery );
  1204     CleanupStack::PopAndDestroy( visibleEntriesQuery );
  1191     CleanupStack::PopAndDestroy( &resultEntriesArray );
  1205     CleanupStack::PopAndDestroy( &resultEntriesArray );
  1192     }
  1206     }
  1193 
  1207 
       
  1208 
  1194 // ==================== MEMBER FUNCTIONS ====================
  1209 // ==================== MEMBER FUNCTIONS ====================
  1195 
  1210 
  1196 // ---------------------------------------------------------
  1211 // ---------------------------------------------------------
  1197 // TAppAtributes::TAppAtributes
  1212 // TAppAtributes::TAppAtributes
  1198 // ---------------------------------------------------------
  1213 // ---------------------------------------------------------