installationservices/swcomponentregistry/source/server/scrrequestimpl.cpp
changeset 64 48c14c385b0e
parent 42 d17dc5398051
child 75 2d2d25361590
equal deleted inserted replaced
58:67f2119dc623 64:48c14c385b0e
  4539     CStatement *stmt = iDbHandle->PrepareStatementLC(KSelectAppRegInfo);
  4539     CStatement *stmt = iDbHandle->PrepareStatementLC(KSelectAppRegInfo);
  4540     stmt->BindIntL(1, aAppUid.iUid);
  4540     stmt->BindIntL(1, aAppUid.iUid);
  4541     if(stmt->ProcessNextRowL())
  4541     if(stmt->ProcessNextRowL())
  4542       {
  4542       {
  4543       aApplicationRegistration.iAppUid = TUid::Uid(stmt->IntColumnL(0)); 
  4543       aApplicationRegistration.iAppUid = TUid::Uid(stmt->IntColumnL(0)); 
  4544       HBufC* appFile = stmt->StrColumnL(2).AllocLC();
  4544       HBufC* appFile = stmt->StrColumnL(2).AllocL();
  4545       DeleteObjectZ(aApplicationRegistration.iAppFile);
  4545       DeleteObjectZ(aApplicationRegistration.iAppFile);
  4546       aApplicationRegistration.iAppFile = appFile;
  4546       aApplicationRegistration.iAppFile = appFile;
  4547       aApplicationRegistration.iTypeId = stmt->IntColumnL(3);
  4547       aApplicationRegistration.iTypeId = stmt->IntColumnL(3);
  4548       aApplicationRegistration.iCharacteristics.iAttributes = stmt->IntColumnL(4);
  4548       aApplicationRegistration.iCharacteristics.iAttributes = stmt->IntColumnL(4);
  4549       aApplicationRegistration.iCharacteristics.iAppIsHidden = stmt->IntColumnL(5);
  4549       aApplicationRegistration.iCharacteristics.iAppIsHidden = stmt->IntColumnL(5);
  4560       DEBUG_PRINTF2(_L("The Embeddability for this App is %d "), aApplicationRegistration.iCharacteristics.iEmbeddability);
  4560       DEBUG_PRINTF2(_L("The Embeddability for this App is %d "), aApplicationRegistration.iCharacteristics.iEmbeddability);
  4561       DEBUG_PRINTF2(_L("The New File for this App is %d "), aApplicationRegistration.iCharacteristics.iSupportsNewFile);
  4561       DEBUG_PRINTF2(_L("The New File for this App is %d "), aApplicationRegistration.iCharacteristics.iSupportsNewFile);
  4562       DEBUG_PRINTF2(_L("The Launch for this App is %d "), aApplicationRegistration.iCharacteristics.iLaunchInBackground);
  4562       DEBUG_PRINTF2(_L("The Launch for this App is %d "), aApplicationRegistration.iCharacteristics.iLaunchInBackground);
  4563       DEBUG_PRINTF2(_L("The Group Name for this App is %S "),  &(aApplicationRegistration.iCharacteristics.iGroupName));
  4563       DEBUG_PRINTF2(_L("The Group Name for this App is %S "),  &(aApplicationRegistration.iCharacteristics.iGroupName));
  4564       DEBUG_PRINTF2(_L("The Default screen number for this App is %d "), aApplicationRegistration.iDefaultScreenNumber);
  4564       DEBUG_PRINTF2(_L("The Default screen number for this App is %d "), aApplicationRegistration.iDefaultScreenNumber);
  4565                       
  4565                        
  4566       CleanupStack::Pop(1);
       
  4567       }
  4566       }
  4568     else
  4567     else
  4569       {
  4568       {
  4570       DEBUG_PRINTF2(_L8("AppUid %d Not Found in the SCR"),aAppUid);       
  4569       DEBUG_PRINTF2(_L8("AppUid %d Not Found in the SCR"),aAppUid);       
  4571       CleanupStack::PopAndDestroy(stmt);
  4570       CleanupStack::PopAndDestroy(stmt);
  4675            }
  4674            }
  4676         CleanupStack::PopAndDestroy(stmt);
  4675         CleanupStack::PopAndDestroy(stmt);
  4677         }
  4676         }
  4678         else
  4677         else
  4679         {
  4678         {
  4680         DEBUG_PRINTF(_L8("No Nearest locale found for AppUid %d in the SCR"));
  4679         DEBUG_PRINTF2(_L("No Nearest locale found for AppUid 0x%x in the SCR"), aAppUid);
  4681         }    
  4680         }    
  4682     }
  4681     }
  4683 
  4682 
  4684 void CScrRequestImpl::GetAppRegOpaqueDataL(CApplicationRegistrationData& aApplicationRegistration, TUid aAppUid, TLanguage aLanguage) const
  4683 void CScrRequestImpl::GetAppRegOpaqueDataL(CApplicationRegistrationData& aApplicationRegistration, TUid aAppUid, TLanguage aLanguage) const
  4685     {
  4684     {
  4694         DeleteObjectZ(aApplicationRegistration);
  4693         DeleteObjectZ(aApplicationRegistration);
  4695         aApplicationRegistration = CApplicationRegistrationData::NewL();
  4694         aApplicationRegistration = CApplicationRegistrationData::NewL();
  4696         if((aSubsessionContext->iAppRegIndex < aSubsessionContext->iAppUids.Count()))
  4695         if((aSubsessionContext->iAppRegIndex < aSubsessionContext->iAppUids.Count()))
  4697             {
  4696             {
  4698             TUid appUid = aSubsessionContext->iAppUids[aSubsessionContext->iAppRegIndex];
  4697             TUid appUid = aSubsessionContext->iAppUids[aSubsessionContext->iAppRegIndex];
  4699                 
  4698               
  4700             //Populate the Application Registration Info
  4699             //Populate the Application Registration Info
  4701             if(GetApplicationRegistrationInfoL(*aApplicationRegistration,appUid))
  4700             TBool retVal = EFalse;
       
  4701             TRAPD(err, retVal = GetApplicationRegistrationInfoL(*aApplicationRegistration, appUid));
       
  4702 
       
  4703             //Check if we have a valid application
       
  4704             if((KErrNone == err) && retVal)
  4702                 {
  4705                 {
  4703                 //Populate File ownership info           
  4706                 TRAP(err,
  4704                 GetFileOwnershipInfoL(*aApplicationRegistration,appUid);
  4707                 //Populate File ownership info 
  4705                    
  4708                 GetFileOwnershipInfoL(*aApplicationRegistration, appUid);
  4706                 //Populate service info
  4709                 //Populate service info
  4707                 GetServiceInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4710                 GetServiceInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4708                 
       
  4709                 //Populate localizable appinfo including caption and icon info 
  4711                 //Populate localizable appinfo including caption and icon info 
  4710                 //and view data and its caption and icon info.            
  4712                 //and view data and its caption and icon info. 
  4711                 GetLocalizableAppInfoL(*aApplicationRegistration,appUid, aSubsessionContext->iLanguage);
  4713                 GetLocalizableAppInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4712                 
  4714 
  4713                 GetAppRegOpaqueDataL(*aApplicationRegistration,appUid, aSubsessionContext->iLanguage);
  4715                 GetAppRegOpaqueDataL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage);
  4714     
  4716     
  4715                 GetAppPropertiesInfoL(*aApplicationRegistration,appUid, aSubsessionContext->iLanguage); 
  4717                 GetAppPropertiesInfoL(*aApplicationRegistration, appUid, aSubsessionContext->iLanguage); );
       
  4718     
  4716                 dataFound = ETrue;
  4719                 dataFound = ETrue;
  4717                 }
  4720                 }
  4718             else
  4721             else
  4719                 {
  4722                 {
  4720                 DeleteObjectZ(aApplicationRegistration);
  4723                 DeleteObjectZ(aApplicationRegistration);
  4721                 }
  4724                 }
  4722                         
  4725 
       
  4726             if(KErrNone != err)
       
  4727                 DEBUG_PRINTF2(_L8("Error while reading the app registration info 0x%x. Ignoring current application details."), appUid);
       
  4728                            
  4723             //Incrementing the index
  4729             //Incrementing the index
  4724             aSubsessionContext->iAppRegIndex++;
  4730             aSubsessionContext->iAppRegIndex++;
  4725                         
  4731                         
  4726             if(dataFound)
  4732             if(dataFound)
  4727                 {
  4733                 {