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); 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) { void cRecManager::DeleteTimer(const cEvent *event) {
if (!event) if (!event)
return; return;

View File

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

View File

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