imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailcenrep.cpp
changeset 33 221be23823c5
parent 30 b67379558a75
equal deleted inserted replaced
31:d429f823a6b7 33:221be23823c5
   111 //
   111 //
   112 CThumbnailCenRep::~CThumbnailCenRep()
   112 CThumbnailCenRep::~CThumbnailCenRep()
   113     {
   113     {
   114     iPersistentSizes.Close();
   114     iPersistentSizes.Close();
   115     delete iAutoCreate;
   115     delete iAutoCreate;
       
   116     iAutoCreate = NULL;
   116     delete iRepository;
   117     delete iRepository;
       
   118     iRepository = NULL;
   117     }
   119     }
   118 
   120 
   119 // ---------------------------------------------------------------------------
   121 // ---------------------------------------------------------------------------
   120 // CThumbnailCenRep::NewL()
   122 // CThumbnailCenRep::NewL()
   121 // Two-phased constructor.
   123 // Two-phased constructor.
   208     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, autoCreate ));
   210     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, autoCreate ));
   209     
   211     
   210     iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioFullScreenThumbnailSize, TSize( xSize, ySize ),
   212     iPersistentSizes.AppendL( TThumbnailPersistentSize( EAudioFullScreenThumbnailSize, TSize( xSize, ySize ),
   211                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
   213                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
   212 
   214 
   213     User::LeaveIfError( iRepository->Get( KSizeContactGridWidth, xSize ));
   215 // Contact TN, set default values if not found
   214     User::LeaveIfError( iRepository->Get( KSizeContactGridHeight, ySize ));
   216     if(iRepository->Get( KSizeContactGridWidth, xSize ) != KErrNone)
   215     User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, autoCreate ));
   217         {
       
   218         xSize = 54;
       
   219         }
       
   220     if( iRepository->Get( KSizeContactGridHeight, ySize ) != KErrNone)
       
   221         {
       
   222         ySize = 54;
       
   223         }
       
   224     
       
   225     if( iRepository->Get( KAutoCreateContactGrid, autoCreate ) != KErrNone)
       
   226     {
       
   227         autoCreate = 1;
       
   228     }
   216 
   229 
   217     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactGridThumbnailSize, TSize( xSize, ySize ),
   230     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactGridThumbnailSize, TSize( xSize, ySize ),
   218             KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EGrid ));
   231             KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EGrid ));
   219     
   232     
   220     User::LeaveIfError( iRepository->Get( KSizeContactListWidth, xSize ));
   233     if(  iRepository->Get( KSizeContactListWidth, xSize ) != KErrNone)
   221     User::LeaveIfError( iRepository->Get( KSizeContactListHeight, ySize ));
   234         {
   222     User::LeaveIfError( iRepository->Get( KAutoCreateContactList, autoCreate ));
   235         xSize = 64;
       
   236         }
       
   237     if(  iRepository->Get( KSizeContactListHeight, ySize ) != KErrNone)
       
   238         {
       
   239         ySize = 64;
       
   240         }
       
   241     if(  iRepository->Get( KAutoCreateContactList, autoCreate ) != KErrNone)
       
   242         {
       
   243         autoCreate = 1;
       
   244         }
   223 
   245 
   224     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactListThumbnailSize, TSize( xSize, ySize ),
   246     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactListThumbnailSize, TSize( xSize, ySize ),
   225             KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EList ));
   247             KGridAndListThumbnailCropped, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EList ));
   226     
   248     
   227     User::LeaveIfError( iRepository->Get( KSizeContactFullscreenWidth, xSize ));
   249     if( iRepository->Get( KSizeContactFullscreenWidth, xSize ) != KErrNone)
   228     User::LeaveIfError( iRepository->Get( KSizeContactFullscreenHeight, ySize ));
   250         {
   229     User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, autoCreate ));
   251         xSize = 250;
       
   252         }
       
   253     if( iRepository->Get( KSizeContactFullscreenHeight, ySize ) != KErrNone)
       
   254         {
       
   255         ySize = 250;
       
   256         }
       
   257     if( iRepository->Get( KAutoCreateContactFullscreen, autoCreate) != KErrNone)
       
   258         {
       
   259         autoCreate = 1;
       
   260         }
   230     
   261     
   231     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactFullScreenThumbnailSize, TSize( xSize, ySize ),
   262     iPersistentSizes.AppendL( TThumbnailPersistentSize( EContactFullScreenThumbnailSize, TSize( xSize, ySize ),
   232                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
   263                               flags, static_cast <TDisplayMode> (raw_mode), format, autoCreate, TThumbnailPersistentSize::EFullscreen ));     
   233     
   264     
   234     
   265     
   241     User::LeaveIfError( iRepository->Get( KAutoCreateVideoList, iAutoCreate->iVideoList ));
   272     User::LeaveIfError( iRepository->Get( KAutoCreateVideoList, iAutoCreate->iVideoList ));
   242     User::LeaveIfError( iRepository->Get( KAutoCreateVideoFullscreen, iAutoCreate->iVideoFullscreen ));
   273     User::LeaveIfError( iRepository->Get( KAutoCreateVideoFullscreen, iAutoCreate->iVideoFullscreen ));
   243     User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, iAutoCreate->iAudioGrid ));
   274     User::LeaveIfError( iRepository->Get( KAutoCreateAudioGrid, iAutoCreate->iAudioGrid ));
   244     User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, iAutoCreate->iAudioList ));
   275     User::LeaveIfError( iRepository->Get( KAutoCreateAudioList, iAutoCreate->iAudioList ));
   245     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, iAutoCreate->iAudioFullscreen ));    
   276     User::LeaveIfError( iRepository->Get( KAutoCreateAudioFullscreen, iAutoCreate->iAudioFullscreen ));    
   246     User::LeaveIfError( iRepository->Get( KAutoCreateContactGrid, iAutoCreate->iContactGrid ));
   277     
   247     User::LeaveIfError( iRepository->Get( KAutoCreateContactList, iAutoCreate->iContactList ));
   278     if( iRepository->Get( KAutoCreateContactGrid, iAutoCreate->iContactGrid ) != KErrNone )
   248     User::LeaveIfError( iRepository->Get( KAutoCreateContactFullscreen, iAutoCreate->iContactFullscreen )); 
   279         {
       
   280         iAutoCreate->iContactGrid = 1;
       
   281         }
       
   282     if( iRepository->Get( KAutoCreateContactList, iAutoCreate->iContactList ) != KErrNone )
       
   283         {
       
   284         iAutoCreate->iContactList = 1;
       
   285         }
       
   286     if( iRepository->Get( KAutoCreateContactFullscreen, iAutoCreate->iContactFullscreen ) != KErrNone )
       
   287         {
       
   288         iAutoCreate->iContactFullscreen = 1;
       
   289         }
   249     }
   290     }
   250 
   291 
   251 // ---------------------------------------------------------------------------
   292 // ---------------------------------------------------------------------------
   252 // CThumbnailCenRep::GetPersistentSizes()
   293 // CThumbnailCenRep::GetPersistentSizes()
   253 // ---------------------------------------------------------------------------
   294 // ---------------------------------------------------------------------------