Fixed a error in DeleteTimerConflictMenu

This commit is contained in:
kamel5 2019-11-09 11:01:28 +01:00
parent bcf2ce757c
commit 2e4a43133e
3 changed files with 12 additions and 19 deletions

View File

@ -175,21 +175,6 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
timer->SetFile(*newFileName);
}
void cRecManager::DeleteTimer(int timerID) {
const cTimer *t;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
t = Timers->Get(timerID);
}
#else
t = Timers.Get(timerID);
#endif
if (!t)
return;
DeleteTimer(t);
}
void cRecManager::DeleteTimer(const cEvent *event) {
if (!event)
return;

View File

@ -34,7 +34,6 @@ public:
cTimer *createRemoteTimer(const cEvent *event, std::string path);
void SetTimerPath(cTimer *timer, const cEvent *event, std::string path);
void DeleteTimer(const cTimer *timer);
void DeleteTimer(int timerID);
void DeleteTimer(const cEvent *event);
void DeleteLocalTimer(const cEvent *event);
void DeleteRemoteTimer(const cEvent *event);

View File

@ -234,7 +234,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
LOCK_TIMERS_READ;
const cTimer *t = Timers->Get(timerID);
#else
cTimer *t = Timers.Get(timerID);
const cTimer *t = Timers.Get(timerID);
#endif
if (t) {
const cEvent *ev = t->Event();
@ -251,10 +251,19 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
timerIndex = menu->GetTimerConflictIndex();
} else break;
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
recManager->DeleteTimer(timerID);
const cTimers* timers;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
timers = Timers;
}
#else
timers = &Timers;
#endif
recManager->DeleteTimer(timers->Get(timerID)->Event());
delete activeMenu;
if (!DisplayTimerConflict(timerID)) {
activeMenu = new cRecMenuConfirmTimer(event);
activeMenu = new cRecMenuConfirmTimer(timers->Get(timerID)->Event());
activeMenu->Display();
}
break; }