removed blenders backup feature.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 12 Apr 2008 15:03:47 +0000 (15:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 12 Apr 2008 15:03:47 +0000 (15:03 +0000)
 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
source/blender/blenlib/BLI_blenlib.h
source/blender/blenlib/intern/fileops.c
source/blender/blenloader/intern/writefile.c
source/blender/src/filesel.c

index bd33fafe23cd6d3c20e60813a5698bdefdfa2058..4b55753560655bf238a575f091b9e92c71f08ff1 100644 (file)
@@ -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)");
                        }
                }
index 7d401cf2fc33277bfc005b6d1c4ee1fa44384273..75cbce3d75d642e055e8a6c84fbb9ec760354e17 100644 (file)
@@ -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);
 
 /**
index b750dfbdf8f5044e75093d10dd6ac32d5f99d3f3..1ac164a0f9706df7f9516fe25647662d87dba904 100644 (file)
@@ -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);
 }
index 269ea1e8e02f67fc6fa3c4590dc00176756101c5..3161e9ad92143cca58e28a5e6b8a8c51070ab16f 100644 (file)
@@ -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;
                }
index 31d9b95d66099d84158fa672ef64cde4dd09ce2e..cd490c562a80908ede11aa29d63549feeee0c825 100644 (file)
@@ -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);