Downloaded from http://www.vdr-portal.de/board/thread.php?postid=433592#post433592 diff -Naur tvonscreen-0.7.1/gfxtools.c tvonscreen-0.7.2/gfxtools.c --- tvonscreen-0.7.1/gfxtools.c 2005-01-09 17:12:42.000000000 +0100 +++ tvonscreen-0.7.2/gfxtools.c 2006-02-26 22:27:57.000000000 +0100 @@ -24,7 +24,12 @@ int index = 0; char *s; cReadLine *FileOps= new cReadLine(); - while ((s = FileOps->Read(f)) != NULL) + #if VDRVERSNUM >= 10318 + cReadLine ReadLine; + while ( (s = ReadLine.Read(f) ) != NULL ) + #else + while ((s = readline(f)) != NULL) + #endif { s = skipspace(s); if (!isXpm) diff -Naur tvonscreen-0.7.1/magazine.c tvonscreen-0.7.2/magazine.c --- tvonscreen-0.7.1/magazine.c 2005-09-11 20:57:10.000000000 +0200 +++ tvonscreen-0.7.2/magazine.c 2006-02-26 22:22:44.000000000 +0100 @@ -476,7 +476,12 @@ #endif int j=0; +#if VDRVERSNUM >= 10318 + const char *txt; + cString timetxt; +#else const char *txt,*timetxt; +#endif int lh=-1; int lhc=0; #if VDRVERSNUM >= 10307 @@ -540,7 +545,11 @@ col=clrYellow; EDIT_curEVI=i; } +#if VDRVERSNUM >= 10318 + timetxt=*cev->GetTimeString(); +#else timetxt=cev->GetTimeString(); +#endif #if VDRVERSNUM >= 10300 txt=cev->Title(); #else @@ -643,6 +652,9 @@ const cEventInfo *magazine::getNext(const cSchedule *s,const cEventInfo *e) #endif { + if (e == NULL) + return NULL; + #if VDRVERSNUM >= 10300 const cEvent *pe = NULL; time_t ref = e->StartTime(); @@ -687,6 +699,9 @@ const cEventInfo *magazine::getPrev(const cSchedule *s,const cEventInfo *e) #endif { + if (e == NULL) + return NULL; + #if VDRVERSNUM >= 10300 const cEvent *pe = NULL; time_t ref = e->StartTime(); @@ -1485,9 +1500,9 @@ { state = cOsdObject::ProcessKey(Key); - if (state == osUnknown) + if (state == osUnknown && schedArrayNum>currentFirst) { - if (curmode==SHOW && schedArrayNum>currentFirst) + if (curmode==SHOW) { switch (Key & ~k_Repeat) { @@ -1523,6 +1538,8 @@ currentFirst++; if (currentFirst>schedArrayNum-3) currentFirst=schedArrayNum-3; + if (currentFirst<0) + currentFirst=0; output(); break; case kUp: @@ -1557,6 +1574,8 @@ currentFirst+=3; if (currentFirst>schedArrayNum-3) currentFirst=schedArrayNum-3; + if (currentFirst<0) + currentFirst=0; output(); break; case k8: // zum aktuellen Sender @@ -1622,18 +1641,21 @@ { case kOk: { - delete osd; - osd=NULL; #if VDRVERSNUM >= 10300 cEvent **ev=ev4ch(EDIT_curChannel); #else cEventInfo **ev=ev4ch(EDIT_curChannel); #endif - me=new tvOcMenuEvent(ev[EDIT_curEVI]); - me->Display(); - curmode=SHOW; - EDIT_curEvent=0; - return osContinue; + if (ev[EDIT_curEVI] != NULL) + { + delete osd; + osd=NULL; + me=new tvOcMenuEvent(ev[EDIT_curEVI]); + me->Display(); + curmode=SHOW; + EDIT_curEvent=0; + return osContinue; + } } break; case kBack: @@ -1658,11 +1680,15 @@ EDIT_curChannel++; if (EDIT_curChannel>schedArrayNum-1) EDIT_curChannel=schedArrayNum-1; + if (EDIT_curChannel<0) + EDIT_curChannel=0; if (EDIT_curChannel>currentFirst+2) { currentFirst++; if (currentFirst>schedArrayNum-3) currentFirst=schedArrayNum-3; + if (currentFirst<0) + currentFirst=0; EDIT_curChannel=currentFirst+2; } outputLR(); @@ -1789,21 +1815,24 @@ break; */ case kRecord: { - delete osd; - osd=NULL; #if VDRVERSNUM >= 10300 cEvent **ev=ev4ch(EDIT_curChannel); #else cEventInfo **ev=ev4ch(EDIT_curChannel); #endif - cTimer *timer = new cTimer(ev[EDIT_curEVI]); - cTimer *t = Timers.GetTimer(timer); - if (t) + if (ev[EDIT_curEVI] != NULL) { - delete timer; - timer = t; + delete osd; + osd=NULL; + cTimer *timer = new cTimer(ev[EDIT_curEVI]); + cTimer *t = Timers.GetTimer(timer); + if (t) + { + delete timer; + timer = t; + } + met=new cMenuEditTimer(timer, !t); } - met=new cMenuEditTimer(timer, !t); } break; default: diff -Naur tvonscreen-0.7.1/search.c tvonscreen-0.7.2/search.c --- tvonscreen-0.7.1/search.c 2004-11-23 23:13:37.000000000 +0100 +++ tvonscreen-0.7.2/search.c 2006-02-26 22:22:44.000000000 +0100 @@ -17,7 +17,12 @@ #endif { char buf[200]; +#if VDRVERSNUM >= 10318 + const char *txt,*chan; + cString time1,time2,date; +#else const char *txt,*time1,*time2,*date,*chan; +#endif cChannel *channel; myev=ev; @@ -26,9 +31,16 @@ #else channel = Channels.GetByChannelID(ev->GetChannelID(), true); #endif +#if VDRVERSNUM >= 10318 + time1=*ev->GetTimeString(); + time2=*ev->GetEndTimeString(); +#else time1=ev->GetTimeString(); time2=ev->GetEndTimeString(); -#if VDRVERSNUM >= 10308 +#endif +#if VDRVERSNUM >= 10318 + date=*ev->GetDateString(); +#elif VDRVERSNUM >= 10308 date=ev->GetDateString(); #else date=ev->GetDate(); @@ -44,7 +56,11 @@ txt=ev->GetTitle(); #endif +#if VDRVERSNUM >= 10318 + snprintf(buf,sizeof(buf)-1,"%.6s %s - %s %s/%s",*date,*time1,*time2,chan,txt); +#else snprintf(buf,sizeof(buf)-1,"%.6s %s - %s %s/%s",date,time1,time2,chan,txt); +#endif SetText(buf); } diff -Naur tvonscreen-0.7.1/timer.h tvonscreen-0.7.2/timer.h --- tvonscreen-0.7.1/timer.h 2004-11-24 18:09:25.000000000 +0100 +++ tvonscreen-0.7.2/timer.h 2006-02-26 22:22:44.000000000 +0100 @@ -11,10 +11,12 @@ #define TIMER_H #include +#include #include #include "gfxtools.h" #include "config.h" +#if VDRVERSNUM < 10331 #if VDRVERSNUM >= 10300 class cMenuEvent : public cOsdMenu { private: @@ -48,6 +50,7 @@ virtual ~cMenuEditTimer(); virtual eOSState ProcessKey(eKeys Key); }; +#endif class tvOcMenuEvent : public cMenuEvent { public: