diff options
-rw-r--r-- | watch.c | 44 |
1 files changed, 20 insertions, 24 deletions
@@ -872,31 +872,27 @@ bool cVFDWatch::Program() { #endif if (chID.Valid() && schedules) { const cSchedule * schedule = schedules->GetSchedule(chID); - if (schedule) { - - if ((p = schedule->GetPresentEvent()) != NULL) { - - if(chPresentTime && chEventID != p->EventID()) { - bChanged = true; - chEventID = p->EventID(); - chPresentTime = p->StartTime(); - chFollowingTime = p->EndTime(); - - if(chPresentTitle) { - delete chPresentTitle; - chPresentTitle = NULL; - } - if (!isempty(p->Title())) { - chPresentTitle = new cString(p->Title()); - } + if (schedule && (p = schedule->GetPresentEvent()) != NULL) { + if(!chPresentTime || chEventID != p->EventID()) { + bChanged = true; + chEventID = p->EventID(); + chPresentTime = p->StartTime(); + chFollowingTime = p->EndTime(); + + if(chPresentTitle) { + delete chPresentTitle; + chPresentTitle = NULL; + } + if (!isempty(p->Title())) { + chPresentTitle = new cString(p->Title()); + } - if(chPresentShortTitle) { - delete chPresentShortTitle; - chPresentShortTitle = NULL; - } - if (!isempty(p->ShortText())) { - chPresentShortTitle = new cString(p->ShortText()); - } + if(chPresentShortTitle) { + delete chPresentShortTitle; + chPresentShortTitle = NULL; + } + if (!isempty(p->ShortText())) { + chPresentShortTitle = new cString(p->ShortText()); } } } |