fixed loading of timers in displaychannel

This commit is contained in:
louis 2016-05-11 17:37:32 +02:00
parent 32b78b2f57
commit 01945e83fc
3 changed files with 15 additions and 6 deletions

View File

@ -104,10 +104,15 @@ void cViewChannel::ClearVariables(void) {
displayChannelGroups = false;
if (veCustomTokens)
veCustomTokens->Reset();
timersLoaded = false;
globalTimers.ClearTimers();
}
void cViewChannel::SetChannel(const cChannel *channel, int number) {
if (!timersLoaded) {
timersLoaded = true;
globalTimers.LoadTimers();
}
channelChange = true;
bool wasChannelGroups = displayChannelGroups;
displayChannelGroups = false;
@ -144,7 +149,8 @@ void cViewChannel::SetChannel(const cChannel *channel, int number) {
}
void cViewChannel::SetEvents(const cEvent *present, const cEvent *following) {
if (init) {
if (!timersLoaded) {
timersLoaded = true;
globalTimers.LoadTimers();
}
Clear((int)eVeDisplayChannel::epginfo);

View File

@ -17,6 +17,7 @@ private:
cVeDcEcmInfo *veEcmInfo;
bool channelChange;
bool displayChannelGroups;
bool timersLoaded;
cGlobalTimers globalTimers;
void SetViewElements(void);
void ClearVariables(void);

View File

@ -320,14 +320,16 @@ void cVeDcStatusInfo::Set(const cChannel *c) {
bool isEncrypted = c->Ca();
bool isRecording = cRecordControls::Active();
for (int i = 0; i < globalTimers->Size() && !isRecording; i++)
if (const cTimer *Timer = globalTimers->At(i))
for (int i = 0; i < globalTimers->Size() && !isRecording; i++) {
if (const cTimer *Timer = globalTimers->At(i)) {
if (Timer->Recording())
isRecording = true;
else if (cEpgTimer_Interface_V1* epgTimer = dynamic_cast<cEpgTimer_Interface_V1*>((cTimer*)Timer)) {
if (epgTimer->State() == 'R')
isRecording = true;
}
if (epgTimer->State() == 'R')
isRecording = true;
}
}
}
tokenContainer->AddIntToken((int)eDCStatusInfoIT::isRadio, isRadio);
tokenContainer->AddIntToken((int)eDCStatusInfoIT::hasVT, hasVT);