diff options
author | Jochen Dolze <vdr@dolze.de> | 2017-03-13 18:56:14 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2017-03-13 18:56:14 +0100 |
commit | ea2e182ec798375f3830f8b794e7408576f139ad (patch) | |
tree | ee66408f35c9c547528246bf22ef5f95b3de49f6 /plugin/status.cpp | |
parent | 3681d3a18383c238870de7d1ec1f1f9c8079cf89 (diff) | |
download | vdr-plugin-markad-master.tar.gz vdr-plugin-markad-master.tar.bz2 |
Added ServusTV-logo (thanks to MegaV0lt, Feature #2448)
Added possible fix for GCC compiler warning (Bug #2416)
Diffstat (limited to 'plugin/status.cpp')
-rw-r--r-- | plugin/status.cpp | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/plugin/status.cpp b/plugin/status.cpp index 2b7039a..efc8db3 100644 --- a/plugin/status.cpp +++ b/plugin/status.cpp @@ -140,34 +140,49 @@ void cStatusMarkAd::TimerChange(const cTimer *Timer, eTimerChange Change) bool cStatusMarkAd::LogoExists(const cDevice *Device,const char *FileName) { if (!FileName) return false; + char *cname=NULL; +#if APIVERSNUM>=20301 + const cTimer *timer=NULL; + cStateKey StateKey; + if (const cTimers *Timers = cTimers::GetTimersRead(StateKey)) { + for (const cTimer *Timer=Timers->First(); Timer; Timer=Timers->Next(Timer)) +#else cTimer *timer=NULL; for (cTimer *Timer = Timers.First(); Timer; Timer=Timers.Next(Timer)) - { -#if APIVERSNUM>=10722 - if (Timer->Recording() && const_cast<cDevice *>(Device)->IsTunedToTransponder(Timer->Channel()) && - (difftime(time(NULL),Timer->StartTime())<60)) +#endif { - timer=Timer; - break; - } +#if APIVERSNUM>=10722 + if (Timer->Recording() && const_cast<cDevice *>(Device)->IsTunedToTransponder(Timer->Channel()) && + (difftime(time(NULL),Timer->StartTime())<60)) + { + timer=Timer; + break; + } #else - if (Timer->Recording() && Device->IsTunedToTransponder(Timer->Channel()) && - (difftime(time(NULL),Timer->StartTime())<60)) - { - timer=Timer; - break; - } + if (Timer->Recording() && Device->IsTunedToTransponder(Timer->Channel()) && + (difftime(time(NULL),Timer->StartTime())<60)) + { + timer=Timer; + break; + } #endif + } + + if (!timer) { + esyslog("markad: cannot find timer for '%s'",FileName); + } else { + const cChannel *chan=timer->Channel(); + if (chan) cname=strdup(chan->Name()); + } + +#if APIVERSNUM>=20301 + StateKey.Remove(); } - if (!timer) { - esyslog("markad: cannot find timer for '%s'",FileName); - return false; - } +#endif - const cChannel *chan=timer->Channel(); - if (!chan) return false; - char *cname=strdup(chan->Name()); + if (!timer) return false; if (!cname) return false; + for (int i=0; i<(int) strlen(cname); i++) { if (cname[i]==' ') cname[i]='_'; |