RecMenu "Timer Timeline" displays now sorted active timer

This commit is contained in:
kamel5 2020-01-10 10:56:55 +01:00
parent 15b7074b4e
commit 509b64d78f

View File

@ -1431,14 +1431,19 @@ void cRecMenuTimeline::GetTimersForDay(void) {
timersToday.clear(); timersToday.clear();
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_TIMERS_READ; LOCK_TIMERS_READ;
// const cTimers* timers = Timers; const cTimers* timers = Timers;
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
#else #else
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { const cTimers* timers = &Timers;
#endif #endif
cSortedTimers SortedTimers(timers);
int i = 0;
while (i < SortedTimers.Size()) {
const cTimer *t = SortedTimers[i];
if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) { if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) {
timersToday.push_back(t); if (t->HasFlags(tfActive))
timersToday.push_back(t);
} }
i++;
} }
numTimersToday = timersToday.size(); numTimersToday = timersToday.size();
} }