equal
deleted
inserted
replaced
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 const char COLLECTION_TITLE_NAME[] = "title_name"; |
37 const char COLLECTION_TITLE_NAME[] = "title_name"; |
|
38 const char COLLECTION_SHORT_NAME[] = "short_name"; |
38 /*! |
39 /*! |
39 Returns all applications model |
40 Returns all applications model |
40 \param sortAttribute :: SortAttribute |
41 \param sortAttribute :: SortAttribute |
41 \retval HsMenuItemModel: AllApplicationsModel |
42 \retval HsMenuItemModel: AllApplicationsModel |
42 */ |
43 */ |
234 HSMENUTEST_FUNC_ENTRY("HsMenuService::createCollection"); |
235 HSMENUTEST_FUNC_ENTRY("HsMenuService::createCollection"); |
235 int entryId = 0; |
236 int entryId = 0; |
236 CaEntry collection(GroupEntryRole); |
237 CaEntry collection(GroupEntryRole); |
237 collection.setEntryTypeName(collectionTypeName()); |
238 collection.setEntryTypeName(collectionTypeName()); |
238 collection.setText(name); |
239 collection.setText(name); |
239 collection.setAttribute(COLLECTION_TITLE_NAME, name); |
|
240 collection.setAttribute(groupNameAttributeName(),name); |
240 collection.setAttribute(groupNameAttributeName(),name); |
241 CaIconDescription iconDescription; |
241 CaIconDescription iconDescription; |
242 iconDescription.setFilename(defaultCollectionIconId()); |
242 iconDescription.setFilename(defaultCollectionIconId()); |
243 collection.setIconDescription(iconDescription); |
243 collection.setIconDescription(iconDescription); |
244 QSharedPointer<CaEntry> entry = CaService::instance()->createEntry(collection); |
244 QSharedPointer<CaEntry> entry = CaService::instance()->createEntry(collection); |
270 qDebug() << "HsMenuService::renameCollection collection" |
270 qDebug() << "HsMenuService::renameCollection collection" |
271 << collection; |
271 << collection; |
272 |
272 |
273 collection->setText(newCollectionName); |
273 collection->setText(newCollectionName); |
274 collection->setAttribute(COLLECTION_TITLE_NAME, newCollectionName); |
274 collection->setAttribute(COLLECTION_TITLE_NAME, newCollectionName); |
|
275 collection->setAttribute(COLLECTION_SHORT_NAME, newCollectionName); |
275 result = CaService::instance()->updateEntry(*collection); |
276 result = CaService::instance()->updateEntry(*collection); |
276 } |
277 } |
277 HSMENUTEST_FUNC_EXIT("HsMenuService::renameCollection"); |
278 HSMENUTEST_FUNC_EXIT("HsMenuService::renameCollection"); |
278 return result; |
279 return result; |
279 } |
280 } |