951 { |
951 { |
952 DEBUG_PRINTF2(_L("Install Server - ParseRegistrationResourceFileL - Parsing '%S' registration resource file"), &aTargetFileName); |
952 DEBUG_PRINTF2(_L("Install Server - ParseRegistrationResourceFileL - Parsing '%S' registration resource file"), &aTargetFileName); |
953 if ( NULL == iAppRegExtractor ) |
953 if ( NULL == iAppRegExtractor ) |
954 { |
954 { |
955 DEBUG_PRINTF(_L("Install Server - ParseRegistrationResourceFileL - Creating CAppRegExtractor for async parsing of registration resource file")); |
955 DEBUG_PRINTF(_L("Install Server - ParseRegistrationResourceFileL - Creating CAppRegExtractor for async parsing of registration resource file")); |
956 CApplication& app = const_cast<CApplication&>(ApplicationL()); |
956 CApplication& app = const_cast<CApplication&>(ApplicationL()); |
957 RArray<TInt> matchingLanguages = app.GetDeviceSupportedLanguages(); |
957 iAppRegExtractor = CAppRegExtractor::NewL(Fs(), iApparcRegFileData); |
958 RArray<TLanguage> devLanguages; |
|
959 CleanupClosePushL(devLanguages); |
|
960 TInt count = matchingLanguages.Count(); |
|
961 |
|
962 DEBUG_PRINTF2(_L("Install Server - ParseRegistrationResourceFileL - %d matching languages found"),count); |
|
963 for ( TInt i=0; i<count; i++) |
|
964 { |
|
965 devLanguages.Append((TLanguage)matchingLanguages[i]); |
|
966 } |
|
967 iAppRegExtractor = CAppRegExtractor::NewL(Fs(),devLanguages,iApparcRegFileData); |
|
968 CleanupStack::Pop(&devLanguages); |
|
969 } |
958 } |
970 |
|
971 iAppRegExtractor->ExtractAppRegInfoSizeL(aTargetFileName, iStatus); |
959 iAppRegExtractor->ExtractAppRegInfoSizeL(aTargetFileName, iStatus); |
972 return EFalse; |
960 return EFalse; |
973 } |
961 } |
974 #endif |
962 #endif |
975 |
963 |
1291 //if alredy exists then update else add it to the list |
1279 //if alredy exists then update else add it to the list |
1292 for(TInt index = 0; index < count ; ++index) |
1280 for(TInt index = 0; index < count ; ++index) |
1293 { |
1281 { |
1294 if(appUid == currentNotifiableApps[index].iAppUid) |
1282 if(appUid == currentNotifiableApps[index].iAppUid) |
1295 { |
1283 { |
1296 currentNotifiableApps.Remove(index); |
1284 currentNotifiableApps.Remove(index); |
|
1285 break; |
1297 } |
1286 } |
1298 } |
1287 } |
1299 currentNotifiableApps.AppendL(affectedApps[k]); |
1288 currentNotifiableApps.AppendL(affectedApps[k]); |
1300 } |
1289 } |
1301 |
1290 |
1643 |
1632 |
1644 RFs fs; |
1633 RFs fs; |
1645 CleanupClosePushL(fs); |
1634 CleanupClosePushL(fs); |
1646 User::LeaveIfError(fs.Connect()); |
1635 User::LeaveIfError(fs.Connect()); |
1647 User::LeaveIfError(fs.ShareProtected()); |
1636 User::LeaveIfError(fs.ShareProtected()); |
1648 RArray<TLanguage> appLanguages; |
|
1649 CleanupClosePushL(appLanguages); |
|
1650 |
1637 |
1651 const TInt appCount = iApparcRegFiles.Count(); |
1638 const TInt appCount = iApparcRegFiles.Count(); |
1652 for (TInt i=0; i<appCount; ++i) |
1639 for (TInt i=0; i<appCount; ++i) |
1653 { |
1640 { |
1654 TInt bufLen = iApparcRegFiles[i]->Size(); |
1641 TInt bufLen = iApparcRegFiles[i]->Size(); |
1658 |
1645 |
1659 RFile file; |
1646 RFile file; |
1660 User::LeaveIfError(file.Open(fs, appFile, EFileRead)); |
1647 User::LeaveIfError(file.Open(fs, appFile, EFileRead)); |
1661 CleanupClosePushL(file); |
1648 CleanupClosePushL(file); |
1662 Usif::CApplicationRegistrationData* appRegData = NULL; |
1649 Usif::CApplicationRegistrationData* appRegData = NULL; |
1663 TRAPD(err, appRegData = launcher.SyncParseResourceFileL(file, appLanguages)); |
1650 TRAPD(err, appRegData = launcher.SyncParseResourceFileL(file)); |
1664 if (KErrNone == err) |
1651 if (KErrNone == err) |
1665 { |
1652 { |
1666 CleanupStack::PushL(appRegData); |
1653 CleanupStack::PushL(appRegData); |
1667 appRegInfoArray.AppendL(appRegData); |
1654 appRegInfoArray.AppendL(appRegData); |
1668 CleanupStack::Pop(appRegData); |
1655 CleanupStack::Pop(appRegData); |
1671 } |
1658 } |
1672 |
1659 |
1673 launcher.NotifyNewAppsL(appRegInfoArray); |
1660 launcher.NotifyNewAppsL(appRegInfoArray); |
1674 fs.Close(); |
1661 fs.Close(); |
1675 appRegInfoArray.ResetAndDestroy(); |
1662 appRegInfoArray.ResetAndDestroy(); |
1676 CleanupStack::PopAndDestroy(3, &appRegInfoArray); |
1663 CleanupStack::PopAndDestroy(2, &appRegInfoArray); //fs |
1677 #else |
1664 #else |
1678 launcher.NotifyNewAppsL(iApparcRegFiles); |
1665 launcher.NotifyNewAppsL(iApparcRegFiles); |
1679 #endif |
1666 #endif |
1680 // clean up our list so we don't notify of the files twice |
1667 // clean up our list so we don't notify of the files twice |
1681 iApparcRegFiles.ResetAndDestroy(); |
1668 iApparcRegFiles.ResetAndDestroy(); |