From f653594c4a82eef62ec16d9daab2f964f416a12e Mon Sep 17 00:00:00 2001 From: kamel5 Date: Wed, 4 Mar 2020 15:25:44 +0100 Subject: [PATCH] Fixes for GetTimer(t); #else cTimers* timers = &Timers; + cTimer *timer = timers->GetTimer((cTimer *)t); #endif - cTimer *timer = timers->GetTimer(t); if (!timer) { return; } @@ -317,11 +318,7 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) { rt.timer = NULL; RefreshRemoteTimers(); } else { -#if VDRVERSNUM >= 20301 timers->SetModified(); -#else - timers.SetModified(); -#endif } } diff --git a/recmenus.c b/recmenus.c index f4f1e12..312565a 100644 --- a/recmenus.c +++ b/recmenus.c @@ -1435,9 +1435,6 @@ void cRecMenuTimeline::GetTimersForDay(void) { #if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimers* timers = Timers; -#else - const cTimers* timers = &Timers; -#endif cSortedTimers SortedTimers(timers); int i = 0; while (i < SortedTimers.Size()) { @@ -1448,6 +1445,13 @@ void cRecMenuTimeline::GetTimersForDay(void) { } i++; } +#else + for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { + if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) { + timersToday.push_back(t); + } + } +#endif numTimersToday = timersToday.size(); } diff --git a/recmenuview.c b/recmenuview.c index 74e6f2b..53744c8 100644 --- a/recmenuview.c +++ b/recmenuview.c @@ -96,11 +96,15 @@ bool cRecMenuView::DisplayTimerConflict(const cTimer *timer) { #if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) { -#else - for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { -#endif if (t == timer) return DisplayTimerConflict(timer->Id() - 1); +#else + int timerID = 0; + for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { + if (t == timer) + return DisplayTimerConflict(timerID); + timerID++; +#endif } return false; } @@ -248,17 +252,20 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) { if (cRecMenuTimerConflict *menu = dynamic_cast(activeMenu)) { timerIndex = menu->GetTimerConflictIndex(); } else break; - int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1; const cTimers* timers; + const cEvent *event; #if VDRVERSNUM >= 20301 + int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1; { LOCK_TIMERS_READ; timers = Timers; } + event = timers->GetById(timerID)->Event(); #else + int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); timers = &Timers; + event = timers->Get(timerID)->Event(); #endif - const cEvent *event = timers->GetById(timerID)->Event(); recManager->DeleteTimer(event); // (timerID); delete activeMenu; if (!DisplayTimerConflict(timerID)) { diff --git a/timerconflict.c b/timerconflict.c index 2aaef7a..4fcf605 100644 --- a/timerconflict.c +++ b/timerconflict.c @@ -84,11 +84,13 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) { #if VDRVERSNUM >= 20301 LOCK_TIMERS_READ; const cTimers* timers = Timers; -#else - const cTimers* timers = &Timers; -#endif for (int j=0; j < numTimers; j++) { const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1); +#else + const cTimers* timers = &Timers; + for (int j=0; j < numTimers; j++) { + const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]); +#endif if (timer) { if (!unionSet) { unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime()); @@ -107,7 +109,11 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) { cTimeInterval *intersect = NULL; for (int j=0; j < numTimers; j++) { +#if VDRVERSNUM >= 20301 const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1); +#else + const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]); +#endif if (timer) { if (!intersect) { intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());