summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2011-04-30 11:00:26 +0000
committerMagnus Holmgren <magnushol@gmail.com>2011-04-30 11:00:26 +0000
commited2cfb8c1d2215fc6ac287dbf03bbd2847ec3ef3 (patch)
tree6e6239b3151cf14a6432941a5957e1452e1fc3a0
parent16e793f5d1d626e6506f2b172efa03f46fb0ed39 (diff)
downloadrockbox-ed2cfb8c1d2215fc6ac287dbf03bbd2847ec3ef3.tar.gz
rockbox-ed2cfb8c1d2215fc6ac287dbf03bbd2847ec3ef3.zip
Don't (partially) apply changes to max entries in the file browser immediately. The setting affects a buffer that is allocated during boot, so code using that buffer should use the value that was in effect during boot. Add a note to the manual that a reboot is needed for the changes to be applied.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29798 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/filetree.c2
-rw-r--r--apps/tagtree.c2
-rw-r--r--apps/tree.c15
-rw-r--r--apps/tree.h2
-rw-r--r--manual/configure_rockbox/system_options.tex5
5 files changed, 12 insertions, 14 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index 96fcc8a1e7..eaaee9644d 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -285,7 +285,7 @@ int ft_load(struct tree_context* c, const char* tempdir)
285 c->dirsindir = 0; 285 c->dirsindir = 0;
286 c->dirfull = false; 286 c->dirfull = false;
287 287
288 for ( i=0; i < global_settings.max_files_in_dir; i++ ) { 288 for ( i=0; i < c->dircache_count; i++ ) {
289 int len; 289 int len;
290 struct dirent *entry = readdir(dir); 290 struct dirent *entry = readdir(dir);
291 struct dirinfo info; 291 struct dirinfo info;
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 575ab221ac..2a2e2b805b 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -1288,7 +1288,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
1288 dptr++; 1288 dptr++;
1289 current_entry_count++; 1289 current_entry_count++;
1290 1290
1291 if (current_entry_count >= global_settings.max_files_in_dir) 1291 if (current_entry_count >= c->dircache_count)
1292 { 1292 {
1293 logf("chunk mode #3: %d", current_entry_count); 1293 logf("chunk mode #3: %d", current_entry_count);
1294 c->dirfull = true; 1294 c->dirfull = true;
diff --git a/apps/tree.c b/apps/tree.c
index d87a93e2a0..44c4b92883 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -95,7 +95,6 @@ static char lastdir[MAX_PATH];
95#ifdef HAVE_TAGCACHE 95#ifdef HAVE_TAGCACHE
96static int lasttable, lastextra, lastfirstpos; 96static int lasttable, lastextra, lastfirstpos;
97#endif 97#endif
98static int max_files = 0;
99 98
100static bool reload_dir = false; 99static bool reload_dir = false;
101 100
@@ -391,7 +390,7 @@ static int update_dir(void)
391#ifdef HAVE_TAGCACHE 390#ifdef HAVE_TAGCACHE
392 !id3db && 391 !id3db &&
393#endif 392#endif
394 (tc.dirfull || tc.filesindir == global_settings.max_files_in_dir) ) 393 (tc.dirfull || tc.filesindir == tc.dircache_count) )
395 { 394 {
396 splash(HZ, ID2P(LANG_SHOWDIR_BUFFER_FULL)); 395 splash(HZ, ID2P(LANG_SHOWDIR_BUFFER_FULL));
397 } 396 }
@@ -1005,20 +1004,18 @@ int rockbox_browse(struct browse_context *browse)
1005 1004
1006void tree_mem_init(void) 1005void tree_mem_init(void)
1007{ 1006{
1008 /* We copy the settings value in case it is changed by the user. We can't
1009 use it until the next reboot. */
1010 max_files = global_settings.max_files_in_dir;
1011
1012 /* initialize tree context struct */ 1007 /* initialize tree context struct */
1013 memset(&tc, 0, sizeof(tc)); 1008 memset(&tc, 0, sizeof(tc));
1014 tc.dirfilter = &global_settings.dirfilter; 1009 tc.dirfilter = &global_settings.dirfilter;
1015 tc.sort_dir = global_settings.sort_dir; 1010 tc.sort_dir = global_settings.sort_dir;
1016 1011
1017 tc.name_buffer_size = AVERAGE_FILENAME_LENGTH * max_files; 1012 tc.name_buffer_size = AVERAGE_FILENAME_LENGTH *
1013 global_settings.max_files_in_dir;
1018 tc.name_buffer = buffer_alloc(tc.name_buffer_size); 1014 tc.name_buffer = buffer_alloc(tc.name_buffer_size);
1019 1015
1020 tc.dircache_size = max_files * sizeof(struct entry); 1016 tc.dircache_count = global_settings.max_files_in_dir;
1021 tc.dircache = buffer_alloc(tc.dircache_size); 1017 tc.dircache = buffer_alloc(global_settings.max_files_in_dir *
1018 sizeof(struct entry));
1022 tree_get_filetypes(&filetypes, &filetypes_count); 1019 tree_get_filetypes(&filetypes, &filetypes_count);
1023} 1020}
1024 1021
diff --git a/apps/tree.h b/apps/tree.h
index 7275c9ae94..104d6c480a 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -84,7 +84,7 @@ struct tree_context {
84 * contains all files and dirs in the current 84 * contains all files and dirs in the current
85 * dir (with filters applied) */ 85 * dir (with filters applied) */
86 void* dircache; 86 void* dircache;
87 int dircache_size; 87 int dircache_count; /* Number of entries in dircache */
88 char* name_buffer; 88 char* name_buffer;
89 int name_buffer_size; 89 int name_buffer_size;
90 int dentry_size; 90 int dentry_size;
diff --git a/manual/configure_rockbox/system_options.tex b/manual/configure_rockbox/system_options.tex
index f6854e49f1..9a0c58cf6f 100644
--- a/manual/configure_rockbox/system_options.tex
+++ b/manual/configure_rockbox/system_options.tex
@@ -129,7 +129,7 @@ Settings are either \setting{Off} or 1 to 10 minutes in 1 minute steps. Then
129This sub menu relates to limits in the Rockbox operating system. 129This sub menu relates to limits in the Rockbox operating system.
130 \begin{description} 130 \begin{description}
131 \item [Max Entries in File Browser.] This setting controls the limit on 131 \item [Max Entries in File Browser.] This setting controls the limit on
132 the number of files that you can put in any particular directory in the 132 the number of files that you can see in any particular directory in the
133 file browser. You can configure the size to be between 50 and 133 file browser. You can configure the size to be between 50 and
134 10,000 files in steps of 50. The default is 400. Higher values will shorten 134 10,000 files in steps of 50. The default is 400. Higher values will shorten
135 the music buffer, so you should increase this setting \emph{only} if you have 135 the music buffer, so you should increase this setting \emph{only} if you have
@@ -141,7 +141,8 @@ This sub menu relates to limits in the Rockbox operating system.
141 music buffer, so you should increase this setting \emph{only} if you 141 music buffer, so you should increase this setting \emph{only} if you
142 have very large playlists. 142 have very large playlists.
143 \end{description} 143 \end{description}
144 144 \note{You will need to restart your player for changes to these options
145 to take effect.}
145% TODO: this needs to be rewritten in another style, it lets you mix sound from another source into the music 146% TODO: this needs to be rewritten in another style, it lets you mix sound from another source into the music
146\opt{player}{ 147\opt{player}{
147 \subsection{Line In} This option activates the line-in port on \dap, which is 148 \subsection{Line In} This option activates the line-in port on \dap, which is