Index: rockbox/apps/filetree.c
===================================================================
--- rockbox.orig/apps/filetree.c
+++ rockbox/apps/filetree.c
@@ -41,6 +41,7 @@
 #include "dircache.h"
 #include "splash.h"
 #include "yesno.h"
+#include "ctype.h"
 #ifdef HAVE_LCD_BITMAP
 #include "keyboard.h"
 #endif
@@ -144,11 +145,32 @@ static void check_file_thumbnails(struct
     closedir_cached(dir);
 }
 
+/* If string starts with 'the', advance pointer beyond it; used by compare() */
+static void ignore_the_sort(char **name)
+{
+
+    if (strncasecmp(*name, "the", 3) == 0)
+    {
+        if (islower(*(*name + 3)) == 0)  /* Only ignore if next char isn't a lowercase (eg, "There...") */
+        {
+            if (*(*name + 3) == ' ' || (ispunct(*(*name + 3)) != 0)) /* Kill trailing space or punct */
+				*name = *name + 4;
+            else
+				*name = *name + 3;
+            }
+        }
+
+    return;
+}
+
 /* support function for qsort() */
 static int compare(const void* p1, const void* p2)
 {
     struct entry* e1 = (struct entry*)p1;
     struct entry* e2 = (struct entry*)p2;
+	char *name1 = e1->name;
+	char *name2 = e2->name;
+
     int criteria;
 
     if (e1->attr & ATTR_DIRECTORY && e2->attr & ATTR_DIRECTORY)
@@ -187,16 +209,28 @@ static int compare(const void* p1, const
             /* else fall through to alphabetical sorting */
         }
         case 0: /* sort alphabetically asc */
+		
+			if (global_settings.ignore_the){
+				/* If name starts with 'the', ignore it when sorting */
+				ignore_the_sort(&name1);
+				ignore_the_sort(&name2);
+			}
             if (global_settings.sort_case)
-                return strncmp(e1->name, e2->name, MAX_PATH);
+				return strncmp(name1, name2, MAX_PATH);
             else
-                return strncasecmp(e1->name, e2->name, MAX_PATH);
+				return strncasecmp(name1, name2, MAX_PATH);
 
         case 4: /* sort alphabetically desc */
+		
+			if (global_settings.ignore_the){
+				/* If name starts with 'the', ignore it when sorting */
+				ignore_the_sort(&name1);
+				ignore_the_sort(&name2);
+			}
             if (global_settings.sort_case)
-                return strncmp(e2->name, e1->name, MAX_PATH);
+				return strncmp(name2, name1, MAX_PATH);
             else
-                return strncasecmp(e2->name, e1->name, MAX_PATH);
+                return strncasecmp(name2, name1, MAX_PATH);
 
         case 1: /* sort date */
             return e1->time_write - e2->time_write;
Index: rockbox/apps/tagcache.c
===================================================================
--- rockbox.orig/apps/tagcache.c
+++ rockbox/apps/tagcache.c
@@ -1616,11 +1616,37 @@ static bool tempbuf_insert(char *str, in
     return true;
 }
 
+static void ignore_the_artist(char **name)
+{
+
+	if (strncasecmp(*name, "the", 3) == 0)
+	{
+		if (islower(*(*name + 3)) == 0)  /* Only ignore if next char isn't a lowercase (eg, "There...") */
+		{
+			if (*(*name + 3) == ' ' || (ispunct(*(*name + 3)) != 0)) /* Kill trailing space or punct */
+				*name = *name + 4;
+			else
+				*name = *name + 3;
+			}
+		}
+
+	return;
+}
+
 static int compare(const void *p1, const void *p2)
 {
     struct tempbuf_searchidx *e1 = (struct tempbuf_searchidx *)p1;
     struct tempbuf_searchidx *e2 = (struct tempbuf_searchidx *)p2;
     
+	char* name1=e1->str;
+	char* name2=e2->str;
+	
+	if (global_settings.ignore_the){
+		/* If name starts with 'the', ignore it when sorting */
+		ignore_the_artist(&name1);
+		ignore_the_artist(&name2);
+	}
+	
     /*
     if (!strncasecmp("the ", e1, 4))
         e1 = &e1[4];
@@ -1628,7 +1654,7 @@ static int compare(const void *p1, const
         e2 = &e2[4];
     */
     
-    return strncasecmp(e1->str, e2->str, MAX_PATH);
+    return strncasecmp(name1, name2, MAX_PATH);
 }
 
 static int tempbuf_sort(int fd)
Index: rockbox/apps/settings.c
===================================================================
--- rockbox.orig/apps/settings.c
+++ rockbox/apps/settings.c
@@ -426,6 +426,7 @@ static const struct bit_entry hd_bits[] 
 #endif
         },
     {1, S_O(sort_case), false, "sort case", off_on },
+	{1, S_O(ignore_the), false, "ignore_the", off_on },
     {1, S_O(browse_current), false, "follow playlist", off_on },
     /* playlist */
     {1, S_O(playlist_viewer_icons), true, "playlist viewer icons", off_on },
Index: rockbox/apps/settings.h
===================================================================
--- rockbox.orig/apps/settings.h
+++ rockbox/apps/settings.h
@@ -271,6 +271,7 @@ struct user_settings
     int dirfilter;     /* 0=display all, 1=only supported, 2=only music,
                           3=dirs+playlists, 4=ID3 database */
     bool sort_case;    /* dir sort order: 0=case insensitive, 1=sensitive */
+	bool ignore_the; 	/* ignore loading the : 0=dont ignore, 1=ignore */
     int volume_type;   /* how volume is displayed: 0=graphic, 1=percent */
     int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
     int timeformat;    /* time format: 0=24 hour clock, 1=12 hour clock */
Index: rockbox/apps/settings_menu.c
===================================================================
--- rockbox.orig/apps/settings_menu.c
+++ rockbox/apps/settings_menu.c
@@ -776,6 +776,11 @@ static bool sort_case(void)
     return set_bool( str(LANG_SORT_CASE), &global_settings.sort_case );
 }
 
+static bool ignore_the(void)
+{
+	return set_bool( str(LANG_IGNORE_THE), &global_settings.ignore_the );
+}
+
 static bool sort_file(void)
 {
     int oldval = global_settings.sort_file;
@@ -1867,6 +1872,7 @@ static bool fileview_settings_menu(void)
         { ID2P(LANG_SORT_CASE),             sort_case             },
         { ID2P(LANG_SORT_DIR),              sort_dir              },
         { ID2P(LANG_SORT_FILE),             sort_file             },
+		{ ID2P(LANG_IGNORE_THE),            ignore_the            },
         { ID2P(LANG_FILTER),                dir_filter            },
         { ID2P(LANG_FOLLOW),                browse_current        },
         { ID2P(LANG_SHOW_ICONS),            show_icons            },
Index: rockbox/apps/lang/english.lang
===================================================================
--- rockbox.orig/apps/lang/english.lang
+++ rockbox/apps/lang/english.lang
@@ -1788,6 +1788,20 @@
   </voice>
 </phrase>
 <phrase>
+  id: LANG_IGNORE_THE
+  desc: in settings_menu
+  user:
+  <source>
+    *: "Ignore leading 'The' for sorting"
+  </source>
+  <dest>
+    *: "Ignore leading 'The' for sorting"
+  </dest>
+  <voice>
+    *: "Ignore leading 'The' for sorting"
+  </voice>
+</phrase>
+<phrase>
   id: LANG_SORT_DIR
   desc: browser sorting setting
   user:
