diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-03-25 10:38:55 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-03-25 10:38:55 +0000 |
| commit | 58ee0fbd6940cd3a03d027c5e81b7850ef00a960 (patch) | |
| tree | d6360537230b5e1af62002e1a46b99a2cd040e2b /apps/settings.c | |
| parent | 9ed5a67b698061d79554ad91b9a8b77a49092261 (diff) | |
| download | rockbox-58ee0fbd6940cd3a03d027c5e81b7850ef00a960.zip rockbox-58ee0fbd6940cd3a03d027c5e81b7850ef00a960.tar.gz rockbox-58ee0fbd6940cd3a03d027c5e81b7850ef00a960.tar.bz2 rockbox-58ee0fbd6940cd3a03d027c5e81b7850ef00a960.tar.xz | |
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
Diffstat (limited to 'apps/settings.c')
| -rw-r--r-- | apps/settings.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/settings.c b/apps/settings.c index 237ff1c..d259cec 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -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,7 +274,8 @@ 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) { if (!settings_parseline(line, &name, &value)) @@ -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) |