diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-03-01 17:55:59 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-03-01 17:55:59 +0000 |
commit | d13f1a485f0e35a6fbbd0a664f14acc3798d52a0 (patch) | |
tree | 22cacb27b6ab481c0bfc250120dde404320811f2 /apps/settings_list.c | |
parent | e6c023cb64dea599bb711b2b4ddb197efdb1d187 (diff) |
Commit FS#8314. This adds strnat[case]cmp written by Martin Pool, which respects numbers within strings, and gives a more intuitive
sorting. This also adds a setting, so that the sorting can be used in the file browser. The implementation is very generic, and can possibly
be used in other places.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20155 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_list.c')
-rw-r--r-- | apps/settings_list.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c index 97ca7cdca5..5729cdcf4a 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -783,7 +783,20 @@ const struct settings_list settings[] = { "all,supported,music,playlists", NULL, 4, ID2P(LANG_ALL), ID2P(LANG_FILTER_SUPPORTED), ID2P(LANG_FILTER_MUSIC), ID2P(LANG_PLAYLISTS)), + /* file sorting */ OFFON_SETTING(0, sort_case, LANG_SORT_CASE, false, "sort case", NULL), + CHOICE_SETTING(0, sort_dir, LANG_SORT_DIR, 0 , + "sort dirs", "alpha,oldest,newest", NULL, 3, + ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE), + ID2P(LANG_SORT_DATE_REVERSE)), + CHOICE_SETTING(0, sort_file, LANG_SORT_FILE, 0 , + "sort files", "alpha,oldest,newest,type", NULL, 4, + ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE), + ID2P(LANG_SORT_DATE_REVERSE) , ID2P(LANG_SORT_TYPE)), + CHOICE_SETTING(0, interpret_numbers, LANG_SORT_INTERPRET_NUMBERS, 1, + "sort interpret number", "digits,numbers",NULL, 2, + ID2P(LANG_SORT_INTERPRET_AS_DIGIT), + ID2P(LANG_SORT_INTERPRET_AS_NUMBERS)), CHOICE_SETTING(0, show_filename_ext, LANG_SHOW_FILENAME_EXT, 3, "show filename exts", "off,on,unknown,view_all", NULL , 4 , ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_UNKNOWN_TYPES), @@ -893,16 +906,6 @@ const struct settings_list settings[] = { OFFON_SETTING(F_TEMPVAR, talk_battery_level, LANG_TALK_BATTERY_LEVEL, false, "Announce Battery Level", NULL), - /* file sorting */ - CHOICE_SETTING(0, sort_file, LANG_SORT_FILE, 0 , - "sort files", "alpha,oldest,newest,type", NULL, 4, - ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE), - ID2P(LANG_SORT_DATE_REVERSE) , ID2P(LANG_SORT_TYPE)), - CHOICE_SETTING(0, sort_dir, LANG_SORT_DIR, 0 , - "sort dirs", "alpha,oldest,newest", NULL, 3, - ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE), - ID2P(LANG_SORT_DATE_REVERSE)), - #ifdef HAVE_RECORDING /* recording */ STRINGCHOICE_SETTING(F_RECSETTING, rec_timesplit, LANG_SPLIT_TIME, 0, |