installationservices/swcomponentregistry/source/server/scrrequestimpl.cpp
changeset 75 2d2d25361590
parent 64 48c14c385b0e
equal deleted inserted replaced
69:b18a4bf55ddb 75:2d2d25361590
  4652         stmt->BindIntL(2, (TInt)storedLanguage);
  4652         stmt->BindIntL(2, (TInt)storedLanguage);
  4653         if(stmt->ProcessNextRowL())
  4653         if(stmt->ProcessNextRowL())
  4654            {
  4654            {
  4655            localizedAppInfo = Usif::CLocalizableAppInfo::NewLC();
  4655            localizedAppInfo = Usif::CLocalizableAppInfo::NewLC();
  4656            DeleteObjectZ(localizedAppInfo->iShortCaption);
  4656            DeleteObjectZ(localizedAppInfo->iShortCaption);
  4657            localizedAppInfo->iShortCaption = stmt->StrColumnL(0).AllocLC();
  4657            localizedAppInfo->iShortCaption = stmt->StrColumnL(0).AllocL();
  4658            DeleteObjectZ(localizedAppInfo->iGroupName);
  4658            DeleteObjectZ(localizedAppInfo->iGroupName);
  4659            localizedAppInfo->iGroupName = stmt->StrColumnL(1).AllocLC();
  4659            localizedAppInfo->iGroupName = stmt->StrColumnL(1).AllocL();
  4660            localizedAppInfo->iApplicationLanguage = (TLanguage)stmt->IntColumnL(2);           
  4660            localizedAppInfo->iApplicationLanguage = (TLanguage)stmt->IntColumnL(2);           
  4661           
  4661           
  4662            DEBUG_PRINTF2(_L("The Short Caption for this App is %S "), localizedAppInfo->iShortCaption);
  4662            DEBUG_PRINTF2(_L("The Short Caption for this App is %S "), localizedAppInfo->iShortCaption);
  4663            DEBUG_PRINTF2(_L("The Group name this App is %S "), localizedAppInfo->iGroupName);
  4663            DEBUG_PRINTF2(_L("The Group name this App is %S "), localizedAppInfo->iGroupName);
  4664            DEBUG_PRINTF2(_L("The application language this App is %d "), localizedAppInfo->iApplicationLanguage);
  4664            DEBUG_PRINTF2(_L("The application language this App is %d "), localizedAppInfo->iApplicationLanguage);
  4668            localizedAppInfo->iCaptionAndIconInfo = GetCaptionAndIconInfoL(captionAndIconID);
  4668            localizedAppInfo->iCaptionAndIconInfo = GetCaptionAndIconInfoL(captionAndIconID);
  4669            //populate view data           
  4669            //populate view data           
  4670            GetViewsL(localizedAppInfo->iViewDataList, aAppUid, storedLanguage);
  4670            GetViewsL(localizedAppInfo->iViewDataList, aAppUid, storedLanguage);
  4671            
  4671            
  4672            aApplicationRegistration.iLocalizableAppInfoList.AppendL(localizedAppInfo);
  4672            aApplicationRegistration.iLocalizableAppInfoList.AppendL(localizedAppInfo);
  4673            CleanupStack::Pop(3,localizedAppInfo);  //poping iGroupName, iShortCaption and localizedAppInfo
  4673            CleanupStack::Pop(localizedAppInfo); 
  4674            }
  4674            }
  4675         CleanupStack::PopAndDestroy(stmt);
  4675         CleanupStack::PopAndDestroy(stmt);
  4676         }
  4676         }
  4677         else
  4677         else
  4678         {
  4678         {
  4687 
  4687 
  4688 void CScrRequestImpl::NextApplicationRegistrationInfoSizeL(const RMessage2& aMessage, CApplicationRegistrationData*& aApplicationRegistration, CAppRegistrySubsessionContext*  aSubsessionContext)
  4688 void CScrRequestImpl::NextApplicationRegistrationInfoSizeL(const RMessage2& aMessage, CApplicationRegistrationData*& aApplicationRegistration, CAppRegistrySubsessionContext*  aSubsessionContext)
  4689     {
  4689     {
  4690     while(1)
  4690     while(1)
  4691         {
  4691         {
  4692         TBool dataFound = EFalse;
       
  4693         DeleteObjectZ(aApplicationRegistration);
  4692         DeleteObjectZ(aApplicationRegistration);
  4694         aApplicationRegistration = CApplicationRegistrationData::NewL();
  4693         aApplicationRegistration = CApplicationRegistrationData::NewL();
  4695         if((aSubsessionContext->iAppRegIndex < aSubsessionContext->iAppUids.Count()))
  4694         if((aSubsessionContext->iAppRegIndex < aSubsessionContext->iAppUids.Count()))
  4696             {
  4695             {
       
  4696             TBool dataFound = EFalse;
  4697             TUid appUid = aSubsessionContext->iAppUids[aSubsessionContext->iAppRegIndex];
  4697             TUid appUid = aSubsessionContext->iAppUids[aSubsessionContext->iAppRegIndex];
  4698               
  4698               
       
  4699 			TInt err = KErrNone; //Initialised to avoid compiler warning 
  4699             //Populate the Application Registration Info
  4700             //Populate the Application Registration Info
  4700             TBool retVal = EFalse;
  4701             TRAP(err, 
  4701             TRAPD(err, retVal = GetApplicationRegistrationInfoL(*aApplicationRegistration, appUid));
  4702                     {
  4702 
  4703                     TBool retVal = EFalse;
  4703             //Check if we have a valid application
  4704                     retVal = GetApplicationRegistrationInfoL(*aApplicationRegistration, appUid);
  4704             if((KErrNone == err) && retVal)
  4705 
  4705                 {
  4706                     //Check if we have a valid application
  4706                 TRAP(err,
  4707                     if(retVal)
  4707                 //Populate File ownership info 
  4708                         {
  4708                 GetFileOwnershipInfoL(*aApplicationRegistration, appUid);
  4709                         //Populate File ownership info 
  4709                 //Populate service info
  4710                         GetFileOwnershipInfoL(*aApplicationRegistration, appUid);
  4710                 GetServiceInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4711                         //Populate service info
  4711                 //Populate localizable appinfo including caption and icon info 
  4712                         GetServiceInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4712                 //and view data and its caption and icon info. 
  4713                         //Populate localizable appinfo including caption and icon info 
  4713                 GetLocalizableAppInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4714                         //and view data and its caption and icon info. 
  4714 
  4715                         GetLocalizableAppInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4715                 GetAppRegOpaqueDataL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4716 
  4716     
  4717                         GetAppRegOpaqueDataL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4717                 GetAppPropertiesInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage); );
  4718     
  4718     
  4719                         GetAppPropertiesInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4719                 dataFound = ETrue;
  4720                         
  4720                 }
  4721                         dataFound = ETrue;
  4721             else
  4722                         }
  4722                 {
  4723                     });
  4723                 DeleteObjectZ(aApplicationRegistration);
  4724             
  4724                 }
       
  4725 
       
  4726             if(KErrNone != err)
       
  4727                 DEBUG_PRINTF2(_L8("Error while reading the app registration info 0x%x. Ignoring current application details."), appUid);
       
  4728                            
       
  4729             //Incrementing the index
  4725             //Incrementing the index
  4730             aSubsessionContext->iAppRegIndex++;
  4726             aSubsessionContext->iAppRegIndex++;
  4731                         
  4727                         
  4732             if(dataFound)
  4728             if(dataFound)
  4733                 {
  4729                 {
  4734                 WriteObjectSizeL(aMessage, 1, aApplicationRegistration);
  4730                 WriteObjectSizeL(aMessage, 1, aApplicationRegistration);
  4735                 break;
  4731                 break;
  4736                 }
  4732                 }
       
  4733             else
       
  4734                 {
       
  4735                 DEBUG_PRINTF3(_L8("Error %d while reading the app registration info 0x%x. Ignoring current application details."), err, appUid);
       
  4736                 }
       
  4737                            
  4737             }
  4738             }
  4738         else
  4739         else
  4739             {
  4740             {
  4740             DEBUG_PRINTF(_L8("Reached the end of the view."));
  4741             DEBUG_PRINTF(_L8("Reached the end of the view."));
  4741             WriteIntValueL(aMessage, 1, 0);                
  4742             WriteIntValueL(aMessage, 1, 0);