diff options
author | julianeisel <julian_eisel@web.de> | 2014-12-24 21:51:42 +0300 |
---|---|---|
committer | julianeisel <julian_eisel@web.de> | 2014-12-24 21:51:42 +0300 |
commit | 76b4fad6dbda1b10c8db1acec49c30386c9d9a94 (patch) | |
tree | 5ecd25f9a1df20cf1d0e4f4db5399038576f2e91 /source/blender/editors/space_file/file_ops.c | |
parent | 703bb0f62dbcd2a6ddebd1faae238790c0e19a46 (diff) |
Fix T42879: File Browser - disable selecting ".." entry (Parent Directory)
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index df3f989c3a2..5798529583f 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -341,8 +341,20 @@ static int file_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) if (!BLI_rcti_isect_pt(&ar->v2d.mask, rect.xmin, rect.ymin)) return OPERATOR_CANCELLED; - /* single select, deselect all selected first */ - if (!extend) file_deselect_all(sfile, SELECTED_FILE); + if (sfile && sfile->params) { + int idx = sfile->params->active_file; + + if (idx >= 0) { + struct direntry *file = filelist_file(sfile->files, idx); + if (STREQ(file->relname, "..") || STREQ(file->relname, ".")) { + /* skip - If a readonly file (".." or ".") is selected, skip deselect all! */ + } + else { + /* single select, deselect all selected first */ + if (!extend) file_deselect_all(sfile, SELECTED_FILE); + } + } + } ret = file_select(C, &rect, extend ? FILE_SEL_TOGGLE : FILE_SEL_ADD, fill, do_diropen); if (FILE_SELECT_DIR == ret) |