diff options
author | Christian Wieninger <cwieninger@gmx.de> | 2012-01-08 20:39:07 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger@gmx.de> | 2012-01-08 20:39:07 +0100 |
commit | 50828c595b4967074a9e0e3cef8cef1b64c9d2e1 (patch) | |
tree | 969e6674a88b9bb835192107cad593154e6e7a06 /epgsearchext.c | |
parent | eedb728f5e2f48607a739d15d3ba1053728684ab (diff) | |
download | vdr-plugin-epgsearch-50828c595b4967074a9e0e3cef8cef1b64c9d2e1.tar.gz vdr-plugin-epgsearch-50828c595b4967074a9e0e3cef8cef1b64c9d2e1.tar.bz2 |
sort search timers by timer priority and search term
Diffstat (limited to 'epgsearchext.c')
-rw-r--r-- | epgsearchext.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/epgsearchext.c b/epgsearchext.c index 8f71241..ba58b3b 100644 --- a/epgsearchext.c +++ b/epgsearchext.c @@ -1663,6 +1663,25 @@ bool cSearchExts::CheckForAutoDelete(cSearchExt* SearchExt) return delSearch; } +void cSearchExts::SortBy(int(*compar)(const void *, const void *)) +{ + int n = Count(); + cListObject *a[n]; + cListObject *object = objects; + int i = 0; + while (object && i < n) { + a[i++] = object; + object = object->Next(); + } + qsort(a, n, sizeof(cListObject *), compar); + objects = lastObject = NULL; + for (i = 0; i < n; i++) { + a[i]->Unlink(); + count--; + Add(a[i]); + } +} + cSearchResult::cSearchResult(const cEvent* Event, int searchID) : event(Event), blacklist(NULL), needsTimer(true) { search = SearchExts.GetSearchFromID(searchID); |