summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_backdrops.c14
-rw-r--r--apps/onplay.c15
-rw-r--r--apps/settings.h2
-rw-r--r--apps/settings_list.c2
4 files changed, 10 insertions, 23 deletions
diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c
index 3e04beaae0..12950a666c 100644
--- a/apps/gui/skin_engine/skin_backdrops.c
+++ b/apps/gui/skin_engine/skin_backdrops.c
@@ -113,10 +113,7 @@ bool skin_backdrops_preload(void)
if (screen == SCREEN_MAIN && global_settings.backdrop_file[0] &&
global_settings.backdrop_file[0] != '-' && filename[0] == '-')
{
- char* temp = filename+2; /* slightly hacky to get a buffer */
- size_t size = sizeof(backdrops[i].name) - 2;
- snprintf(temp, size, BACKDROP_DIR "/%s.bmp", global_settings.backdrop_file);
- filename = temp;
+ filename = global_settings.backdrop_file;
}
if (*filename && *filename != '-')
{
@@ -156,7 +153,6 @@ void skin_backdrop_unload(int backdrop_id)
void skin_backdrop_load_setting(void)
{
int i;
- char filename[MAX_PATH];
for(i=0;i<SKINNABLE_SCREENS_COUNT*NB_SCREENS;i++)
{
if (backdrops[i].name[0] == '-' && backdrops[i].screen == SCREEN_MAIN)
@@ -166,11 +162,11 @@ void skin_backdrop_load_setting(void)
{
if (!backdrops[i].buffer)
backdrops[i].buffer = (char*)skin_buffer_alloc(LCD_BACKDROP_BYTES);
- snprintf(filename, sizeof filename, BACKDROP_DIR "/%s.bmp",
- global_settings.backdrop_file);
+
bool loaded = backdrops[i].buffer &&
- screens[SCREEN_MAIN].backdrop_load(filename,
- backdrops[i].buffer);
+ screens[SCREEN_MAIN].backdrop_load(
+ global_settings.backdrop_file,
+ backdrops[i].buffer);
backdrops[i].name[2] = loaded ? '.' : '\0';
return;
}
diff --git a/apps/onplay.c b/apps/onplay.c
index 2411952acf..a2a3671d3e 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -1017,18 +1017,9 @@ MENUITEM_FUNCTION(add_to_faves_item, MENU_FUNC_USEPARAM, ID2P(LANG_ADD_TO_FAVES)
#if LCD_DEPTH > 1
static bool set_backdrop(void)
{
- /* load the image
- if(sb_set_backdrop(SCREEN_MAIN, selected_file)) {
- splash(HZ, str(LANG_BACKDROP_LOADED));
- set_file(selected_file, (char *)global_settings.backdrop_file,
- MAX_FILENAME);
- return true;
- } else {
- splash(HZ, str(LANG_BACKDROP_FAILED));
- return false;
- }*/
- set_file(selected_file, (char *)global_settings.backdrop_file,
- MAX_FILENAME);
+ strlcpy(global_settings.backdrop_file, selected_file,
+ sizeof(global_settings.backdrop_file));
+ settings_save();
skin_backdrop_load_setting();
return true;
}
diff --git a/apps/settings.h b/apps/settings.h
index 0734cf0668..7dca65ad9a 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -588,7 +588,7 @@ struct user_settings
#endif /* HAVE_TAGCACHE */
#if LCD_DEPTH > 1
- unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */
+ unsigned char backdrop_file[MAX_PATHNAME+1]; /* backdrop bitmap file */
#endif
#ifdef HAVE_LCD_COLOR
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 7f2cf38072..bd4a473389 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -1587,7 +1587,7 @@ const struct settings_list settings[] = {
TEXT_SETTING(0,lang_file,"lang","",LANG_DIR "/",".lng"),
#if LCD_DEPTH > 1
TEXT_SETTING(F_THEMESETTING,backdrop_file,"backdrop",
- DEFAULT_BACKDROP, BACKDROP_DIR "/", ".bmp"),
+ DEFAULT_BACKDROP, NULL, NULL),
#endif
#ifdef HAVE_LCD_BITMAP
TEXT_SETTING(0,kbd_file,"kbd","-",ROCKBOX_DIR "/",".kbd"),