Commit: bd401d9517ff32b29a807143ab2b5cf89fcb286e
Author: julianeisel
Date: Mon Nov 10 20:29:44 2014 +0100
Branches: master
https://developer.blender.org/rBbd401d9517ff32b29a807143ab2b5cf89fcb286e
Fix T42498: Disable Renaming for Read-Only Files in File Browser
===================================================================
M source/blender/editors/space_file/file_ops.c
===================================================================
diff --git a/source/blender/editors/space_file/file_ops.c
b/source/blender/editors/space_file/file_ops.c
index 27d6fab..13beba3 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;
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs