summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-02-21 13:56:20 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-02-21 13:56:20 +0100
commit340d9bcb0fdf49fbe2740dde29af37f46887c122 (patch)
tree6774816a56d54487b98faa344d131ef939a8f12e /epg.c
parent15e6b261bac16b37b0cedb4bd634d7e9b1af887d (diff)
downloadvdr-340d9bcb0fdf49fbe2740dde29af37f46887c122.tar.gz
vdr-340d9bcb0fdf49fbe2740dde29af37f46887c122.tar.bz2
The EPG data is now always kept sorted chronologically in the internal data structures
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/epg.c b/epg.c
index 19108047..1c392b98 100644
--- a/epg.c
+++ b/epg.c
@@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.7 2004/02/21 12:32:31 kls Exp $
+ * $Id: epg.c 1.8 2004/02/21 13:46:23 kls Exp $
*/
#include "epg.h"
@@ -29,7 +29,6 @@ cEvent::cEvent(tChannelID ChannelID, u_int16_t EventID)
description = NULL;
startTime = 0;
duration = 0;
- channelNumber = 0;
}
cEvent::~cEvent()
@@ -39,6 +38,12 @@ cEvent::~cEvent()
free(description);
}
+bool cEvent::operator< (const cListObject &ListObject)
+{
+ cEvent *e = (cEvent *)&ListObject;
+ return startTime < e->startTime;
+}
+
void cEvent::SetEventID(u_int16_t EventID)
{
eventID = EventID;
@@ -500,6 +505,11 @@ void cSchedule::ResetVersions(void)
p->SetVersion(0xFF);
}
+void cSchedule::Sort(void)
+{
+ events.Sort();
+}
+
void cSchedule::Cleanup(void)
{
Cleanup(time(NULL));
@@ -547,6 +557,7 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules)
if (p) {
if (!cEvent::Read(f, p))
return false;
+ p->Sort();
}
}
else {