Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Implements an interface to perform asynchronous database operations.
28 using namespace UserPromptService;
31 CDecisionDbCompactor::CDecisionDbCompactor():CActive(EPriorityStandard)
36 CActiveScheduler::Add(this);
39 CDecisionDbCompactor::~CDecisionDbCompactor()
44 iDbIncremental.Close();
48 CDecisionDbCompactor* CDecisionDbCompactor::NewLC()
52 @return A pointer to the newly allocated compactor object, if creation is successful.
53 The pointer is also put onto the cleanup stack.
56 CDecisionDbCompactor *self = new(ELeave) CDecisionDbCompactor();
57 CleanupStack::PushL(self);
62 EXPORT_C void CDecisionDbCompactor::Compact(TRequestStatus& aStatus)
64 Performs the asynchronous compaction of the decision database, returning immediately
65 and signalling the request status when the operation is fully complete.
67 @param aStatus The request status used to contain completion information for the function.
68 On completion, the status value should be interpreted as follows:
69 0, compaction is complete.< 0, an error code.
73 __ASSERT_ALWAYS(!IsActive(), User::Panic(KDecisionViewPanic,KErrInUse));
75 aStatus = KRequestPending;
76 iClientStatus = &aStatus;
80 iDbIncremental.Next(iStep, iStatus);
85 iDbIncremental.Close();
86 User::RequestComplete(iClientStatus,KErrNone);
92 void CDecisionDbCompactor::DoCancel()
95 iDbIncremental.Close();
98 User::RequestComplete(iClientStatus, KErrCancel);
103 TInt CDecisionDbCompactor::RunError(TInt aError)
108 User::RequestComplete(iClientStatus, aError);
114 void CDecisionDbCompactor::RunL()
117 TInt status = iStatus.Int();
118 User::LeaveIfError(status);
122 iDbIncremental.Next(iStep, iStatus);
127 iDbIncremental.Close();
128 User::RequestComplete(iClientStatus,status);