From 0ec76c6dcf462f51d8f2a46c21dbd83870fc4eda Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 12 Apr 2008 15:03:47 +0000 Subject: removed blenders backup feature. sprintf(str, "/bin/su root -c 'cd %s; /bin/tar cf - \"%s\" | (/bin/cd %s; /bin/tar xf -)'", from, file, to); return system(str); This would ask for a password in blenders terminal, in ubuntu there is no root user... If this feature is added back it should be written in a much nicer way. Also made HKey toggle hidden files in the file selector. --- source/blender/blenkernel/intern/packedFile.c | 4 ++-- source/blender/blenlib/BLI_blenlib.h | 1 - source/blender/blenlib/intern/fileops.c | 12 ------------ source/blender/blenloader/intern/writefile.c | 2 +- source/blender/src/filesel.c | 10 +++++++--- 5 files changed, 10 insertions(+), 19 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index bd33fafe23c..4b557535606 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -320,11 +320,11 @@ int writePackedFile(char * filename, PackedFile *pf, int guimode) if (remove_tmp) { if (ret_value == RET_ERROR) { - if (BLI_rename(tempname, name) == RET_ERROR) { + if (BLI_rename(tempname, name) != 0) { if(guimode) error("Error restoring tempfile. Check files: '%s' '%s'", tempname, name); } } else { - if (BLI_delete(tempname, 0, 0) == RET_ERROR) { + if (BLI_delete(tempname, 0, 0) != 0) { if(guimode) error("Error deleting '%s' (ignored)"); } } diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index 7d401cf2fc3..75cbce3d75d 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -299,7 +299,6 @@ int BLI_exist(char *name); /* BLI_fileops.h */ void BLI_recurdir_fileops(char *dirname); int BLI_link(char *file, char *to); -int BLI_backup(char *file, char *from, char *to); int BLI_is_writable(char *filename); /** diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index b750dfbdf8f..1ac164a0f97 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -267,12 +267,6 @@ int BLI_link(char *file, char *to) { return 1; } -int BLI_backup(char *file, char *from, char *to) { - callLocalErrorCallBack("Backing up files is unsupported on Windows"); - - return 1; -} - int BLI_exists(char *file) { return (GetFileAttributes(file) != 0xFFFFFFFF); } @@ -364,12 +358,6 @@ int BLI_link(char *file, char *to) { return system(str); } -int BLI_backup(char *file, char *from, char *to) { - sprintf(str, "/bin/su root -c 'cd %s; /bin/tar cf - \"%s\" | (/bin/cd %s; /bin/tar xf -)'", from, file, to); - - return system(str); -} - int BLI_exists(char *file) { return BLI_exist(file); } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 269ea1e8e02..3161e9ad921 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2092,7 +2092,7 @@ int BLO_write_file(char *dir, int write_flags, char **error_r) } } else - if(BLI_rename(tempname, dir) < 0) { + if(BLI_rename(tempname, dir) != 0) { *error_r= "Can't change old file. File saved with @"; return 0; } diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index 31d9b95d660..cd490c562a8 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -2013,8 +2013,7 @@ void winqreadfilespace(ScrArea *sa, void *spacedata, BWinEvent *evt) if (sfile->filelist[i].flags & ACTIVE) { BLI_make_file_string(G.sce, str, sfile->dir, sfile->filelist[i].relname); - if(event==BKEY) ret= BLI_backup(sfile->filelist[i].relname, sfile->dir, otherdir); - else if(event==CKEY) ret= BLI_copy_fileops(str, otherdir); + if(event==CKEY) ret= BLI_copy_fileops(str, otherdir); else if(event==LKEY) ret= BLI_link(str, otherdir); else if(event==MKEY) ret= BLI_move(str, otherdir); @@ -2123,7 +2122,12 @@ void winqreadfilespace(ScrArea *sa, void *spacedata, BWinEvent *evt) fs_fake_users(sfile); } break; - + case HKEY: + sfile->flag ^= FILE_HIDE_DOT; + BLI_hide_dot_files(sfile->flag & FILE_HIDE_DOT); + freefilelist(sfile); + scrarea_queue_winredraw(curarea); + break; case PADPLUSKEY: case EQUALKEY: if (G.qual & LR_CTRLKEY) BLI_newname(sfile->file, +100); -- cgit v1.2.3