From 7398c2d20dca04e6240536546e09583159d0cc10 Mon Sep 17 00:00:00 2001 From: Alexander Levin Date: Wed, 1 Jul 2009 11:21:59 +0000 Subject: [PATCH] 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 --- apps/settings.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/settings.c b/apps/settings.c index 1d5af5678e..4616a7f49d 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -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 */