diff options
author | Frank Neumann <fnu@yavdr.org> | 2017-05-01 11:02:21 +0200 |
---|---|---|
committer | Frank Neumann <fnu@yavdr.org> | 2017-05-01 11:02:21 +0200 |
commit | a46c7161bddc00b5b11bda0f8a14066b5f837302 (patch) | |
tree | 48e50b78f0efb1120b39bfb07f3612aabb1541e6 /menu_deftimercheckmethod.c | |
parent | 0b09f90f361454d1d422cc750ee84359f11bd378 (diff) | |
download | vdr-plugin-epgsearch-a46c7161bddc00b5b11bda0f8a14066b5f837302.tar.gz vdr-plugin-epgsearch-a46c7161bddc00b5b11bda0f8a14066b5f837302.tar.bz2 |
Add compatibility for VDR 2.3.2+ (thx kamel5, mini73 & TomJoad)
Diffstat (limited to 'menu_deftimercheckmethod.c')
-rw-r--r-- | menu_deftimercheckmethod.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/menu_deftimercheckmethod.c b/menu_deftimercheckmethod.c index 0476211..c776c43 100644 --- a/menu_deftimercheckmethod.c +++ b/menu_deftimercheckmethod.c @@ -142,9 +142,15 @@ void cMenuDefTimerCheckMethod::Set() Clear(); delete modes; - modes = new int[Channels.Count()]; +#if VDRVERSNUM > 20300 + LOCK_CHANNELS_READ; + const cChannels *vdrchannels = Channels; +#else + cChannels *vdrchannels = &Channels; +#endif + modes = new int[vdrchannels->Count()]; int i=0; - for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel), i++) + for (const cChannel *channel = vdrchannels->First(); channel; channel = vdrchannels->Next(channel), i++) { if (!channel->GroupSep() && *channel->Name()) { @@ -164,7 +170,13 @@ eOSState cMenuDefTimerCheckMethod::ProcessKey(eKeys Key) case kOk: { int i=0; - for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel), i++) +#if VDRVERSNUM > 20300 + LOCK_CHANNELS_READ; + const cChannels *vdrchannels = Channels; +#else + cChannels *vdrchannels = &Channels; +#endif + for (const cChannel *channel = vdrchannels->First(); channel; channel = vdrchannels->Next(channel), i++) if (!channel->GroupSep() && *channel->Name()) DefTimerCheckModes.SetMode(channel, modes[i]); DefTimerCheckModes.Save(); |