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 "cpapplicationsettingsitemdata.h" |
|
18 #include <QString> |
|
19 #include <QtAlgorithms> |
|
20 //#include <cppluginloader.h> |
|
21 #include <cpplugininterface.h> |
|
22 #include <cpsettingformentryitemdata.h> |
|
23 |
|
24 CpApplicationSettingsItemData::CpApplicationSettingsItemData() |
|
25 : CpCategorySettingFormItemData(HbDataFormModelItem::GroupItem, |
|
26 tr("Application Settings"), |
|
27 QString("cpapplicationsettingsplugin.cpcfg")) |
|
28 { |
|
29 } |
|
30 |
|
31 CpApplicationSettingsItemData::~CpApplicationSettingsItemData() |
|
32 { |
|
33 } |
|
34 |
|
35 /* |
|
36 struct ItemDataNameLessThan |
|
37 { |
|
38 bool operator() (CpSettingFormItemData *left,CpSettingFormItemData *right) const { |
|
39 QString leftName; |
|
40 if (CpSettingFormEntryItemData *leftEntry = qobject_cast<CpSettingFormEntryItemData*>(left)) { |
|
41 leftName = leftEntry->text(); |
|
42 } |
|
43 else { |
|
44 leftName = left->label(); |
|
45 } |
|
46 |
|
47 QString rightName; |
|
48 if (CpSettingFormEntryItemData *rightEntry = qobject_cast<CpSettingFormEntryItemData*>(right)) { |
|
49 rightName = rightEntry->text(); |
|
50 } |
|
51 else { |
|
52 rightName = right->label(); |
|
53 } |
|
54 |
|
55 return leftName.compare(rightName,Qt::CaseInsensitive) < 0; |
|
56 } |
|
57 }; |
|
58 */ |
|
59 |
|
60 void CpApplicationSettingsItemData::afterLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/) |
|
61 { |
|
62 /* |
|
63 QList<CpSettingFormItemData*> allItemData; |
|
64 |
|
65 QList<CpPluginInterface*> appplugins = CpPluginLoader::loadApplicationCpPlugins(); |
|
66 foreach (CpPluginInterface *plugin, appplugins) { |
|
67 allItemData += plugin->createSettingFormItemData(itemDataHelper); |
|
68 } |
|
69 |
|
70 //sort by name |
|
71 qSort(allItemData.begin(),allItemData.end(),ItemDataNameLessThan()); |
|
72 |
|
73 foreach(CpSettingFormItemData *itemData,allItemData) { |
|
74 appendChild(itemData); |
|
75 } |
|
76 */ |
|
77 } |
|
78 |
|
79 // End of File |
|