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

View File

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

View File

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