Commit: 0b121d6a5ddb0605011cf89782d46df656f0deeb
Author: Bastien Montagne
Date:   Fri Jul 17 12:18:58 2015 +0200
Branches: master
https://developer.blender.org/rB0b121d6a5ddb0605011cf89782d46df656f0deeb

Cleanup image's poll funcs.

Checking space returned from CTX_wm_space_image() is SPACE_IMAGE type... tssst. 
:)

===================================================================

M       source/blender/editors/space_image/image_ops.c

===================================================================

diff --git a/source/blender/editors/space_image/image_ops.c 
b/source/blender/editors/space_image/image_ops.c
index ac0f327..cc8a435 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 */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to