equal
deleted
inserted
replaced
80 Constructor |
80 Constructor |
81 \retval void |
81 \retval void |
82 */ |
82 */ |
83 HsAppsCheckList::HsAppsCheckList() : |
83 HsAppsCheckList::HsAppsCheckList() : |
84 mAppsSelectDialog(0), mActionConfirm(0), mListView(0), mModel(0), |
84 mAppsSelectDialog(0), mActionConfirm(0), mListView(0), mModel(0), |
85 mSortAttribute(AscendingNameHsSortAttribute) |
85 mSortAttribute(Hs::AscendingNameHsSortAttribute) |
86 { |
86 { |
87 } |
87 } |
88 |
88 |
89 /*! |
89 /*! |
90 Destructor |
90 Destructor |
103 //clean up |
103 //clean up |
104 if (mAppsSelectDialog) { |
104 if (mAppsSelectDialog) { |
105 mAppsSelectDialog->close(); |
105 mAppsSelectDialog->close(); |
106 } |
106 } |
107 |
107 |
108 mSortAttribute = AscendingNameHsSortAttribute; |
108 mSortAttribute = Hs::AscendingNameHsSortAttribute; |
109 } |
109 } |
110 |
110 |
111 /*! |
111 /*! |
112 Sets sort order for applications. |
112 Sets sort order for applications. |
113 \param sortAttribute sort order. |
113 \param sortAttribute sort order. |
114 */ |
114 */ |
115 void HsAppsCheckList::setSortOrder(HsSortAttribute sortOrder) |
115 void HsAppsCheckList::setSortOrder(Hs::HsSortAttribute sortOrder) |
116 { |
116 { |
117 mSortAttribute = sortOrder; |
117 mSortAttribute = sortOrder; |
118 } |
118 } |
119 |
119 |
120 /*! |
120 /*! |
121 Shows check box list with all application. |
121 Shows check box list with all application. |
122 \param sortAttribute order to sort applications. |
122 \param sortAttribute order to sort applications. |
123 */ |
123 */ |
124 void HsAppsCheckList::showAppsCheckboxList(HsSortAttribute sortOrder) |
124 void HsAppsCheckList::showAppsCheckboxList(Hs::HsSortAttribute sortOrder) |
125 { |
125 { |
126 HSMENUTEST_FUNC_ENTRY("HsAppsCheckList::showAppsCheckboxList"); |
126 HSMENUTEST_FUNC_ENTRY("HsAppsCheckList::showAppsCheckboxList"); |
127 if (!mModel) { |
127 if (!mModel) { |
128 mModel = HsMenuService::getAllApplicationsModel(sortOrder); |
128 mModel = HsMenuService::getAllApplicationsModel(sortOrder); |
129 } |
129 } |
225 } |
225 } |
226 itemsMap.insertMulti(itemName.toLower(), itemId); |
226 itemsMap.insertMulti(itemName.toLower(), itemId); |
227 } |
227 } |
228 |
228 |
229 QList<int> list = itemsMap.values(); |
229 QList<int> list = itemsMap.values(); |
230 if (mSortAttribute == DescendingNameHsSortAttribute) { |
230 if (mSortAttribute == Hs::DescendingNameHsSortAttribute) { |
231 QList<int> reversedList; |
231 QList<int> reversedList; |
232 int count = list.count(); |
232 int count = list.count(); |
233 for (int i = 0; i < count; i++) { |
233 for (int i = 0; i < count; i++) { |
234 reversedList.append(list.takeLast()); |
234 reversedList.append(list.takeLast()); |
235 } |
235 } |