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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-02-17 05:09:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-02-17 05:13:59 +0300
commit4bb331dfd5f3d9a42140e8f12bb917c525eeb529 (patch)
tree90107388131cad0c65ef19887406dacb93c11a83 /source/blender/editors/space_buttons/buttons_ops.c
parent691cb61835dcf8964cb1e6110a4d369665fa1f21 (diff)
RNA API: reuse property lookups
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_ops.c')
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index 0b643cd7858..ba0c22a4ade 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -205,6 +205,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_CANCELLED;
}
else {
+ PropertyRNA *prop_relpath;
const char *path_prop = RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath";
fbo = MEM_callocN(sizeof(FileBrowseOp), "FileBrowseOp");
fbo->ptr = ptr;
@@ -216,10 +217,10 @@ static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event)
/* normally ED_fileselect_get_params would handle this but we need to because of stupid
* user-prefs exception - campbell */
- if (RNA_struct_find_property(op->ptr, "relative_path")) {
- if (!RNA_struct_property_is_set(op->ptr, "relative_path")) {
+ if ((prop_relpath = RNA_struct_find_property(op->ptr, "relative_path"))) {
+ if (!RNA_property_is_set(op->ptr, prop_relpath)) {
/* annoying exception!, if were dealing with the user prefs, default relative to be off */
- RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U));
+ RNA_property_boolean_set(op->ptr, prop_relpath, U.flag & USER_RELPATHS && (ptr.data != &U));
}
}
WM_event_add_fileselect(C, op);