Fixes for <VDR-2.3.1 compatibility

This commit is contained in:
kamel5 2020-03-04 15:25:44 +01:00
parent 8129d116fb
commit f653594c4a
4 changed files with 30 additions and 16 deletions

View File

@ -280,10 +280,11 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
esyslog(tr("tvguide: RemoteTimerModifications failed"));
}
}
cTimer *timer = timers->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
}
}

View File

@ -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();
}

View File

@ -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<cRecMenuTimerConflict*>(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)) {

View File

@ -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());