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:
authorAndrea Weikert <elubie@gmx.net>2009-07-26 22:52:27 +0400
committerAndrea Weikert <elubie@gmx.net>2009-07-26 22:52:27 +0400
commitcbb9dfaab80ed52950a4ea4c1570370eddacfa64 (patch)
tree3df161c74b8d43634bfb032f2ada65d6496b3cad /source/blender/blenlib
parent4741137fc9639a3902a0a7bbbebb7256841ac027 (diff)
2.5 file browser
* operator for create new directory activated (IKEY) * operator for rename (works on files and directories so far) (CTRL+LMB) Note: fail to rename is rather quiet, no message popup, just doesn't rename if it can't. So far checked that (On Windows Vista) rename fails on system directories, which I think acceptable. Note: I removed the code that (silently) deletes file if I rename file to an existing one. Considered harmful :)
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_storage_types.h1
-rw-r--r--source/blender/blenlib/intern/fileops.c13
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_storage_types.h b/source/blender/blenlib/BLI_storage_types.h
index cdc85d1be39..36d96f6075c 100644
--- a/source/blender/blenlib/BLI_storage_types.h
+++ b/source/blender/blenlib/BLI_storage_types.h
@@ -77,7 +77,6 @@ struct direntry{
#define SELECT 1
#define HIDDEN 1
#define FIRST 1
-#define ACTIVE 2
#define DESELECT 0
#define NOT_YET 0
#define VISIBLE 0
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 42fd75a543e..b9c0dd65ede 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -311,10 +311,10 @@ void BLI_recurdir_fileops(char *dirname) {
int BLI_rename(char *from, char *to) {
if (!BLI_exists(from)) return 0;
- /* make sure the filenames are different (case insensitive) before removing */
- if (BLI_exists(to) && BLI_strcasecmp(from, to))
- if(BLI_delete(to, 0, 0)) return 1;
-
+ /* refuse to rename if file already exists */
+ if (BLI_exists(to))
+ return 1;
+
return rename(from, to);
}
@@ -391,8 +391,9 @@ void BLI_recurdir_fileops(char *dirname) {
int BLI_rename(char *from, char *to) {
if (!BLI_exists(from)) return 0;
- if (BLI_exists(to)) if(BLI_delete(to, 0, 0)) return 1;
-
+ /* refuse to rename if file already exists */
+ if (BLI_exists(to)) return 1;
+
return rename(from, to);
}