summaryrefslogtreecommitdiff
path: root/apps/plugins/text_viewer/tv_preferences.c
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2010-12-14 21:33:45 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2010-12-14 21:33:45 +0000
commit990cbf302eb04f80174c50040492fa7db6fbad6d (patch)
tree8a0340d9aeb299a954aa63bb1895a23cebfbe1d9 /apps/plugins/text_viewer/tv_preferences.c
parentee4ea4266b2eae7a78680a722054a68a83840ec5 (diff)
downloadrockbox-990cbf302eb04f80174c50040492fa7db6fbad6d.tar.gz
rockbox-990cbf302eb04f80174c50040492fa7db6fbad6d.zip
Commit FS#11799 by Alexander Meshcheryakov. Improves the text viewer plugin to write to the disk less often, and correct several minor bugs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28833 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/text_viewer/tv_preferences.c')
-rw-r--r--apps/plugins/text_viewer/tv_preferences.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/plugins/text_viewer/tv_preferences.c b/apps/plugins/text_viewer/tv_preferences.c
index 5e6677ea58..6d5c1127fc 100644
--- a/apps/plugins/text_viewer/tv_preferences.c
+++ b/apps/plugins/text_viewer/tv_preferences.c
@@ -28,6 +28,8 @@ static struct tv_preferences prefs;
28/* read-only preferences pointer, for access by other files */ 28/* read-only preferences pointer, for access by other files */
29const struct tv_preferences * const preferences = &prefs; 29const struct tv_preferences * const preferences = &prefs;
30 30
31bool preferences_changed = false;
32
31static int listner_count = 0; 33static int listner_count = 0;
32 34
33#define TV_MAX_LISTNERS 5 35#define TV_MAX_LISTNERS 5
@@ -91,6 +93,11 @@ void tv_copy_preferences(struct tv_preferences *copy_prefs)
91 rb->memcpy(copy_prefs, preferences, sizeof(struct tv_preferences)); 93 rb->memcpy(copy_prefs, preferences, sizeof(struct tv_preferences));
92} 94}
93 95
96bool tv_compare_preferences(struct tv_preferences *copy_prefs)
97{
98 return rb->memcmp(copy_prefs, preferences, sizeof(struct tv_preferences)) != 0;
99}
100
94void tv_set_default_preferences(struct tv_preferences *p) 101void tv_set_default_preferences(struct tv_preferences *p)
95{ 102{
96 p->word_mode = WM_WRAP; 103 p->word_mode = WM_WRAP;