summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--watch.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/watch.c b/watch.c
index 0ac5488..c738982 100644
--- a/watch.c
+++ b/watch.c
@@ -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());
}
}
}