equal
deleted
inserted
replaced
32 |
32 |
33 // ======== MEMBER FUNCTIONS ======== |
33 // ======== MEMBER FUNCTIONS ======== |
34 |
34 |
35 // Initialization of a static member variable. |
35 // Initialization of a static member variable. |
36 int HsMenuService::mAllCollectionsId = 0; |
36 int HsMenuService::mAllCollectionsId = 0; |
37 |
37 const char COLLECTION_TITLE_NAME[] = "title_name"; |
38 /*! |
38 /*! |
39 Returns all applications model |
39 Returns all applications model |
40 \param sortAttribute :: SortAttribute |
40 \param sortAttribute :: SortAttribute |
41 \retval HsMenuItemModel: AllApplicationsModel |
41 \retval HsMenuItemModel: AllApplicationsModel |
42 */ |
42 */ |
234 HSMENUTEST_FUNC_ENTRY("HsMenuService::createCollection"); |
234 HSMENUTEST_FUNC_ENTRY("HsMenuService::createCollection"); |
235 int entryId = 0; |
235 int entryId = 0; |
236 CaEntry collection(GroupEntryRole); |
236 CaEntry collection(GroupEntryRole); |
237 collection.setEntryTypeName(collectionTypeName()); |
237 collection.setEntryTypeName(collectionTypeName()); |
238 collection.setText(name); |
238 collection.setText(name); |
|
239 collection.setAttribute(COLLECTION_TITLE_NAME, name); |
239 collection.setAttribute(groupNameAttributeName(),name); |
240 collection.setAttribute(groupNameAttributeName(),name); |
240 CaIconDescription iconDescription; |
241 CaIconDescription iconDescription; |
241 iconDescription.setFilename(defaultCollectionIconId()); |
242 iconDescription.setFilename(defaultCollectionIconId()); |
242 collection.setIconDescription(iconDescription); |
243 collection.setIconDescription(iconDescription); |
243 QSharedPointer<CaEntry> entry = CaService::instance()->createEntry(collection); |
244 QSharedPointer<CaEntry> entry = CaService::instance()->createEntry(collection); |
268 if (collection) { |
269 if (collection) { |
269 qDebug() << "HsMenuService::renameCollection collection" |
270 qDebug() << "HsMenuService::renameCollection collection" |
270 << collection; |
271 << collection; |
271 |
272 |
272 collection->setText(newCollectionName); |
273 collection->setText(newCollectionName); |
|
274 collection->setAttribute(COLLECTION_TITLE_NAME, newCollectionName); |
273 result = CaService::instance()->updateEntry(*collection); |
275 result = CaService::instance()->updateEntry(*collection); |
274 } |
276 } |
275 HSMENUTEST_FUNC_EXIT("HsMenuService::renameCollection"); |
277 HSMENUTEST_FUNC_EXIT("HsMenuService::renameCollection"); |
276 return result; |
278 return result; |
277 } |
279 } |