engine/collectionframework/thumbnailcreator/src/glxtncleanuptask.cpp
changeset 71 27f2d7aec52a
parent 69 45459746d5e8
child 72 0a8e959402e5
equal deleted inserted replaced
69:45459746d5e8 71:27f2d7aec52a
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Thumbnail storage cleanup task implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  * @internal reviewed 31/07/2007 by Simon Brooks
       
    22  */
       
    23 
       
    24 // INCLUDE FILES
       
    25 
       
    26 #include "glxtncleanuptask.h"
       
    27 
       
    28 #include <glxassert.h>
       
    29 #include <glxtracer.h>
       
    30 
       
    31 #include "mglxtnstorage.h"
       
    32 
       
    33 // ============================ MEMBER FUNCTIONS ===============================
       
    34 
       
    35 // -----------------------------------------------------------------------------
       
    36 // CGlxtnCleanupTask::CGlxtnCleanupTask
       
    37 // C++ default constructor can NOT contain any code, that might leave.
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CGlxtnCleanupTask::CGlxtnCleanupTask(MGlxtnThumbnailStorage* aStorage) :
       
    41     CGlxtnTask(KGlxtnTaskIdCleanupThumbnails, KGlxIdNone, aStorage)
       
    42     {
       
    43     TRACER("CGlxtnCleanupTask::CGlxtnCleanupTask(MGlxtnThumbnailStorage* aStorage)");
       
    44     GLX_ASSERT_ALWAYS( aStorage, Panic( EGlxPanicIllegalArgument ),
       
    45                         "CGlxtnCleanupTask created without storage" );
       
    46 
       
    47     // Background task is always low priority
       
    48     SetPriority(EPriorityLow);
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CGlxtnCleanupTask::ConstructL
       
    53 // Symbian 2nd phase constructor can leave.
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 void CGlxtnCleanupTask::ConstructL()
       
    57     {
       
    58     TRACER("void CGlxtnCleanupTask::ConstructL()");
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CGlxtnCleanupTask::NewL
       
    63 // Two-phased constructor.
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 CGlxtnCleanupTask* CGlxtnCleanupTask::NewL(MGlxtnThumbnailStorage* aStorage)
       
    67     {
       
    68     TRACER("CGlxtnCleanupTask* CGlxtnCleanupTask::NewL(MGlxtnThumbnailStorage* aStorage)");
       
    69     CGlxtnCleanupTask* self = new (ELeave) CGlxtnCleanupTask(aStorage);
       
    70     CleanupStack::PushL(self);
       
    71     self->ConstructL();
       
    72     CleanupStack::Pop(self);
       
    73 
       
    74     return self;
       
    75     }
       
    76 
       
    77 // Destructor
       
    78 CGlxtnCleanupTask::~CGlxtnCleanupTask()
       
    79     {
       
    80     TRACER("Destructor CGlxtnCleanupTask::~CGlxtnCleanupTask()");
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // DoStartL
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 TBool CGlxtnCleanupTask::DoStartL(TRequestStatus& aStatus)
       
    88     {
       
    89     TRACER("TBool CGlxtnCleanupTask::DoStartL(TRequestStatus& aStatus)");
       
    90     Storage()->CleanupThumbnailsL(&aStatus);
       
    91 
       
    92     return ETrue;
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // DoCancel
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 void CGlxtnCleanupTask::DoCancel()
       
   100     {
       
   101     TRACER("void CGlxtnCleanupTask::DoCancel()");
       
   102     Storage()->StorageCancel();
       
   103     }
       
   104 
       
   105 // -----------------------------------------------------------------------------
       
   106 // DoRunL
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 TBool CGlxtnCleanupTask::DoRunL(TRequestStatus& /*aStatus*/)
       
   110     {
       
   111     TRACER("TBool CGlxtnCleanupTask::DoRunL(TRequestStatus& /*aStatus*/)");
       
   112     return EFalse;  // Task is complete
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // DoRunError
       
   117 // -----------------------------------------------------------------------------
       
   118 //
       
   119 TBool CGlxtnCleanupTask::DoRunError(TInt /*aError*/)
       
   120     {
       
   121     TRACER("TBool CGlxtnCleanupTask::DoRunError(TInt /*aError*/)");
       
   122     return EFalse;  // Task is complete
       
   123     }
       
   124 
       
   125 //  End of File