diff options
Diffstat (limited to 'apps/plugins/text_viewer/tv_settings.c')
-rw-r--r-- | apps/plugins/text_viewer/tv_settings.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugins/text_viewer/tv_settings.c b/apps/plugins/text_viewer/tv_settings.c index 6b16218523..428666de24 100644 --- a/apps/plugins/text_viewer/tv_settings.c +++ b/apps/plugins/text_viewer/tv_settings.c | |||
@@ -181,9 +181,9 @@ static bool tv_read_preferences(int pfd, int version, struct tv_preferences *pre | |||
181 | else | 181 | else |
182 | prefs->indent_spaces = 2; | 182 | prefs->indent_spaces = 2; |
183 | 183 | ||
184 | #ifdef HAVE_LCD_BITMAP | ||
184 | rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH); | 185 | rb->memcpy(prefs->font_name, buf + read_size - MAX_PATH, MAX_PATH); |
185 | 186 | ||
186 | #ifdef HAVE_LCD_BITMAP | ||
187 | prefs->font = rb->font_get(FONT_UI); | 187 | prefs->font = rb->font_get(FONT_UI); |
188 | #endif | 188 | #endif |
189 | 189 | ||
@@ -213,7 +213,9 @@ static bool tv_write_preferences(int pfd, const struct tv_preferences *prefs) | |||
213 | *p++ = prefs->narrow_mode; | 213 | *p++ = prefs->narrow_mode; |
214 | *p++ = prefs->indent_spaces; | 214 | *p++ = prefs->indent_spaces; |
215 | 215 | ||
216 | #ifdef HAVE_LCD_BITMAP | ||
216 | rb->memcpy(buf + 28, prefs->font_name, MAX_PATH); | 217 | rb->memcpy(buf + 28, prefs->font_name, MAX_PATH); |
218 | #endif | ||
217 | 219 | ||
218 | return (rb->write(pfd, buf, TV_PREFERENCES_SIZE) >= 0); | 220 | return (rb->write(pfd, buf, TV_PREFERENCES_SIZE) >= 0); |
219 | } | 221 | } |
@@ -457,7 +459,6 @@ static bool tv_copy_settings(int sfd, int dfd, int size) | |||
457 | 459 | ||
458 | bool tv_save_settings(void) | 460 | bool tv_save_settings(void) |
459 | { | 461 | { |
460 | const struct tv_preferences *prefs = tv_get_preferences(); | ||
461 | unsigned char buf[MAX_PATH+2]; | 462 | unsigned char buf[MAX_PATH+2]; |
462 | unsigned int fcount = 0; | 463 | unsigned int fcount = 0; |
463 | unsigned int i; | 464 | unsigned int i; |
@@ -502,7 +503,7 @@ bool tv_save_settings(void) | |||
502 | } | 503 | } |
503 | 504 | ||
504 | size = (buf[MAX_PATH] << 8) | buf[MAX_PATH + 1]; | 505 | size = (buf[MAX_PATH] << 8) | buf[MAX_PATH + 1]; |
505 | if (rb->strcmp(buf, prefs->file_name) == 0) | 506 | if (rb->strcmp(buf, preferences->file_name) == 0) |
506 | rb->lseek(ofd, size, SEEK_CUR); | 507 | rb->lseek(ofd, size, SEEK_CUR); |
507 | else | 508 | else |
508 | { | 509 | { |
@@ -522,12 +523,11 @@ bool tv_save_settings(void) | |||
522 | { | 523 | { |
523 | /* save to current read file's preferences and bookmarks */ | 524 | /* save to current read file's preferences and bookmarks */ |
524 | res = false; | 525 | res = false; |
525 | rb->memset(buf, 0, MAX_PATH); | 526 | rb->strlcpy(buf, preferences->file_name, MAX_PATH); |
526 | rb->strlcpy(buf, prefs->file_name, MAX_PATH); | ||
527 | 527 | ||
528 | if (rb->write(tfd, buf, MAX_PATH + 2) >= 0) | 528 | if (rb->write(tfd, buf, MAX_PATH + 2) >= 0) |
529 | { | 529 | { |
530 | if (tv_write_preferences(tfd, prefs)) | 530 | if (tv_write_preferences(tfd, preferences)) |
531 | { | 531 | { |
532 | size = tv_serialize_bookmarks(tfd); | 532 | size = tv_serialize_bookmarks(tfd); |
533 | if (size > 0) | 533 | if (size > 0) |