diff options
author | julianeisel <julian_eisel@web.de> | 2014-11-10 22:29:44 +0300 |
---|---|---|
committer | julianeisel <julian_eisel@web.de> | 2014-11-10 22:32:17 +0300 |
commit | bd401d9517ff32b29a807143ab2b5cf89fcb286e (patch) | |
tree | 95c6765579fa0cab8915c2e049a929904818c638 /source/blender/editors/space_file/file_ops.c | |
parent | 99ded01b64a5eb1d6b190ae5a64b70fcfe4347d4 (diff) |
Fix T42498: Disable Renaming for Read-Only Files in File Browser
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 27d6fabba4e..13beba3fff8 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1498,6 +1498,15 @@ static int file_rename_poll(bContext *C) SpaceFile *sfile = CTX_wm_space_file(C); 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, ".")) { + poll = 0; + } + } + if (sfile->params->active_file < 0) { poll = 0; } |