imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp
branchRCL_3
changeset 8 7403edfcf0fb
parent 7 2eb74cf6572e
child 9 dea39715fc05
equal deleted inserted replaced
7:2eb74cf6572e 8:7403edfcf0fb
    34 #include "thumbnaildiskunmountobserver.h"
    34 #include "thumbnaildiskunmountobserver.h"
    35 #include "thumbnailpanic.h"
    35 #include "thumbnailpanic.h"
    36 #include "thumbnailcenrep.h"
    36 #include "thumbnailcenrep.h"
    37 #include "thumbnailmemorycardobserver.h"
    37 #include "thumbnailmemorycardobserver.h"
    38 #include "tmgetimei.h"
    38 #include "tmgetimei.h"
       
    39 //#include "thumbnailfetchedchecker.h"
    39 
    40 
    40 
    41 
    41 _LIT8( KThumbnailMimeWildCard, "*" );
    42 _LIT8( KThumbnailMimeWildCard, "*" );
    42 _LIT8( KThumbnailMimeImage, "image" );
    43 _LIT8( KThumbnailMimeImage, "image" );
    43 _LIT8( KThumbnailMimeVideo, "video" );
    44 _LIT8( KThumbnailMimeVideo, "video" );
   251     //OpenStoresL();
   252     //OpenStoresL();
   252     
   253     
   253     AddUnmountObserversL();
   254     AddUnmountObserversL();
   254     
   255     
   255     iReconnect = CPeriodic::NewL(CActive::EPriorityIdle);
   256     iReconnect = CPeriodic::NewL(CActive::EPriorityIdle);
       
   257 	
       
   258     //iFetchedChecker = CThumbnailFetchedChecker::NewL();
   256     }
   259     }
   257 
   260 
   258 
   261 
   259 // ---------------------------------------------------------------------------
   262 // ---------------------------------------------------------------------------
   260 // Destructor.
   263 // Destructor.
   264     {
   267     {
   265     TN_DEBUG1( "CThumbnailServer::~CThumbnailServer()" );
   268     TN_DEBUG1( "CThumbnailServer::~CThumbnailServer()" );
   266 
   269 
   267     iShutdown = ETrue;
   270     iShutdown = ETrue;
   268     
   271     
       
   272     //delete iFetchedChecker;
   269     delete iShutdownObserver;
   273     delete iShutdownObserver;
   270     delete iProcessor;
   274     delete iProcessor;
   271     
   275     
   272     if(iReconnect)
   276     if(iReconnect)
   273         {
   277         {
   482     TN_DEBUG4( 
   486     TN_DEBUG4( 
   483         "CThumbnailServer::AddBitmapToPoolL(aSession=0x%08x, aBitmap=0x%08x), handle=%d", aSession, aBitmap, aBitmap->Handle());
   487         "CThumbnailServer::AddBitmapToPoolL(aSession=0x%08x, aBitmap=0x%08x), handle=%d", aSession, aBitmap, aBitmap->Handle());
   484 
   488 
   485     TThumbnailBitmapRef* ptr = iBitmapPool.Find( aBitmap->Handle());
   489     TThumbnailBitmapRef* ptr = iBitmapPool.Find( aBitmap->Handle());
   486 
   490 
   487     TN_DEBUG2( "CThumbnailServer::AddBitmapToPoolL() - id = %d", aRequestId.iRequestId );
   491     TN_DEBUG2( "CThumbnailServer::AddBitmapToPoolL() - req id = %d", aRequestId.iRequestId );
   488     
   492     
   489     if ( ptr )
   493     if ( ptr )
   490         {
   494         {
   491         ptr->iRefCount++;
   495         ptr->iRefCount++;
   492         }
   496         }
   533         }
   537         }
   534     else
   538     else
   535         {
   539         {
   536         TN_DEBUG1( "CThumbnailServer::StoreThumbnailL() - file doesn't exists anymore, skip store!");
   540         TN_DEBUG1( "CThumbnailServer::StoreThumbnailL() - file doesn't exists anymore, skip store!");
   537         }
   541         }
       
   542 	/*if( iFetchedChecker )
       
   543 		{	
       
   544     	iFetchedChecker->SetFetchResult( aPath, KErrNone );
       
   545 		}*/
   538     }
   546     }
   539 
   547 
   540 
   548 
   541 // -----------------------------------------------------------------------------
   549 // -----------------------------------------------------------------------------
   542 // CThumbnailServer::FetchThumbnailL()
   550 // CThumbnailServer::FetchThumbnailL()
   544 //
   552 //
   545 void CThumbnailServer::FetchThumbnailL( const TDesC& aPath, CFbsBitmap* &
   553 void CThumbnailServer::FetchThumbnailL( const TDesC& aPath, CFbsBitmap* &
   546     aThumbnail, TDesC8* & aData, const TThumbnailSize aThumbnailSize, TSize &aOriginalSize )
   554     aThumbnail, TDesC8* & aData, const TThumbnailSize aThumbnailSize, TSize &aOriginalSize )
   547     {
   555     {
   548     TN_DEBUG3( "CThumbnailServer::FetchThumbnailL(aPath=%S aThumbnailSize=%d)", &aPath, aThumbnailSize );
   556     TN_DEBUG3( "CThumbnailServer::FetchThumbnailL(aPath=%S aThumbnailSize=%d)", &aPath, aThumbnailSize );
   549 
       
   550     StoreForPathL( aPath )->FetchThumbnailL( aPath, aThumbnail, aData, aThumbnailSize, aOriginalSize);
   557     StoreForPathL( aPath )->FetchThumbnailL( aPath, aThumbnail, aData, aThumbnailSize, aOriginalSize);
       
   558 /*    TInt err( iFetchedChecker->LastFetchResult( aPath ) );
       
   559     if ( err == KErrNone ) // To avoid useless sql gets that fails for sure
       
   560         {
       
   561         TRAP( err, StoreForPathL( aPath )->FetchThumbnailL( aPath, aThumbnail, aData, aThumbnailSize, aOriginalSize) );
       
   562         if ( err != KErrNone )
       
   563             {
       
   564             iFetchedChecker->SetFetchResult( aPath, err );
       
   565             }
       
   566         }
       
   567     User::LeaveIfError( err );*/
   551     }
   568     }
   552 
   569 
   553 
   570 
   554 
   571 
   555 // -----------------------------------------------------------------------------
   572 // -----------------------------------------------------------------------------
   597 void CThumbnailServer::DeleteThumbnailsL( const TDesC& aPath )
   614 void CThumbnailServer::DeleteThumbnailsL( const TDesC& aPath )
   598     {
   615     {
   599     TN_DEBUG2( "CThumbnailServer::DeleteThumbnailsL(%S)", &aPath);
   616     TN_DEBUG2( "CThumbnailServer::DeleteThumbnailsL(%S)", &aPath);
   600     
   617     
   601     StoreForPathL( aPath )->DeleteThumbnailsL( aPath );
   618     StoreForPathL( aPath )->DeleteThumbnailsL( aPath );
       
   619 	/*
       
   620 	if( iFetchedChecker )
       
   621 		{
       
   622     	iFetchedChecker->SetFetchResult( aPath, KErrNone );
       
   623 		}*/
   602     }
   624     }
   603 
   625 
   604 // -----------------------------------------------------------------------------
   626 // -----------------------------------------------------------------------------
   605 // CThumbnailServer::ResolveMimeTypeL()
   627 // CThumbnailServer::ResolveMimeTypeL()
   606 // -----------------------------------------------------------------------------
   628 // -----------------------------------------------------------------------------