|
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 @released |
|
20 */ |
|
21 #include "cmdclearstartupreason.h" |
|
22 #include "ssmdebug.h" |
|
23 #include <centralrepository.h> |
|
24 #include <ssm/starterdomaincrkeys.h> |
|
25 |
|
26 CCustomCmdClearStartupReason* CCustomCmdClearStartupReason::NewL() |
|
27 { |
|
28 return new (ELeave) CCustomCmdClearStartupReason(); |
|
29 } |
|
30 |
|
31 CCustomCmdClearStartupReason::~CCustomCmdClearStartupReason() |
|
32 { |
|
33 delete iRepository; |
|
34 } |
|
35 |
|
36 CCustomCmdClearStartupReason::CCustomCmdClearStartupReason() |
|
37 { |
|
38 } |
|
39 |
|
40 TInt CCustomCmdClearStartupReason::Initialize(CSsmCustomCommandEnv* /*aCmdEnv*/) |
|
41 { |
|
42 // Connect to the central repository |
|
43 TRAPD(err, iRepository = CRepository::NewL(KCRUidStartup)); |
|
44 return err; |
|
45 } |
|
46 |
|
47 void CCustomCmdClearStartupReason::Execute(const TDesC8& /*aParams*/, TRequestStatus& aRequest) |
|
48 { |
|
49 aRequest = KRequestPending; |
|
50 const TInt err = iRepository->Set(KStartupReason, ENormalStartup); |
|
51 if(KErrNone != err) |
|
52 { |
|
53 DEBUGPRINT2A("Setting KStartupReason CenRep key failed with error %d", err); |
|
54 } |
|
55 |
|
56 TRequestStatus* request = &aRequest; |
|
57 User::RequestComplete(request, err); |
|
58 } |
|
59 |
|
60 void CCustomCmdClearStartupReason::ExecuteCancel() |
|
61 { |
|
62 //Nothing to cancel |
|
63 } |
|
64 |
|
65 void CCustomCmdClearStartupReason::Close() |
|
66 { |
|
67 } |
|
68 |
|
69 void CCustomCmdClearStartupReason::Release() |
|
70 { |
|
71 delete this; |
|
72 } |