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_file/filesel.c
parent691cb61835dcf8964cb1e6110a4d369665fa1f21 (diff)
RNA API: reuse property lookups
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r--source/blender/editors/space_file/filesel.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 761249e7979..3206a0ff89b 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -117,10 +117,12 @@ short ED_fileselect_set_params(SpaceFile *sfile)
BLI_strncpy_utf8(params->title, RNA_struct_ui_name(op->type->srna), sizeof(params->title));
- if (RNA_struct_find_property(op->ptr, "filemode"))
- params->type = RNA_int_get(op->ptr, "filemode");
- else
+ if ((prop = RNA_struct_find_property(op->ptr, "filemode"))) {
+ params->type = RNA_property_int_get(op->ptr, prop);
+ }
+ else {
params->type = FILE_SPECIAL;
+ }
if (is_filepath && RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
char name[FILE_MAX];
@@ -210,8 +212,9 @@ short ED_fileselect_set_params(SpaceFile *sfile)
params->flag |= RNA_boolean_get(op->ptr, "active_layer") ? FILE_ACTIVELAY : 0;
}
- if (RNA_struct_find_property(op->ptr, "display_type"))
- params->display = RNA_enum_get(op->ptr, "display_type");
+ if ((prop = RNA_struct_find_property(op->ptr, "display_type"))) {
+ params->display = RNA_property_enum_get(op->ptr, prop);
+ }
if (params->display == FILE_DEFAULTDISPLAY) {
if (U.uiflag & USER_SHOW_THUMBNAILS) {
@@ -226,8 +229,10 @@ short ED_fileselect_set_params(SpaceFile *sfile)
}
if (is_relative_path) {
- if (!RNA_struct_property_is_set_ex(op->ptr, "relative_path", false)) {
- RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
+ if ((prop = RNA_struct_find_property(op->ptr, "relative_path"))) {
+ if (!RNA_property_is_set_ex(op->ptr, prop, false)) {
+ RNA_property_boolean_set(op->ptr, prop, U.flag & USER_RELPATHS);
+ }
}
}
}