summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
c->dirsindir = 0;
c->dirfull = false;
- for ( i=0; i < global_settings.max_files_in_dir; i++ ) {
+ for ( i=0; i < c->dircache_count; i++ ) {
int len;
struct dirent *entry = readdir(dir);
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)
dptr++;
current_entry_count++;
- if (current_entry_count >= global_settings.max_files_in_dir)
+ if (current_entry_count >= c->dircache_count)
{
logf("chunk mode #3: %d", current_entry_count);
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];
#ifdef HAVE_TAGCACHE
static int lasttable, lastextra, lastfirstpos;
#endif
-static int max_files = 0;
static bool reload_dir = false;
@@ -391,7 +390,7 @@ static int update_dir(void)
#ifdef HAVE_TAGCACHE
!id3db &&
#endif
- (tc.dirfull || tc.filesindir == global_settings.max_files_in_dir) )
+ (tc.dirfull || tc.filesindir == tc.dircache_count) )
{
splash(HZ, ID2P(LANG_SHOWDIR_BUFFER_FULL));
}
@@ -1005,20 +1004,18 @@ int rockbox_browse(struct browse_context *browse)
void tree_mem_init(void)
{
- /* We copy the settings value in case it is changed by the user. We can't
- use it until the next reboot. */
- max_files = global_settings.max_files_in_dir;
-
/* initialize tree context struct */
memset(&tc, 0, sizeof(tc));
tc.dirfilter = &global_settings.dirfilter;
tc.sort_dir = global_settings.sort_dir;
- tc.name_buffer_size = AVERAGE_FILENAME_LENGTH * max_files;
+ tc.name_buffer_size = AVERAGE_FILENAME_LENGTH *
+ global_settings.max_files_in_dir;
tc.name_buffer = buffer_alloc(tc.name_buffer_size);
- tc.dircache_size = max_files * sizeof(struct entry);
- tc.dircache = buffer_alloc(tc.dircache_size);
+ tc.dircache_count = global_settings.max_files_in_dir;
+ tc.dircache = buffer_alloc(global_settings.max_files_in_dir *
+ sizeof(struct entry));
tree_get_filetypes(&filetypes, &filetypes_count);
}
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 {
* contains all files and dirs in the current
* dir (with filters applied) */
void* dircache;
- int dircache_size;
+ int dircache_count; /* Number of entries in dircache */
char* name_buffer;
int name_buffer_size;
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
This sub menu relates to limits in the Rockbox operating system.
\begin{description}
\item [Max Entries in File Browser.] This setting controls the limit on
- the number of files that you can put in any particular directory in the
+ the number of files that you can see in any particular directory in the
file browser. You can configure the size to be between 50 and
10,000 files in steps of 50. The default is 400. Higher values will shorten
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.
music buffer, so you should increase this setting \emph{only} if you
have very large playlists.
\end{description}
-
+ \note{You will need to restart your player for changes to these options
+ to take effect.}
% TODO: this needs to be rewritten in another style, it lets you mix sound from another source into the music
\opt{player}{
\subsection{Line In} This option activates the line-in port on \dap, which is