Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
| Context not available. | |||||
| ListBase *drags = event->customdata; /* drop event type has listbase customdata by default */ | ListBase *drags = event->customdata; /* drop event type has listbase customdata by default */ | ||||
| for (wmd = drags->first; wmd; wmd = wmd->next) { | for (wmd = drags->first; wmd; wmd = wmd->next) { | ||||
| if (wmd->type == WM_DRAG_ID) { | |||||
| /* align these types with UI_but_active_drop_name */ | /* align these types with UI_but_active_drop_name */ | ||||
| if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) { | if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) { | ||||
| ID *id = (ID *)wmd->poin; | |||||
| button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); | button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); | ||||
| if (wmd->type == WM_DRAG_ID) { | |||||
| ID *id = (ID *)wmd->poin; | |||||
| BLI_strncpy(data->str, id->name + 2, data->maxlen); | BLI_strncpy(data->str, id->name + 2, data->maxlen); | ||||
sergey: If the suggestion above is followed this seems to be really couple of lines only? | |||||
| } | |||||
| else if (ELEM(wmd->type, WM_DRAG_DEFGROUP, WM_DRAG_CONSTRAINT, WM_DRAG_MODIFIER)) { | |||||
| // TODO: does this mem-leak? | |||||
campbellbartonUnsubmitted Not Done Inline ActionsI dont see why this would leak memory, can the comment be removed? campbellbarton: I dont see why this would leak memory, can the comment be removed? | |||||
| char *name = RNA_struct_name_get_alloc(wmd->poin, NULL, 0, NULL); | |||||
| BLI_strncpy(data->str, name, data->maxlen); | |||||
| MEM_freeN(name); | |||||
| } | |||||
| if (ELEM(but->type, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) { | if (ELEM(but->type, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) { | ||||
| but->changed = true; | but->changed = true; | ||||
| Context not available. | |||||
| button_activate_state(C, but, BUTTON_STATE_EXIT); | button_activate_state(C, but, BUTTON_STATE_EXIT); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| } | } | ||||
| Context not available. | |||||
If the suggestion above is followed this seems to be really couple of lines only?