1 /* |
|
2 * Copyright (c) 2002-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: This file contains the implementation of CStartupTaskRemove |
|
15 * class member functions. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <dscstore.h> // RDscStore |
|
21 #include <dscitem.h> // CDscItem |
|
22 #include "StartupTaskRemove.h" |
|
23 #include "SWInstDebug.h" |
|
24 |
|
25 using namespace SwiUI; |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS =============================== |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CStartupTaskRemove::CStartupTaskRemove |
|
31 // C++ default constructor can NOT contain any code, that |
|
32 // might leave. |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 CStartupTaskRemove::CStartupTaskRemove() |
|
36 { |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CStartupTaskRemove::NewL |
|
41 // Two-phased constructor. |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 CStartupTaskRemove* CStartupTaskRemove::NewL() |
|
45 { |
|
46 return new(ELeave) CStartupTaskRemove(); |
|
47 } |
|
48 |
|
49 // Destructor |
|
50 CStartupTaskRemove::~CStartupTaskRemove() |
|
51 { |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CStartupTaskRemove::ExecuteL |
|
56 // Executes the task. |
|
57 // (other items were commented in a header). |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 void CStartupTaskRemove::ExecuteL() |
|
61 { |
|
62 RDscStore dsc; |
|
63 dsc.OpenL(); |
|
64 CleanupClosePushL( dsc ); |
|
65 CreateIfNotExistL( dsc ); |
|
66 |
|
67 for( TInt index = 0; index < iItems.Count(); index++ ) |
|
68 { |
|
69 const TDesC& fileName = iItems[index]->ExecutableFile(); |
|
70 CDscItem* item = CDscItem::NewLC( fileName, KNullDesC ); |
|
71 |
|
72 FLOG_1( _L("StartupTaskRemove: Searching for %S"), &fileName ); |
|
73 if( dsc.ItemExistsL( *item ) ) |
|
74 { |
|
75 FLOG_1( _L("StartupTaskRemove: Removing %S"), &fileName ); |
|
76 dsc.DeleteItemL( *item ); |
|
77 } |
|
78 |
|
79 CleanupStack::PopAndDestroy( item ); |
|
80 } |
|
81 |
|
82 CleanupStack::PopAndDestroy( &dsc ); |
|
83 } |
|
84 |
|
85 |
|
86 // End of File |
|