Fixes for <VDR-2.3.1 compatibility

This commit is contained in:
kamel5 2020-03-07 16:44:51 +01:00
parent 240cbe87e0
commit 8335ab0e41

View File

@ -231,12 +231,18 @@ 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;
#if VDRVERSNUM >= 20301
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
{
LOCK_TIMERS_READ;
const cTimer *t = Timers->GetById(timerID);
timers = Timers;
}
const cTimer *t = timers->GetById(timerID);
#else
const cTimer *t = Timers.Get(timerID);
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
timers = &Timers;
const cTimer *t = timers->Get(timerID);
#endif
if (t) {
const cEvent *ev = t->Event();
@ -266,7 +272,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
timers = &Timers;
event = timers->Get(timerID)->Event();
#endif
recManager->DeleteTimer(event); // (timerID);
recManager->DeleteTimer(event);
delete activeMenu;
if (!DisplayTimerConflict(timerID)) {
activeMenu = new cRecMenuConfirmDeleteTimer(event);
@ -280,12 +286,18 @@ 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;
#if VDRVERSNUM >= 20301
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
{
LOCK_TIMERS_READ;
const cTimer *timer = Timers->GetById(timerID);
timers = Timers;
}
const cTimer *timer = timers->GetById(timerID);
#else
const cTimer *timer = Timers.Get(timerID);
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
timers = &Timers;
const cTimer *timer = timers->Get(timerID);
#endif
if (timer) {
delete activeMenu;
@ -666,12 +678,18 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
timerConflict = menu->GetTimerConflictIndex();
} else break;
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict) + 1;
const cTimers* timers;
#if VDRVERSNUM >= 20301
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict) + 1;
{
LOCK_TIMERS_READ;
const cTimer *timer = Timers->GetById(timerID);
timers = Timers;
}
const cTimer *timer = timers->GetById(timerID);
#else
cTimer *timer = Timers.Get(timerID);
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict);
timers = &Timers;
const cTimer *timer = timers->Get(timerID);
#endif
if (timer) {
const cEvent *event = timer->Event();
@ -713,12 +731,16 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
originalConflictIndex = menu->GetTimerConflictIndex();
} else break;
int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex);
const cTimers* timers;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
const cTimer *timerOriginal = Timers->Get(originalTimerID);
timers = Timers;
}
#else
cTimer *timerOriginal = Timers.Get(originalTimerID);
timers = &Timers;
#endif
const cTimer *timerOriginal = timers->Get(originalTimerID);
if (replace && timerOriginal) {
recManager->DeleteTimer(timerOriginal->Event());
recManager->createTimer(replace);