javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp
changeset 23 98ccebc37403
parent 21 2a9601315dfc
child 26 dc7c549001d5
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
   626     // Write application Uid to opaque data (needed by MIDlet launcher).
   626     // Write application Uid to opaque data (needed by MIDlet launcher).
   627     TBuf8<4> opaqueDataBuf; // Opaque data will contain one signed 32-bit int.
   627     TBuf8<4> opaqueDataBuf; // Opaque data will contain one signed 32-bit int.
   628     RDesWriteStream writeStream(opaqueDataBuf);
   628     RDesWriteStream writeStream(opaqueDataBuf);
   629     writeStream.WriteInt32L(aAppUid);
   629     writeStream.WriteInt32L(aAppUid);
   630     writeStream.CommitL();
   630     writeStream.CommitL();
   631     COpaqueData *opaqueData =
   631     COpaqueData *opaqueData = COpaqueData::NewLC(opaqueDataBuf, KNonLocalized);
   632         COpaqueData::NewLC(opaqueDataBuf, KUnspecifiedLocale);
       
   633     opaqueDataArray.AppendL(opaqueData);
   632     opaqueDataArray.AppendL(opaqueData);
   634     CleanupStack::Pop(opaqueData);
   633     CleanupStack::Pop(opaqueData);
   635 
   634 
   636     RPointerArray<Usif::CLocalizableAppInfo> localizableAppInfoList;
   635     RPointerArray<Usif::CLocalizableAppInfo> localizableAppInfoList;
   637     CleanupResetAndDestroyPushL(localizableAppInfoList);
   636     CleanupResetAndDestroyPushL(localizableAppInfoList);
   638     // Add non-localized application name (caption) and icon.
   637     // Add non-localized application name (caption) and icon.
   639     CCaptionAndIconInfo *captionAndIconInfo = CCaptionAndIconInfo::NewLC(
   638     CCaptionAndIconInfo *captionAndIconInfo =
   640                 /*aCaption=*/ *caption,
   639         CCaptionAndIconInfo::NewLC(
   641                 /*aIconFileName=*/ *iconFilename,
   640             /*aCaption=*/ *caption,
   642                 /*aNumOfAppIcons=*/ numberOfAppIcons);
   641             /*aIconFileName=*/ (NULL != aIconFilename? *iconFilename: KNullDesC()),
   643     CLocalizableAppInfo *locAppInfo = CLocalizableAppInfo::NewLC(
   642             /*aNumOfAppIcons=*/ numberOfAppIcons);
   644                                           /*aShortCaption=*/ KNullDesC, /*aApplicationLanguage=*/ KNonLocalized,
   643     CLocalizableAppInfo *locAppInfo = 
   645                                           /*aGroupName=*/ KNullDesC, /*aCaptionAndIconInfo=*/ captionAndIconInfo,
   644         CLocalizableAppInfo::NewLC(
   646                                           /*aViewDataList=*/ viewDataList);
   645             /*aShortCaption=*/ KNullDesC, /*aApplicationLanguage=*/ KNonLocalized,
       
   646             /*aGroupName=*/ KNullDesC, /*aCaptionAndIconInfo=*/ captionAndIconInfo,
       
   647             /*aViewDataList=*/ viewDataList);
   647     localizableAppInfoList.AppendL(locAppInfo);
   648     localizableAppInfoList.AppendL(locAppInfo);
   648     CleanupStack::Pop(locAppInfo);
   649     CleanupStack::Pop(locAppInfo);
   649     CleanupStack::Pop(captionAndIconInfo);
   650     CleanupStack::Pop(captionAndIconInfo);
   650 
   651 
   651     // Add localized application names (captions).
   652     // Add localized application names (captions).
   657     {
   658     {
   658         jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL);
   659         jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL);
   659         for (TInt i = 0; i < langCount; i++)
   660         for (TInt i = 0; i < langCount; i++)
   660         {
   661         {
   661             TLanguage tmpLanguage = (TLanguage)languages[i];
   662             TLanguage tmpLanguage = (TLanguage)languages[i];
   662             HBufC *tmpCaption = CreateHBufCFromJavaStringLC(
   663             HBufC *tmpCaption = 
   663                                     aEnv, (jstring)aEnv->GetObjectArrayElement(aAppNames, i));
   664                 CreateHBufCFromJavaStringLC(
       
   665                     aEnv, (jstring)aEnv->GetObjectArrayElement(aAppNames, i));
   664             captionsArray.AppendL(tmpCaption);
   666             captionsArray.AppendL(tmpCaption);
   665             CleanupStack::Pop(tmpCaption);
   667             CleanupStack::Pop(tmpCaption);
   666             //LOG1(EJavaInstaller, EInfo,
   668             //LOG1(EJavaInstaller, EInfo,
   667             //     "RegisterApplicationL: language %d", tmpLanguage);
   669             //     "RegisterApplicationL: language %d", tmpLanguage);
   668             //LOG_TDESC_L(EJavaInstaller, EInfo,
   670             //LOG_TDESC_L(EJavaInstaller, EInfo,