|
1 /* |
|
2 * Copyright (c) 2008 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: PackageInfo array used in Model |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "appmngr2packageinfoarray.h" // CAppMngr2PackageInfoArray |
|
20 |
|
21 |
|
22 // ======== MEMBER FUNCTIONS ======== |
|
23 |
|
24 // --------------------------------------------------------------------------- |
|
25 // CAppMngr2PackageInfoArray::NewL() |
|
26 // --------------------------------------------------------------------------- |
|
27 // |
|
28 CAppMngr2PackageInfoArray* CAppMngr2PackageInfoArray::NewL( |
|
29 MAppMngr2InfoArrayObserver& aObserver ) |
|
30 { |
|
31 CAppMngr2PackageInfoArray* self = new (ELeave) CAppMngr2PackageInfoArray( aObserver ); |
|
32 return self; |
|
33 } |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // CAppMngr2PackageInfoArray::~CAppMngr2PackageInfoArray() |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 CAppMngr2PackageInfoArray::~CAppMngr2PackageInfoArray() |
|
40 { |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------------------------- |
|
44 // CAppMngr2PackageInfoArray::AddItemsInOrderL() |
|
45 // --------------------------------------------------------------------------- |
|
46 // |
|
47 void CAppMngr2PackageInfoArray::AddItemsInOrderL( |
|
48 RPointerArray<CAppMngr2PackageInfo>& aPackageInfos ) |
|
49 { |
|
50 // move items from aAppInfos to iArray using alphabetical order |
|
51 TInt count = aPackageInfos.Count(); |
|
52 for( TInt index = count - 1; index >= 0; index-- ) |
|
53 { |
|
54 AddItemInOrderL( aPackageInfos[ index ] ); // takes ownership |
|
55 aPackageInfos.Remove( index ); |
|
56 } |
|
57 } |
|
58 |
|
59 // --------------------------------------------------------------------------- |
|
60 // CAppMngr2PackageInfoArray::CAppMngr2PackageInfoArray() |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 CAppMngr2PackageInfoArray::CAppMngr2PackageInfoArray( |
|
64 MAppMngr2InfoArrayObserver& aObserver ) : CAppMngr2InfoArray( aObserver ) |
|
65 { |
|
66 } |
|
67 |