Changeset 2b4e02b in mainline
- Timestamp:
- 2023-12-19T15:48:48Z (13 months ago)
- Branches:
- master, topic/simplify-dev-export
- Children:
- 21a65cca
- Parents:
- f393bc0
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar-cfg/startmenu.c
rf393bc0 r2b4e02b 366 366 * 367 367 * @param smenu Start menu 368 * @return Selected entry 368 * @return Selected entry or @c NULL if no entry is selected 369 369 */ 370 370 startmenu_entry_t *startmenu_get_selected(startmenu_t *smenu) … … 373 373 374 374 entry = ui_list_get_cursor(smenu->entries_list); 375 if (entry == NULL) 376 return NULL; 377 375 378 return (startmenu_entry_t *)ui_list_entry_get_arg(entry); 376 379 } … … 387 390 388 391 smentry = startmenu_get_selected(smenu); 392 if (smentry == NULL) 393 return; 389 394 390 395 rc = smeedit_create(smenu, smentry, &smee); … … 437 442 static void startmenu_delete_entry_clicked(ui_pbutton_t *pbutton, void *arg) 438 443 { 444 startmenu_t *smenu = (startmenu_t *)arg; 445 startmenu_entry_t *smentry; 446 errno_t rc; 447 439 448 (void)pbutton; 440 (void)arg; 449 450 smentry = startmenu_get_selected(smenu); 451 if (smentry == NULL) 452 return; 453 454 rc = smenu_entry_destroy(smentry->entry); 455 if (rc != EOK) 456 return; 457 458 ui_list_entry_delete(smentry->lentry); 459 free(smentry); 460 (void) ui_control_paint(ui_list_ctl(smenu->entries_list)); 441 461 } 442 462 -
uspace/lib/tbarcfg/src/tbarcfg.c
rf393bc0 r2b4e02b 441 441 442 442 smenu_entry_delete(entry); 443 return EOK; 443 444 error: 444 445 if (trans != NULL) -
uspace/lib/tbarcfg/test/tbarcfg.c
rf393bc0 r2b4e02b 216 216 } 217 217 218 /** Destroy start menu entry */ 219 PCUT_TEST(entry_destroy) 220 { 221 errno_t rc; 222 tbarcfg_t *tbcfg; 223 char fname[L_tmpnam], *p; 224 smenu_entry_t *e; 225 226 p = tmpnam(fname); 227 PCUT_ASSERT_NOT_NULL(p); 228 229 rc = tbarcfg_create(fname, &tbcfg); 230 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 231 232 rc = smenu_entry_create(tbcfg, "A", "a"); 233 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 234 235 e = tbarcfg_smenu_first(tbcfg); 236 PCUT_ASSERT_NOT_NULL(e); 237 238 rc = smenu_entry_destroy(e); 239 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 240 241 e = tbarcfg_smenu_first(tbcfg); 242 PCUT_ASSERT_NULL(e); 243 244 tbarcfg_close(tbcfg); 245 remove(fname); 246 } 247 218 248 PCUT_EXPORT(tbarcfg);
Note:
See TracChangeset
for help on using the changeset viewer.