2.5 - Bugfixes

* Fix for crash when holding down downarrow in the info-header search box. Was caused by badly written poll callback for file-browser. Thanks pidhash for noticing the error

* Made add constraint operators work again from 3D-View. They were using the wrong context pointer when in the 3D-View, since the old one was only valid for the buttons-window. Now they check which window they're in.
This commit is contained in:
Joshua Leung 2009-07-20 00:02:03 +00:00
parent 4e9171e6f6
commit b76009232e
2 changed files with 26 additions and 11 deletions

@ -1329,7 +1329,13 @@ static int object_constraint_add_invoke(bContext *C, wmOperator *op, wmEvent *ev
/* dummy operator callback */
static int object_constraint_add_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
ScrArea *sa= CTX_wm_area(C);
Object *ob;
if (sa->spacetype == SPACE_BUTS)
ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
else
ob= CTX_data_active_object(C);
if (!ob)
return OPERATOR_CANCELLED;
@ -1372,7 +1378,13 @@ static int pose_constraint_add_invoke(bContext *C, wmOperator *op, wmEvent *evt)
/* dummy operator callback */
static int pose_constraint_add_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
ScrArea *sa= CTX_wm_area(C);
Object *ob;
if (sa->spacetype == SPACE_BUTS)
ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
else
ob= CTX_data_active_object(C);
if (!ob)
return OPERATOR_CANCELLED;

@ -876,14 +876,17 @@ int file_delete_poll(bContext *C)
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
struct direntry* file;
if(!sfile->params ) poll= 0;
if (sfile->params) {
if (sfile->params->active_file < 0) {
poll= 0;
} else {
file = filelist_file(sfile->files, sfile->params->active_file);
if (file && S_ISDIR(file->type)) poll= 0;
}
}
else
poll= 0;
return poll;
}