summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2007-08-13 23:11:30 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2007-08-13 23:11:30 +0000
commit043c966ebfea3fb04434665d7c8f1eda5937b020 (patch)
tree9069e9c4a647e505458e5238050c8d2fadd81db0 /apps/tree.c
parent62b0d4b68582be50383d6878b163ccb049cd2f93 (diff)
downloadrockbox-043c966ebfea3fb04434665d7c8f1eda5937b020.zip
rockbox-043c966ebfea3fb04434665d7c8f1eda5937b020.tar.gz
rockbox-043c966ebfea3fb04434665d7c8f1eda5937b020.tar.bz2
rockbox-043c966ebfea3fb04434665d7c8f1eda5937b020.tar.xz
Add another file extension viewing option that mimics the old behaviour and make this default. Also update Dutch lang file and manual for this.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14324 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 00f29c5..b7e196f 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -139,6 +139,7 @@ static char * tree_get_filename(int selected_item, void * data, char *buffer)
struct tree_context * local_tc=(struct tree_context *)data;
char *name;
int attr=0;
+ bool stripit = false;
#ifdef HAVE_TAGCACHE
bool id3db = *(local_tc->dirfilter) == SHOW_ID3DB;
@@ -154,11 +155,34 @@ static char * tree_get_filename(int selected_item, void * data, char *buffer)
name = e->name;
attr = e->attr;
}
- /* if it's not a directory, strip the extension if necessary */
- if((global_settings.show_filename_ext == 0) ||
- ((global_settings.show_filename_ext == 2) &&
- (filetype_supported(attr)) &&
- !(attr & ATTR_DIRECTORY)))
+
+ switch(global_settings.show_filename_ext)
+ {
+ case 0:
+ /* show file extension: off */
+ stripit = true;
+ break;
+ case 1:
+ /* show file extension: on */
+ stripit = false;
+ break;
+ case 2:
+ /* show file extension: only unknown types */
+ stripit = filetype_supported(attr);
+ break;
+ case 3:
+ default:
+ /* show file extension: only when viewing all */
+ stripit = (*(local_tc->dirfilter) != SHOW_ID3DB) &&
+ (*(local_tc->dirfilter) != SHOW_ALL);
+ break;
+ }
+
+ /* global overrule: don't strip if it's a dir */
+ if(attr & ATTR_DIRECTORY)
+ stripit = false;
+
+ if(stripit)
{
return(strip_extension(name, buffer));
}