From 0b476f75f1eda25a7a3a7abdeaab8155cc3138c2 Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Fri, 9 Apr 2010 06:26:33 +0000 Subject: Text viewer: When loading settings and prefs font loading fails, not only refert to the global settings font, but also set the viewer prefs font to that font, so that when the user re-opens the viewer no warning will appear again, and also so that when the user selects new font, the currenly used font will be selected git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25550 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/viewer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 519c8a23dc..271ca37630 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -2186,8 +2186,12 @@ read_end: /* load prefs font if it is different than the global settings font */ if (rb->strcmp(prefs.font, rb->global_settings->font_file)) { if (!change_font(prefs.font)) { - /* fallback by re-loading the global settings font */ - if (!change_font(rb->global_settings->font_file)) + /* fallback by resetting prefs font to the global settings font */ + rb->memset(prefs.font, 0, MAX_PATH); + rb->snprintf(prefs.font, MAX_PATH, "%s", + rb->global_settings->font_file); + + if (!change_font(prefs.font)) return false; } } -- cgit v1.2.3