iaupdate/IAD/ui/src/iaupdatehistorycontainer.cpp
changeset 2 661f3784fe57
parent 0 ba25891c3a9e
child 17 741e5bba2bd1
equal deleted inserted replaced
1:c42dffbd5b4f 2:661f3784fe57
   232             // or if the node has not been installed, 
   232             // or if the node has not been installed, 
   233             // then use the second icon that is for
   233             // then use the second icon that is for
   234             // error situations.
   234             // error situations.
   235             iconIndex = 1;
   235             iconIndex = 1;
   236             }
   236             }
   237         
       
   238         HBufC* nodeStateDescription = NodeStateDescriptionLC( *item );
   237         HBufC* nodeStateDescription = NodeStateDescriptionLC( *item );
   239         TPtr ptr = nodeStateDescription->Des();
   238         TPtr ptr = nodeStateDescription->Des();
   240         AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); 
   239         AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); 
   241         
   240  
   242 
   241         HBufC* name = item->Name().AllocLC();
   243         HBufC* nameAndVersion = NULL;
       
   244         
       
   245         _LIT( KZeroVersion, "0.00(0)");
       
   246         
       
   247         //If version number is all zeros, then only show name of the package
       
   248         //This checking is meant for service pack which doesn't have any version number
       
   249 
       
   250         if ( item->Version().Compare( KZeroVersion ) == 0 )
       
   251             {
       
   252             nameAndVersion = item->Name().AllocLC();
       
   253             }
       
   254         else
       
   255             {
       
   256             CDesCArray* stringArray = new ( ELeave ) CDesCArrayFlat( 1 );  
       
   257             CleanupStack::PushL( stringArray );  
       
   258             stringArray->AppendL( item->Name() );  
       
   259             CArrayFix<TInt>* numberArray = new ( ELeave ) CArrayFixFlat<TInt>( 2 );
       
   260             CleanupStack::PushL( numberArray );
       
   261             TInt8 majorVersion( 0 );
       
   262             TInt8 minorVersion( 0 );
       
   263             TInt16 buildVersion( 0 );
       
   264             IAUpdateUtils::DesToVersionL( item->Version(), 
       
   265                                       majorVersion, minorVersion, buildVersion );
       
   266                                              
       
   267             numberArray->AppendL( majorVersion ); 
       
   268             numberArray->AppendL( minorVersion );  
       
   269                 
       
   270             nameAndVersion = StringLoader::LoadL( R_IAUPDATE_NAME_WITH_VERSION, 
       
   271                                                       *stringArray, 
       
   272                                                       *numberArray );
       
   273             CleanupStack::PopAndDestroy( numberArray );
       
   274             CleanupStack::PopAndDestroy( stringArray );
       
   275 
       
   276             CleanupStack::PushL( nameAndVersion );
       
   277             }
       
   278 
       
   279         
       
   280         TPtr nameAndVersionPtr = nameAndVersion->Des();
       
   281         AknTextUtils::DisplayTextLanguageSpecificNumberConversion( nameAndVersionPtr );  
       
   282         
       
   283         TBuf<iconIndexLength> iconIndexBuf;
   242         TBuf<iconIndexLength> iconIndexBuf;
   284         iconIndexBuf.Format( KIconIndexFormat, iconIndex );
   243         iconIndexBuf.Format( KIconIndexFormat, iconIndex );
   285 
   244 
   286         HBufC* buffer = HBufC::NewLC( iconIndexBuf.Length() +
   245         HBufC* buffer = HBufC::NewLC( iconIndexBuf.Length() +
   287                                       KTabulator.iTypeLength + 
   246                                       KTabulator.iTypeLength + 
   288                                       nameAndVersion->Length() + 
   247                                       name->Length() + 
   289                                       KTabulator.iTypeLength +
   248                                       KTabulator.iTypeLength +
   290                                       nodeStateDescription->Length() );  
   249                                       nodeStateDescription->Length() );  
   291 
   250 
   292         buffer->Des() = iconIndexBuf;
   251         buffer->Des() = iconIndexBuf;
   293         buffer->Des() += KTabulator();
   252         buffer->Des() += KTabulator();
   294         buffer->Des() += *nameAndVersion;
   253         buffer->Des() += *name;
   295         buffer->Des() += KTabulator();
   254         buffer->Des() += KTabulator();
   296         buffer->Des() += *nodeStateDescription;        
   255         buffer->Des() += *nodeStateDescription;        
   297          
   256          
   298         iItemTextArray->AppendL( *buffer );
   257         iItemTextArray->AppendL( *buffer );
   299                  
   258                  
   300         CleanupStack::PopAndDestroy( buffer );
   259         CleanupStack::PopAndDestroy( buffer );
   301         CleanupStack::PopAndDestroy( nameAndVersion );
   260         CleanupStack::PopAndDestroy( name );
   302         CleanupStack::PopAndDestroy( nodeStateDescription );
   261         CleanupStack::PopAndDestroy( nodeStateDescription );
   303         }    
   262         }    
   304     
   263     
   305     if ( items.Count() > 0 )
   264     if ( items.Count() > 0 )
   306         {
   265         {