photosgallery/controllers/imageviewer/src/glximageviewermanager.cpp
branchRCL_3
changeset 25 191387a8b767
parent 14 ce1c7ad1f18b
child 32 78ad99c24f08
equal deleted inserted replaced
22:2dac0fdba72b 25:191387a8b767
    26 #include <driveinfo.h>
    26 #include <driveinfo.h>
    27 #include <coeutils.h>
    27 #include <coeutils.h>
    28 
    28 
    29 _LIT( KPrivateFolder, "\\Private\\" );
    29 _LIT( KPrivateFolder, "\\Private\\" );
    30 _LIT( KGifFileExt, ".gif" );
    30 _LIT( KGifFileExt, ".gif" );
    31 _LIT( KTempFilePath, "?:\\data\\images\\200104E7.gif" );
    31 _LIT( KMbmFileExt, ".mbm");
       
    32 _LIT( KTempGifFilePath, "?:\\data\\images\\200104E7.gif" );
       
    33 _LIT( KTempMbmFilePath, "?:\\data\\images\\200104E7.mbm" );
    32     
    34     
    33 EXPORT_C CGlxImageViewerManager* CGlxImageViewerManager::InstanceL()
    35 EXPORT_C CGlxImageViewerManager* CGlxImageViewerManager::InstanceL()
    34     {
    36     {
    35     TRACER("CGlxImageViewerManager::InstanceL()");
    37     TRACER("CGlxImageViewerManager::InstanceL()");
    36     return CGlxSingletonStore::InstanceL(&NewL);
    38     return CGlxSingletonStore::InstanceL(&NewL);
   171         {
   173         {
   172         // File is in private folder; duplicate file handle
   174         // File is in private folder; duplicate file handle
   173         iFile = new (ELeave) RFile64;
   175         iFile = new (ELeave) RFile64;
   174         User::LeaveIfError(iFile->Duplicate(aFileHandle));
   176         User::LeaveIfError(iFile->Duplicate(aFileHandle));
   175         iIsPrivate = ETrue;
   177         iIsPrivate = ETrue;
   176         if (parse.Ext().Compare(KGifFileExt) == 0)
   178         // Gif / MBM file from private path, hence make a local copy.
       
   179         if (parse.Ext().Compare(KGifFileExt) == 0 || parse.Ext().Compare(
       
   180                 KMbmFileExt) == 0)
   177             {
   181             {
   178             // Gif file from private path, hence make a local copy.
   182             TFileName ramFilePath;
   179             TFileName ramFilePath(KTempFilePath);
   183             if (parse.Ext().Compare(KGifFileExt) == 0)
       
   184                 {
       
   185                 ramFilePath.Copy(KTempGifFilePath);
       
   186                 }
       
   187             else
       
   188                 {
       
   189                 ramFilePath.Copy(KTempMbmFilePath);
       
   190                 }
   180             TChar drive;
   191             TChar drive;
   181             User::LeaveIfError(DriveInfo::GetDefaultDrive(
   192             User::LeaveIfError(DriveInfo::GetDefaultDrive(
   182                     DriveInfo::EDefaultRam, drive));
   193                     DriveInfo::EDefaultRam, drive));
   183             ramFilePath[0] = drive;
   194             ramFilePath[0] = drive;
   184             ConeUtils::EnsurePathExistsL(ramFilePath);
   195             ConeUtils::EnsurePathExistsL(ramFilePath);