|
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 |
|
18 #include "cpcategorysettingformmodel.h" |
|
19 #include <QString> |
|
20 |
|
21 #include "cputility.h" |
|
22 #include <cpitemdatahelper.h> |
|
23 |
|
24 class CpCategorySettingFormModelPrivate |
|
25 { |
|
26 public: |
|
27 CpCategorySettingFormModelPrivate(const QString &configFile) : |
|
28 mInitialized(false), |
|
29 mConfigFile(configFile) |
|
30 { |
|
31 } |
|
32 |
|
33 ~CpCategorySettingFormModelPrivate() |
|
34 { |
|
35 } |
|
36 |
|
37 public: |
|
38 bool mInitialized; |
|
39 QString mConfigFile; |
|
40 }; |
|
41 |
|
42 CpCategorySettingFormModel::CpCategorySettingFormModel(const QString &configFile) : |
|
43 d (new CpCategorySettingFormModelPrivate(configFile)) |
|
44 { |
|
45 } |
|
46 |
|
47 CpCategorySettingFormModel::~CpCategorySettingFormModel() |
|
48 { |
|
49 delete d; |
|
50 } |
|
51 |
|
52 void CpCategorySettingFormModel::initialize(CpItemDataHelper &itemDataHelper) |
|
53 { |
|
54 //avoid to be called twice |
|
55 if (!d->mInitialized) { |
|
56 //give derived class a change do their special things before loading config plugins |
|
57 beforeLoadingConfigPlugins(itemDataHelper); |
|
58 //load plugins which are configured |
|
59 CpUtility::buildConfigPluginItems(invisibleRootItem(),d->mConfigFile,itemDataHelper); |
|
60 //give derived class a change do their special things after loading config plugins |
|
61 afterLoadingConfigPlugins(itemDataHelper); |
|
62 |
|
63 d->mInitialized = true; |
|
64 } |
|
65 } |
|
66 |
|
67 |
|
68 void CpCategorySettingFormModel::beforeLoadingConfigPlugins(CpItemDataHelper&/*itemDataHelper*/) |
|
69 { |
|
70 } |
|
71 |
|
72 void CpCategorySettingFormModel::afterLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/) |
|
73 { |
|
74 } |