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.
This commit is contained in:
Campbell Barton
2008-04-12 15:03:47 +00:00
parent 165bfce94e
commit 0ec76c6dcf
5 changed files with 10 additions and 19 deletions

View 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)");
}
}

View 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);
/**

View 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);
}

View 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;
}

View 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);