Provide a context sensitive default file name when saving settings (FS#10399)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21589 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Alexander Levin 2009-07-01 11:21:59 +00:00
parent a85f3695ef
commit 7398c2d20d

View file

@ -620,27 +620,35 @@ int settings_save(void)
bool settings_save_config(int options)
{
char filename[MAX_PATH];
char *folder;
char *folder, *namebase;
switch (options)
{
case SETTINGS_SAVE_THEME:
folder = THEME_DIR;
namebase = "theme";
break;
#ifdef HAVE_RECORDING
case SETTINGS_SAVE_RECPRESETS:
folder = RECPRESETS_DIR;
namebase = "recording";
break;
#endif
#if CONFIG_CODEC == SWCODEC
case SETTINGS_SAVE_EQPRESET:
folder = EQS_DIR;
namebase = "eq";
break;
#endif
case SETTINGS_SAVE_SOUND:
folder = ROCKBOX_DIR;
namebase = "sound";
break;
default:
folder = ROCKBOX_DIR;
namebase = "config";
break;
}
create_numbered_filename(filename, folder, "config", ".cfg", 2
create_numbered_filename(filename, folder, namebase, ".cfg", 2
IF_CNFN_NUM_(, NULL));
/* allow user to modify filename */