diff -r b67379558a75 -r d429f823a6b7 imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp --- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp Tue Jul 06 14:37:18 2010 +0300 +++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailserver.cpp Thu Jul 08 15:45:05 2010 +0300 @@ -570,7 +570,7 @@ if( iFetchedChecker ) { - iFetchedChecker->SetFetchResult( aPath, KErrNone ); + iFetchedChecker->SetFetchResult( aPath, aThumbnailSize, KErrNone ); } } @@ -585,7 +585,7 @@ TN_DEBUG3( "CThumbnailServer::FetchThumbnailL(aPath=%S aThumbnailSize=%d)", &aPath, aThumbnailSize ); if( iFetchedChecker ) { - TInt err( iFetchedChecker->LastFetchResult( aPath ) ); + TInt err( iFetchedChecker->LastFetchResult( aPath, aThumbnailSize ) ); if ( err == KErrNone ) // To avoid useless sql gets that fails for sure { // custom sizes are not stored to db, skip fetching @@ -597,7 +597,7 @@ TRAP( err, StoreForPathL( aPath )->FetchThumbnailL( aPath, aThumbnail, aData, aThumbnailSize, aOriginalSize) ); if ( err != KErrNone ) { - iFetchedChecker->SetFetchResult( aPath, err ); + iFetchedChecker->SetFetchResult( aPath, aThumbnailSize, err ); } } User::LeaveIfError( err ); @@ -666,7 +666,7 @@ if( iFetchedChecker ) { - iFetchedChecker->SetFetchResult( aPath, KErrNone ); + iFetchedChecker->DeleteFetchResult( aPath ); } } @@ -944,7 +944,7 @@ } else { - if(iFormatting) + if( iFormatting ) { TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - FORMATTING! - ABORT"); User::Leave( KErrNotSupported ); @@ -953,17 +953,31 @@ TVolumeInfo volumeInfo; TInt err = iFs.Volume( volumeInfo, aDrive ); - if ( err || volumeInfo.iDrive.iDriveAtt& KDriveAttRom || - volumeInfo.iDrive.iDriveAtt& KDriveAttRemote || - volumeInfo.iDrive.iMediaAtt& KMediaAttWriteProtected || - volumeInfo.iDrive.iMediaAtt& KMediaAttLocked ) + if ( err ) + { + // Locked + TN_DEBUG2( "CThumbnailServer::StoreForDriveL() - err %d", err); + User::Leave( err); + } + else if( volumeInfo.iDrive.iMediaAtt& KMediaAttLocked ) { - // We don't support ROM disks or remote mounts. Media - // must be read-write and not locked. - User::Leave( KErrAccessDenied); + TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - locked"); + User::Leave( KErrAccessDenied ); } - - res = CThumbnailStore::NewL( iFs, aDrive, iImei, this ); + else if ( volumeInfo.iDrive.iDriveAtt& KDriveAttRom || + volumeInfo.iDrive.iDriveAtt& KDriveAttRemote || + volumeInfo.iDrive.iMediaAtt& KMediaAttWriteProtected ) + { + // We support ROM disks and remote disks in read only mode. + TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - rom/remote/write protected"); + res = CThumbnailStore::NewL( iFs, aDrive, iImei, this, ETrue ); + } + else + { + TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - normal"); + res = CThumbnailStore::NewL( iFs, aDrive, iImei, this, EFalse ); + } + CleanupStack::PushL( res ); iStores.InsertL( aDrive, res ); res->SetPersistentSizes(iPersistentSizes); @@ -1295,7 +1309,7 @@ if( iFetchedChecker ) { - iFetchedChecker->SetFetchResult( aPath, KErrNone ); + iFetchedChecker->DeleteFetchResult( aPath ); } // need to create new thumbs @@ -1327,8 +1341,7 @@ if( iFetchedChecker ) { - iFetchedChecker->SetFetchResult( aNewPath, iFetchedChecker->LastFetchResult(aCurrentPath) ); - iFetchedChecker->SetFetchResult( aCurrentPath, KErrNone ); + iFetchedChecker->RenameFetchResultL( aNewPath, aCurrentPath ); } }