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")); esyslog(tr("tvguide: RemoteTimerModifications failed"));
} }
} }
cTimer *timer = timers->GetTimer(t);
#else #else
cTimers* timers = &Timers; cTimers* timers = &Timers;
cTimer *timer = timers->GetTimer((cTimer *)t);
#endif #endif
cTimer *timer = timers->GetTimer(t);
if (!timer) { if (!timer) {
return; return;
} }
@ -317,11 +318,7 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
rt.timer = NULL; rt.timer = NULL;
RefreshRemoteTimers(); RefreshRemoteTimers();
} else { } else {
#if VDRVERSNUM >= 20301
timers->SetModified(); timers->SetModified();
#else
timers.SetModified();
#endif
} }
} }

View File

@ -1435,9 +1435,6 @@ void cRecMenuTimeline::GetTimersForDay(void) {
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_TIMERS_READ; LOCK_TIMERS_READ;
const cTimers* timers = Timers; const cTimers* timers = Timers;
#else
const cTimers* timers = &Timers;
#endif
cSortedTimers SortedTimers(timers); cSortedTimers SortedTimers(timers);
int i = 0; int i = 0;
while (i < SortedTimers.Size()) { while (i < SortedTimers.Size()) {
@ -1448,6 +1445,13 @@ void cRecMenuTimeline::GetTimersForDay(void) {
} }
i++; 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(); numTimersToday = timersToday.size();
} }

View File

@ -96,11 +96,15 @@ bool cRecMenuView::DisplayTimerConflict(const cTimer *timer) {
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_TIMERS_READ; LOCK_TIMERS_READ;
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) { 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) if (t == timer)
return DisplayTimerConflict(timer->Id() - 1); 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; return false;
} }
@ -248,17 +252,20 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) { if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
timerIndex = menu->GetTimerConflictIndex(); timerIndex = menu->GetTimerConflictIndex();
} else break; } else break;
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
const cTimers* timers; const cTimers* timers;
const cEvent *event;
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
{ {
LOCK_TIMERS_READ; LOCK_TIMERS_READ;
timers = Timers; timers = Timers;
} }
event = timers->GetById(timerID)->Event();
#else #else
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
timers = &Timers; timers = &Timers;
event = timers->Get(timerID)->Event();
#endif #endif
const cEvent *event = timers->GetById(timerID)->Event();
recManager->DeleteTimer(event); // (timerID); recManager->DeleteTimer(event); // (timerID);
delete activeMenu; delete activeMenu;
if (!DisplayTimerConflict(timerID)) { if (!DisplayTimerConflict(timerID)) {

View File

@ -84,11 +84,13 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
LOCK_TIMERS_READ; LOCK_TIMERS_READ;
const cTimers* timers = Timers; const cTimers* timers = Timers;
#else
const cTimers* timers = &Timers;
#endif
for (int j=0; j < numTimers; j++) { for (int j=0; j < numTimers; j++) {
const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1); 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 (timer) {
if (!unionSet) { if (!unionSet) {
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime()); unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
@ -107,7 +109,11 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
cTimeInterval *intersect = NULL; cTimeInterval *intersect = NULL;
for (int j=0; j < numTimers; j++) { for (int j=0; j < numTimers; j++) {
#if VDRVERSNUM >= 20301
const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1); const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1);
#else
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
#endif
if (timer) { if (timer) {
if (!intersect) { if (!intersect) {
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime()); intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());