diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-17 13:18:58 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-17 13:19:57 +0300 |
commit | 0b121d6a5ddb0605011cf89782d46df656f0deeb (patch) | |
tree | cded6231e07746274ebca9c64627cc6a8f54fd9a /source/blender/editors | |
parent | 1255ac12a6650a00aaaa529ec4818ce1e247e360 (diff) |
Cleanup image's poll funcs.
Checking space returned from CTX_wm_space_image() is SPACE_IMAGE type... tssst. :)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index ac0f327af0d..cc8a4357890 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -159,10 +159,10 @@ static int image_poll(bContext *C) static int space_image_buffer_exists_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); - if (sima && sima->spacetype == SPACE_IMAGE) - if (ED_space_image_has_buffer(sima)) - return 1; - return 0; + if (sima && ED_space_image_has_buffer(sima)) { + return true; + } + return false; } static int image_not_packed_poll(bContext *C) @@ -205,26 +205,29 @@ static int space_image_file_exists_poll(bContext *C) return ret; } - return 0; + return false; } +#if 0 /* UNUSED */ static int space_image_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); - if (sima && sima->spacetype == SPACE_IMAGE && sima->image) - return 1; - return 0; + if (sima && sima->image) { + return true; + } + return false; } +#endif int space_image_main_area_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); - // XXX ARegion *ar = CTX_wm_region(C); + /* XXX ARegion *ar = CTX_wm_region(C); */ - if (sima) - return 1; // XXX (ar && ar->type->regionid == RGN_TYPE_WINDOW); - - return 0; + if (sima) { + return true; /* XXX (ar && ar->type->regionid == RGN_TYPE_WINDOW); */ + } + return false; } /* For IMAGE_OT_curves_point_set to avoid sampling when in uv smooth mode or editmode */ |