1
0
Fork 0
forked from len0rd/rockbox

ok, redo that last commit.. always write /.rockbox/oldconfig.cfg when you load a new config or reset settings

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16793 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2008-03-25 10:38:55 +00:00
parent 9ed5a67b69
commit 58ee0fbd69
3 changed files with 5 additions and 6 deletions

View file

@ -68,7 +68,6 @@ static int reset_settings(void)
switch(gui_syncyesno_run(&message, &yes_message, &no_message))
{
case YESNO_YES:
settings_write_config(CONFIGFILE ".bak", SETTINGS_SAVE_CHANGED);
settings_reset();
settings_apply(true);
settings_save();

View file

@ -262,6 +262,7 @@ static bool cfg_string_to_int(int setting_id, int* out, char* str)
}
return false;
}
static bool settings_write_config(char* filename, int options);
bool settings_load_config(const char* file, bool apply)
{
@ -273,6 +274,7 @@ bool settings_load_config(const char* file, bool apply)
fd = open(file, O_RDONLY);
if (fd < 0)
return false;
settings_write_config(ROCKBOX_DIR "oldcfg.cfg", SETTINGS_SAVE_CHANGED);
while (read_line(fd, line, sizeof line) > 0)
{
@ -450,7 +452,7 @@ static bool is_changed(int setting_id)
return true;
}
bool settings_write_config(char* filename, int options)
static bool settings_write_config(char* filename, int options)
{
int i;
int fd;
@ -949,7 +951,7 @@ void settings_reset(void) {
int i;
DEBUGF( "settings_reset()\n" );
settings_write_config(ROCKBOX_DIR "oldcfg.cfg", SETTINGS_SAVE_CHANGED);
for(i=0; i<nb_settings; i++)
{
switch (settings[i].flags&F_T_MASK)

View file

@ -200,7 +200,6 @@ bool settings_load_config(const char* file, bool apply);
void status_save( void );
int settings_save(void);
/* defines for the options paramater */
enum {
SETTINGS_SAVE_CHANGED = 0,
@ -215,7 +214,6 @@ enum {
#endif
};
bool settings_save_config(int options);
bool settings_write_config(char* filename, int options);
void settings_reset(void);
void sound_settings_apply(void);