107
|
1 |
/*
|
|
2 |
* Copyright (c) 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
#include "afapplicationsstorage.h"
|
|
18 |
//------------------------------------------------------------------------------
|
|
19 |
CAfApplicationsStorage* CAfApplicationsStorage::NewL(CAfStorage& storage,
|
|
20 |
const MAfApplicationsRegistry& provider)
|
|
21 |
{
|
|
22 |
CAfApplicationsStorage *self = new (ELeave)CAfApplicationsStorage(storage, provider);
|
|
23 |
return self;
|
|
24 |
|
|
25 |
}
|
|
26 |
|
|
27 |
//------------------------------------------------------------------------------
|
|
28 |
CAfApplicationsStorage::CAfApplicationsStorage(CAfStorage& storage,
|
|
29 |
const MAfApplicationsRegistry& provider)
|
|
30 |
:
|
|
31 |
mStorage(storage),
|
|
32 |
mProvider(provider)
|
|
33 |
{
|
|
34 |
}
|
|
35 |
|
|
36 |
//------------------------------------------------------------------------------
|
|
37 |
CAfApplicationsStorage::~CAfApplicationsStorage()
|
|
38 |
{}
|
|
39 |
|
|
40 |
//------------------------------------------------------------------------------
|
|
41 |
void CAfApplicationsStorage::applicationsChanged()
|
|
42 |
{
|
|
43 |
const TArray<TUid> removedApp(mProvider.removedApplications());
|
|
44 |
for (TInt iter(0); iter < removedApp.Count(); ++iter) {
|
|
45 |
TRAP_IGNORE(deleteActivityL(removedApp[iter]));
|
|
46 |
}
|
|
47 |
}
|
|
48 |
|
|
49 |
//------------------------------------------------------------------------------
|
|
50 |
void CAfApplicationsStorage::deleteActivityL(TUid appId)
|
|
51 |
{
|
|
52 |
CAfEntry *entry(CAfEntry::NewLC(0,
|
|
53 |
static_cast<TInt>(appId.iUid),
|
|
54 |
KNullDesC,
|
|
55 |
KNullDesC,
|
|
56 |
KNullDesC8,
|
|
57 |
KNullDesC8));
|
|
58 |
mStorage.DeleteActivitiesL(*entry);
|
|
59 |
CleanupStack::PopAndDestroy(entry);
|
|
60 |
}
|
|
61 |
|