diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-05 09:33:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-05 09:33:33 +0300 |
commit | 0ebdbdac00fda4ceb7f8a53e3b944575a8d76133 (patch) | |
tree | ee7d511599fe495381b2dbb39b7cf51261e06a2a /source/blender/editors/space_buttons/buttons_ops.c | |
parent | 7569a25a4f00575c690968eeb0ff53b6b4ab890b (diff) |
workaround/fix for [#24540] Adding the path to an image Editor in the file preferences window messes up the path
when selecting paths from the user preferences always default relative option to off.
otherwise you get paths like '//..\..\..\..\Program Files\GIMP-2.0\bin\gimp-2.6.exe'
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_ops.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_ops.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index e72446366fe..a461fdcd9c6 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -175,10 +175,12 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event) RNA_string_set(op->ptr, "filepath", str); MEM_freeN(str); - if(RNA_struct_find_property(op->ptr, "relative_path")) - if(!RNA_property_is_set(op->ptr, "relative_path")) - RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); - + if(RNA_struct_find_property(op->ptr, "relative_path")) { + if(!RNA_property_is_set(op->ptr, "relative_path")) { + /* annoying exception!, if were dealign with the user prefs, default relative to be off */ + RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U)); + } + } WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; |