|
1 /* |
|
2 * Copyright (c) 2010 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: LocationPickerCollectionListContent implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <QStandardItemModel> |
|
19 |
|
20 #include "locationpickercollectionlistcontent.h" |
|
21 #include "locationpickerdatamanager.h" |
|
22 |
|
23 // ======== MEMBER FUNCTIONS ======== |
|
24 |
|
25 // ---------------------------------------------------------------------- |
|
26 // LocationPickerCollectionListContent::LocationPickerCollectionListContent() |
|
27 // ---------------------------------------------------------------------- |
|
28 LocationPickerCollectionListContent::LocationPickerCollectionListContent(Qt::Orientation aOrientation ) |
|
29 :mOrientation(aOrientation), |
|
30 mModel(NULL), |
|
31 mDataManager(NULL) |
|
32 { |
|
33 // Create a standard model for the view list |
|
34 mModel = new QStandardItemModel( this ); |
|
35 |
|
36 mDataManager = new LocationPickerDataManager( *mModel, ELocationPickerCollectionListContent ); |
|
37 mDataManager->populateModel( mOrientation ); |
|
38 } |
|
39 |
|
40 // ---------------------------------------------------------------------- |
|
41 // LocationPickerCollectionListContent::~LocationPickerCollectionListContent() |
|
42 // ---------------------------------------------------------------------- |
|
43 LocationPickerCollectionListContent::~LocationPickerCollectionListContent() |
|
44 { |
|
45 if( mDataManager ) |
|
46 delete mDataManager; |
|
47 delete mModel; |
|
48 } |
|
49 |
|
50 // ---------------------------------------------------------------- |
|
51 // LocationPickerCollectionListContent::getStandardModel |
|
52 // ----------------------------------------------------------------- |
|
53 QStandardItemModel* LocationPickerCollectionListContent::getStandardModel() |
|
54 { |
|
55 return mModel; |
|
56 } |
|
57 |
|
58 // ---------------------------------------------------------------- |
|
59 // LocationPickerCollectionListContent::getDataManager |
|
60 // ----------------------------------------------------------------- |
|
61 LocationPickerDataManager* LocationPickerCollectionListContent::getDataManager() |
|
62 { |
|
63 return mDataManager; |
|
64 } |
|
65 |