contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp
changeset 66 32469d7d46ff
parent 61 8e5041d13c84
child 73 4bc7b118b3df
equal deleted inserted replaced
61:8e5041d13c84 66:32469d7d46ff
   237     SetDescriptionL( aElement, widget );
   237     SetDescriptionL( aElement, widget );
   238     SetVisibilityL( aElement, widget );
   238     SetVisibilityL( aElement, widget );
   239     SetIconUriL( aElement, aPackageUid, widget);
   239     SetIconUriL( aElement, aPackageUid, widget);
   240     widget->SetPackageUidL( aPackageUid );
   240     widget->SetPackageUidL( aPackageUid );
   241     SetMmcIdL( widget );
   241     SetMmcIdL( widget );
   242     
   242 
   243     TTime modificationTime;
   243     TTime modificationTime;
   244     iFs.Modified( aFilePath, modificationTime);
   244     iFs.Modified( aFilePath, modificationTime);
   245     TInt64 modificationIntTime = modificationTime.Int64();
   245     TInt64 modificationIntTime = modificationTime.Int64();
   246     RBuf16 rBuf;
   246     RBuf16 rBuf;
   247     rBuf.CleanupClosePushL();
   247     rBuf.CleanupClosePushL();
   266 // ----------------------------------------------------------------------------
   266 // ----------------------------------------------------------------------------
   267 //
   267 //
   268 void CCaWidgetScannerParser::SetUriL(
   268 void CCaWidgetScannerParser::SetUriL(
   269     TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
   269     TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
   270 {
   270 {
   271     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
   271     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
   272         aElement.AttributeValueL( KUri ) );
   272         aElement.AttributeValueL( KUri ) );
   273     CleanupStack::PushL( attributeValue );
   273     CleanupStack::PushL( attributeValue );
   274 
   274 
   275     if( attributeValue->Compare( KNullDesC ) != 0 )
   275     if( attributeValue->Compare( KNullDesC ) != 0 )
   276         {
   276         {
   284 // ----------------------------------------------------------------------------
   284 // ----------------------------------------------------------------------------
   285 //
   285 //
   286 void CCaWidgetScannerParser::SetLibraryL( TXmlEngElement & aElement,
   286 void CCaWidgetScannerParser::SetLibraryL( TXmlEngElement & aElement,
   287     const TDesC & aPackageUid, CCaWidgetDescription * aWidget )
   287     const TDesC & aPackageUid, CCaWidgetDescription * aWidget )
   288 {
   288 {
   289     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
   289     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
   290         aElement.AttributeValueL( KLibrary ) );
   290         aElement.AttributeValueL( KLibrary ) );
   291     CleanupStack::PushL( attributeValue );
   291     CleanupStack::PushL( attributeValue );
   292 
   292 
   293     if( attributeValue->Compare( KNullDesC ) != 0 )
   293     if( attributeValue->Compare( KNullDesC ) != 0 )
   294         {
   294         {
   295         HBufC *libraryPath = GetManifestDirectoryPathLC( aPackageUid );
   295         HBufC *libraryPath = GetManifestDirectoryPathLC( aPackageUid );
   296 
   296 
   297         //set path for hs to use, trim last 2 chars (doubleslash)
   297         //set path for hs to use, trim last 2 chars (doubleslash)
   298         aWidget->SetPathL(libraryPath->Mid(0,libraryPath->Length()-1));
   298         aWidget->SetPathL(libraryPath->Mid(0,libraryPath->Length()-1));
   299         
   299 
   300         libraryPath->ReAllocL(
   300         libraryPath->ReAllocL(
   301             libraryPath->Length() + attributeValue->Length());
   301             libraryPath->Length() + attributeValue->Length());
   302 
   302 
   303         TPtr libraryPathModifier( libraryPath->Des() );
   303         TPtr libraryPathModifier( libraryPath->Des() );
   304         libraryPathModifier.Append( *attributeValue );
   304         libraryPathModifier.Append( *attributeValue );
   318 // ----------------------------------------------------------------------------
   318 // ----------------------------------------------------------------------------
   319 //
   319 //
   320 void CCaWidgetScannerParser::SetTitleL(
   320 void CCaWidgetScannerParser::SetTitleL(
   321     TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
   321     TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
   322 {
   322 {
   323     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
   323     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
   324                 aElement.AttributeValueL( KTitle ) );
   324                 aElement.AttributeValueL( KTitle ) );
   325     CleanupStack::PushL( attributeValue );
   325     CleanupStack::PushL( attributeValue );
   326 
   326 
   327     if( attributeValue->Compare( KNullDesC ) != 0 )
   327     if( attributeValue->Compare( KNullDesC ) != 0 )
   328         {
   328         {
   336 // ----------------------------------------------------------------------------
   336 // ----------------------------------------------------------------------------
   337 //
   337 //
   338 void CCaWidgetScannerParser::SetDescriptionL(
   338 void CCaWidgetScannerParser::SetDescriptionL(
   339     TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
   339     TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
   340 {
   340 {
   341     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
   341     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
   342                 aElement.AttributeValueL( KDescription ) );
   342                 aElement.AttributeValueL( KDescription ) );
   343     CleanupStack::PushL( attributeValue );
   343     CleanupStack::PushL( attributeValue );
   344 
   344 
   345     if( attributeValue->Compare( KNullDesC ) != 0 )
   345     if( attributeValue->Compare( KNullDesC ) != 0 )
   346         {
   346         {
   354 // ----------------------------------------------------------------------------
   354 // ----------------------------------------------------------------------------
   355 //
   355 //
   356 void CCaWidgetScannerParser::SetVisibilityL(
   356 void CCaWidgetScannerParser::SetVisibilityL(
   357     TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
   357     TXmlEngElement & aElement, CCaWidgetDescription * aWidget )
   358 {
   358 {
   359     HBufC *hidden = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
   359     HBufC *hidden = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
   360                 aElement.AttributeValueL( KHidden ) );
   360                 aElement.AttributeValueL( KHidden ) );
   361     CleanupStack::PushL( hidden );
   361     CleanupStack::PushL( hidden );
   362 
   362 
   363     if( hidden->Compare( KTrue ) == 0 )
   363     if( hidden->Compare( KTrue ) == 0 )
   364         {
   364         {
   372 // ----------------------------------------------------------------------------
   372 // ----------------------------------------------------------------------------
   373 //
   373 //
   374 void CCaWidgetScannerParser::SetIconUriL( TXmlEngElement & aElement,
   374 void CCaWidgetScannerParser::SetIconUriL( TXmlEngElement & aElement,
   375     const TDesC & aPackageUid, CCaWidgetDescription * aWidget )
   375     const TDesC & aPackageUid, CCaWidgetDescription * aWidget )
   376 {
   376 {
   377     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf7L(
   377     HBufC *attributeValue = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
   378                 aElement.AttributeValueL( KIconUri ) );
   378                 aElement.AttributeValueL( KIconUri ) );
   379     CleanupStack::PushL( attributeValue );
   379     CleanupStack::PushL( attributeValue );
   380 
   380 
   381     if( attributeValue->Compare( KNullDesC ) != 0 )
   381     if( attributeValue->Compare( KNullDesC ) != 0 )
   382         {
   382         {