Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-07-20 04:02:03 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-20 04:02:03 +0400
commitb76009232eea8d299fa2bec52c44dc76872705fb (patch)
tree496aea494dac3ce241d0c56570cd2c8cd13839b6 /source
parent4e9171e6f6f3b09d2faa50f790d2abff51082ea7 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/editconstraint.c20
-rw-r--r--source/blender/editors/space_file/file_ops.c17
2 files changed, 26 insertions, 11 deletions
diff --git a/source/blender/editors/object/editconstraint.c b/source/blender/editors/object/editconstraint.c
index 477d04a818b..e3ec72b502c 100644
--- a/source/blender/editors/object/editconstraint.c
+++ b/source/blender/editors/object/editconstraint.c
@@ -1329,8 +1329,14 @@ 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,8 +1378,14 @@ 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;
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index cd981b7b419..0bc2e310810 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -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->active_file < 0) {
- poll= 0;
- } else {
- file = filelist_file(sfile->files, sfile->params->active_file);
- if (file && S_ISDIR(file->type)) 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;
}