mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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
This commit is contained in:
parent
16e793f5d1
commit
ed2cfb8c1d
5 changed files with 12 additions and 14 deletions
|
@ -285,7 +285,7 @@ int ft_load(struct tree_context* c, const char* tempdir)
|
||||||
c->dirsindir = 0;
|
c->dirsindir = 0;
|
||||||
c->dirfull = false;
|
c->dirfull = false;
|
||||||
|
|
||||||
for ( i=0; i < global_settings.max_files_in_dir; i++ ) {
|
for ( i=0; i < c->dircache_count; i++ ) {
|
||||||
int len;
|
int len;
|
||||||
struct dirent *entry = readdir(dir);
|
struct dirent *entry = readdir(dir);
|
||||||
struct dirinfo info;
|
struct dirinfo info;
|
||||||
|
|
|
@ -1288,7 +1288,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
|
||||||
dptr++;
|
dptr++;
|
||||||
current_entry_count++;
|
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);
|
logf("chunk mode #3: %d", current_entry_count);
|
||||||
c->dirfull = true;
|
c->dirfull = true;
|
||||||
|
|
15
apps/tree.c
15
apps/tree.c
|
@ -95,7 +95,6 @@ static char lastdir[MAX_PATH];
|
||||||
#ifdef HAVE_TAGCACHE
|
#ifdef HAVE_TAGCACHE
|
||||||
static int lasttable, lastextra, lastfirstpos;
|
static int lasttable, lastextra, lastfirstpos;
|
||||||
#endif
|
#endif
|
||||||
static int max_files = 0;
|
|
||||||
|
|
||||||
static bool reload_dir = false;
|
static bool reload_dir = false;
|
||||||
|
|
||||||
|
@ -391,7 +390,7 @@ static int update_dir(void)
|
||||||
#ifdef HAVE_TAGCACHE
|
#ifdef HAVE_TAGCACHE
|
||||||
!id3db &&
|
!id3db &&
|
||||||
#endif
|
#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));
|
splash(HZ, ID2P(LANG_SHOWDIR_BUFFER_FULL));
|
||||||
}
|
}
|
||||||
|
@ -1005,20 +1004,18 @@ int rockbox_browse(struct browse_context *browse)
|
||||||
|
|
||||||
void tree_mem_init(void)
|
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 */
|
/* initialize tree context struct */
|
||||||
memset(&tc, 0, sizeof(tc));
|
memset(&tc, 0, sizeof(tc));
|
||||||
tc.dirfilter = &global_settings.dirfilter;
|
tc.dirfilter = &global_settings.dirfilter;
|
||||||
tc.sort_dir = global_settings.sort_dir;
|
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.name_buffer = buffer_alloc(tc.name_buffer_size);
|
||||||
|
|
||||||
tc.dircache_size = max_files * sizeof(struct entry);
|
tc.dircache_count = global_settings.max_files_in_dir;
|
||||||
tc.dircache = buffer_alloc(tc.dircache_size);
|
tc.dircache = buffer_alloc(global_settings.max_files_in_dir *
|
||||||
|
sizeof(struct entry));
|
||||||
tree_get_filetypes(&filetypes, &filetypes_count);
|
tree_get_filetypes(&filetypes, &filetypes_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ struct tree_context {
|
||||||
* contains all files and dirs in the current
|
* contains all files and dirs in the current
|
||||||
* dir (with filters applied) */
|
* dir (with filters applied) */
|
||||||
void* dircache;
|
void* dircache;
|
||||||
int dircache_size;
|
int dircache_count; /* Number of entries in dircache */
|
||||||
char* name_buffer;
|
char* name_buffer;
|
||||||
int name_buffer_size;
|
int name_buffer_size;
|
||||||
int dentry_size;
|
int dentry_size;
|
||||||
|
|
|
@ -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.
|
This sub menu relates to limits in the Rockbox operating system.
|
||||||
\begin{description}
|
\begin{description}
|
||||||
\item [Max Entries in File Browser.] This setting controls the limit on
|
\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
|
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
|
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
|
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
|
music buffer, so you should increase this setting \emph{only} if you
|
||||||
have very large playlists.
|
have very large playlists.
|
||||||
\end{description}
|
\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
|
% TODO: this needs to be rewritten in another style, it lets you mix sound from another source into the music
|
||||||
\opt{player}{
|
\opt{player}{
|
||||||
\subsection{Line In} This option activates the line-in port on \dap, which is
|
\subsection{Line In} This option activates the line-in port on \dap, which is
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue