From 15bc3a4f42f36b3f0bf786631c14617d93fda25a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 11 May 2012 13:12:47 +0200 Subject: [PATCH] move unique sort to eventlist.cpp Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/63cf1164956cfa84da68c9e82f9dd861c0e2acd5 Author: Jacek Jendrzej Date: 2012-05-11 (Fri, 11 May 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 80011f60a..a3ee01741 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -87,6 +87,11 @@ inline static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& return a.startTime < b.startTime; } +inline static bool sortbyEventid (const CChannelEvent& a, const CChannelEvent& b) +{ + return (a.channelID == b.channelID && a.eventID == b.eventID); +} + CNeutrinoEventList::CNeutrinoEventList() { frameBuffer = CFrameBuffer::getInstance(); @@ -1043,7 +1048,12 @@ bool CNeutrinoEventList::findEvents(void) } box.hide(); } - sort(evtlist.begin(),evtlist.end(),sortByDateTime); + if(!evtlist.empty()){ + sort(evtlist.begin(),evtlist.end(),sortByDateTime); + unique(evtlist.begin(), evtlist.end(),sortbyEventid); + evtlist.erase(unique(evtlist.begin(), evtlist.end(),sortbyEventid), evtlist.end()); + } + current_event = (unsigned int)-1; time_t azeit=time(NULL);