From 01be0f47d4fcfce954f77a037f8ab4d5368c8fe7 Mon Sep 17 00:00:00 2001 From: Martin Prochnow Date: Mon, 4 Dec 2006 11:35:54 +0100 Subject: Version 0.12b - type of sorting (ascending/descending) selectable at the setup menu of the plugin - 'Blue' also closes the info menu for a recording --- tools.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'tools.c') diff --git a/tools.c b/tools.c index a21f6b6..d57bcb7 100644 --- a/tools.c +++ b/tools.c @@ -162,9 +162,18 @@ char *myRecListItem::StripEpisodeName(char *s) } t++; } - *s1=255; + if(mysetup.DescendSorting) + { + if(SortByName) + *s1=1; + else + *(s2+1)=255; + } + else + *s1=255; + if(s1&&s2&&!SortByName) - memmove(s1+1,s2,t-s2+1); + memmove(s1+1,s2,t-s2+1); return s; } @@ -176,7 +185,11 @@ int myRecListItem::Compare(const cListObject &ListObject)const char *s1=StripEpisodeName(strdup(filename+strlen(VideoDirectory))); char *s2=StripEpisodeName(strdup(item->filename+strlen(VideoDirectory))); - int compare=strcasecmp(s1,s2); + int compare; + if(mysetup.DescendSorting) + compare=strcasecmp(s2,s1); + else + compare=strcasecmp(s1,s2); free(s1); free(s2); -- cgit v1.2.3