summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-05-07 15:57:26 +0200
committerFrank Neumann <fnu@yavdr.org>2017-05-07 15:57:26 +0200
commit8905334e795a299f332395b92faaa5560b2d4c7f (patch)
tree547ddad686a9cd3c6a5b77d8dd47448319fe3b63
parent708819a7b5653f2d66c7fb17baba2c7a081a47a7 (diff)
downloadvdr-plugin-epgsearch-8905334e795a299f332395b92faaa5560b2d4c7f.tar.gz
vdr-plugin-epgsearch-8905334e795a299f332395b92faaa5560b2d4c7f.tar.bz2
Drop legacy code prior VDR 2.3.x
-rw-r--r--blacklist.c21
-rw-r--r--changrp.c20
-rw-r--r--conflictcheck.c17
-rw-r--r--conflictcheck_thread.c8
-rw-r--r--epgsearch.c16
-rw-r--r--epgsearchext.c33
-rw-r--r--epgsearchsvdrp.c22
-rw-r--r--epgsearchtools.c9
-rw-r--r--mail.c17
-rw-r--r--menu_blacklistedit.c4
-rw-r--r--menu_commands.c22
-rw-r--r--menu_conflictcheck.c28
-rw-r--r--menu_deftimercheckmethod.c8
-rw-r--r--menu_dirselect.c7
-rw-r--r--menu_event.c9
-rw-r--r--menu_favorites.c4
-rw-r--r--menu_main.c46
-rw-r--r--menu_myedittimer.c38
-rw-r--r--menu_quicksearch.c4
-rw-r--r--menu_searchedit.c4
-rw-r--r--menu_searchresults.c42
-rw-r--r--menu_switchtimers.c4
-rw-r--r--menu_templateedit.c4
-rw-r--r--menu_timersdone.c4
-rw-r--r--menu_whatson.c35
-rw-r--r--pending_notifications.c4
-rw-r--r--recdone.c8
-rw-r--r--recstatus.c12
-rw-r--r--recstatus.h2
-rw-r--r--searchtimer_thread.c50
-rw-r--r--services.c8
-rw-r--r--status_thread.c3
-rw-r--r--switchtimer.c9
-rw-r--r--switchtimer_thread.c4
-rw-r--r--templatefile.c4
-rw-r--r--timer_thread.c8
-rw-r--r--timerdone.c9
-rw-r--r--uservars.h20
38 files changed, 1 insertions, 566 deletions
diff --git a/blacklist.c b/blacklist.c
index 9f77155..f1d6f7e 100644
--- a/blacklist.c
+++ b/blacklist.c
@@ -47,12 +47,8 @@ cBlacklist::cBlacklist(void)
startTime = 0000;
stopTime = 2359;
useChannel = false;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
channelMin = vdrchannels->GetByNumber(cDevice::CurrentChannel());
channelMax = vdrchannels->GetByNumber(cDevice::CurrentChannel());
channelGroup = NULL;
@@ -337,12 +333,8 @@ bool cBlacklist::Parse(const char *s)
char *channelMaxbuffer = NULL;
int channels = sscanf(value, "%m[^|]|%m[^|]", &channelMinbuffer, &channelMaxbuffer);
#endif
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
channelMin = vdrchannels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
if (!channelMin)
{
@@ -646,13 +638,8 @@ cSearchResults* cBlacklist::Run(cSearchResults* pSearchResults, int MarginStop)
LogFile.Log(3,"start search for blacklist '%s'", search);
const cSchedules *schedules;
-#if VDRVERSNUM > 20300
LOCK_SCHEDULES_READ;
schedules = Schedules;
-#else
- cSchedulesLock schedulesLock;
- schedules = cSchedules::Schedules(schedulesLock);
-#endif
if(!schedules) {
LogFile.Log(1,"schedules are currently locked! try again later.");
return NULL;
@@ -661,12 +648,8 @@ cSearchResults* cBlacklist::Run(cSearchResults* pSearchResults, int MarginStop)
const cSchedule *Schedule = schedules->First();
while (Schedule) {
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->GetByChannelID(Schedule->ChannelID(),true,true);
if (!channel)
{
@@ -705,12 +688,8 @@ cSearchResults* cBlacklist::Run(cSearchResults* pSearchResults, int MarginStop)
do {
const cEvent* event = GetEventByBlacklist(Schedule, pPrevEvent, MarginStop);
pPrevEvent = event;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
if (event && vdrchannels->GetByChannelID(event->ChannelID(),true,true))
{
if (!pSearchResults) pSearchResults = new cSearchResults;
diff --git a/changrp.c b/changrp.c
index 366dd4a..0699b15 100644
--- a/changrp.c
+++ b/changrp.c
@@ -82,12 +82,8 @@ bool cChannelGroup::Parse(const char *s)
#endif
if (numChannels == 1)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->GetByChannelID(tChannelID::FromString(channelbuffer), true, true);
if (channel)
{
@@ -135,12 +131,8 @@ const char *cChannelGroup::ToText(void)
int* cChannelGroup::CreateChannelSel()
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
int* channelSel = (int*) malloc(vdrchannels->Count() * sizeof(int));
const cChannel* channel = vdrchannels->First();
int index = 0;
@@ -171,12 +163,8 @@ int* cChannelGroup::CreateChannelSel()
void cChannelGroup::CreateChannelList(int* channelSel)
{
channels.Clear();
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->First();
int index = 0;
while (channel)
@@ -446,12 +434,8 @@ void cMenuEditChannelGroup::Set()
Clear();
Add(new cMenuEditStrItem( tr("Group name"), name, sizeof(group->name), trVDR(FileNameChars)));
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->First();
int index = 0;
while (channel)
@@ -527,12 +511,8 @@ eOSState cMenuEditChannelGroup::ProcessKey(eKeys Key)
case kGreen:
case kYellow:
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->First();
int index = 0;
while (channel)
diff --git a/conflictcheck.c b/conflictcheck.c
index 9180de0..71ca586 100644
--- a/conflictcheck.c
+++ b/conflictcheck.c
@@ -73,13 +73,8 @@ const cEvent* cConflictCheckTimerObj::Event()
const cEvent* cConflictCheckTimerObj::SetEventFromSchedule()
{
-#if VDRVERSNUM > 20300
LOCK_SCHEDULES_READ;
const cSchedules *schedules = Schedules;
-#else
- cSchedulesLock SchedulesLock;
- const cSchedules* schedules = cSchedules::Schedules(SchedulesLock);
-#endif
if (!schedules)
return NULL;
@@ -262,12 +257,8 @@ cList<cConflictCheckTimerObj>* cConflictCheck::CreateCurrentTimerList()
// collect single event timers
time_t tMax = 0;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- const cTimers *vdrtimers = &Timers;
-#endif
const cTimer* ti = NULL;
for (ti = vdrtimers->First(); ti; ti = vdrtimers->Next(ti))
{
@@ -688,12 +679,8 @@ bool cConflictCheck::TimerInConflict(const cTimer* timer)
std::set<cConflictCheckTimerObj*,TimerObjSort>::iterator it2;
if ((*it)->concurrentTimers)
{
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
for (it2 = (*it)->concurrentTimers->begin(); it2 != (*it)->concurrentTimers->end(); ++it2)
{
if ((*it2)->OrigTimer(vdrtimers) == timer)
@@ -719,12 +706,8 @@ void cConflictCheck::EvaluateConflCheckCmd()
if ((*it) && !(*it)->ignore)
{
string result = EPGSearchConfig.conflCheckCmd;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
if (!(*it)->OrigTimer(vdrtimers))
{
LogFile.Log(3,"timer has disappeared meanwhile");
diff --git a/conflictcheck_thread.c b/conflictcheck_thread.c
index 91a14a4..4e2e3fe 100644
--- a/conflictcheck_thread.c
+++ b/conflictcheck_thread.c
@@ -102,17 +102,9 @@ void cConflictCheckThread::Action(void)
if (now >= nextUpdate || m_forceUpdate)
{
m_forceUpdate = false;
-#if VDRVERSNUM > 20300
{
LOCK_TIMERS_WRITE;
}
-#else
- if (Timers.BeingEdited())
- {
- Wait.Wait(1000);
- continue;
- }
-#endif
LogFile.iSysLog("timer conflict check started");
cConflictCheck conflictCheck;
diff --git a/epgsearch.c b/epgsearch.c
index f5a6ed2..7ac44da 100644
--- a/epgsearch.c
+++ b/epgsearch.c
@@ -156,12 +156,8 @@ bool cPluginEpgsearch::ProcessArgs(int argc, char *argv[])
strn0cpy(SearchExt->search,argv[2], sizeof(SearchExt->search));
if (atoi(argv[3]) > 0)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
SearchExt->useChannel = true;
SearchExt->channelMin = vdrchannels->GetByNumber(atoi(argv[3]));
SearchExt->channelMax = vdrchannels->GetByNumber(atoi(argv[3]));
@@ -243,12 +239,8 @@ bool cPluginEpgsearch::Service(const char *Id, void *Data)
strn0cpy(SearchExt->search,searchData->query, sizeof(SearchExt->search));
if (searchData->channelNr > 0)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
SearchExt->useChannel = true;
SearchExt->channelMin = vdrchannels->GetByNumber(searchData->channelNr);
SearchExt->channelMax = vdrchannels->GetByNumber(searchData->channelNr);
@@ -344,12 +336,8 @@ bool cPluginEpgsearch::Service(const char *Id, void *Data)
strn0cpy(SearchExt->search,searchData->query, sizeof(SearchExt->search));
if (searchData->channelNr > 0)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
SearchExt->useChannel = true;
SearchExt->channelMin = vdrchannels->GetByNumber(searchData->channelNr);
SearchExt->channelMax = vdrchannels->GetByNumber(searchData->channelNr);
@@ -528,12 +516,8 @@ cOsdObject *cPluginEpgsearch::DoInitialSearch(char* rcFilename)
strn0cpy(SearchExt->search,rcFile.Search, sizeof(SearchExt->search));
if (rcFile.ChannelNr != -1)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
SearchExt->useChannel = true;
SearchExt->channelMin = vdrchannels->GetByNumber(rcFile.ChannelNr);
SearchExt->channelMax = vdrchannels->GetByNumber(rcFile.ChannelNr);
diff --git a/epgsearchext.c b/epgsearchext.c
index 2f524f9..af72977 100644
--- a/epgsearchext.c
+++ b/epgsearchext.c
@@ -58,12 +58,8 @@ cSearchExt::cSearchExt(void)
startTime = 0000;
stopTime = 2359;
useChannel = false;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
channelMin = vdrchannels->GetByNumber(cDevice::CurrentChannel());
channelMax = vdrchannels->GetByNumber(cDevice::CurrentChannel());
channelGroup = NULL;
@@ -486,12 +482,8 @@ bool cSearchExt::Parse(const char *s)
char *channelMaxbuffer = NULL;
int channels = sscanf(value, "%m[^|]|%m[^|]", &channelMinbuffer, &channelMaxbuffer);
#endif
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
channelMin = vdrchannels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
if (!channelMin)
{
@@ -1024,16 +1016,10 @@ cSearchResults* cSearchExt::Run(int PayTVMode, bool inspectTimerMargin, int eval
LogFile.Log(3,"start search for search timer '%s'", search);
const cSchedules *schedules;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ; // Channels must be locked first
const cChannels *vdrchannels = Channels;
LOCK_SCHEDULES_READ;
schedules = Schedules;
-#else
- cSchedulesLock schedulesLock;
- cChannels *vdrchannels = &Channels;
- schedules = cSchedules::Schedules(schedulesLock);
-#endif
if(!schedules) {
LogFile.Log(1,"schedules are currently locked! try again later.");
return NULL;
@@ -1185,12 +1171,8 @@ void cSearchExt::CheckRepeatTimers(cSearchResults* pResults)
}
cSearchResult* pResultObj = NULL;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers* vdrtimers = Timers;
-#else
- cTimers* vdrtimers = &Timers;
-#endif
for (pResultObj = pResults->First(); pResultObj; pResultObj = pResults->Next(pResultObj))
{
if ((action != searchTimerActionRecord) && (action != searchTimerActionInactiveRecord)) // only announce if there is no timer for the event
@@ -1363,32 +1345,21 @@ bool cSearchExt::MatchesExtEPGInfo(const cEvent* e)
void cSearchExt::OnOffTimers(bool bOn)
{
-#if VDRVERSNUM > 20300
LOCK_TIMERS_WRITE;
cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
for (cTimer *ti = vdrtimers->First(); ti; ti = vdrtimers->Next(ti))
{
if (((!bOn && ti->HasFlags(tfActive)) || (bOn && !ti->HasFlags(tfActive))) && TriggeredFromSearchTimerID(ti) == ID)
ti->OnOff();
}
-#if VDRVERSNUM < 20300
- Timers.SetModified();
-#endif
}
void cSearchExt::DeleteAllTimers()
{
cList<cTimerObj> DelTimers;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
cTimer *ti = vdrtimers->First();
while(ti)
{
@@ -1436,12 +1407,8 @@ int cSearchExt::GetCountRecordings()
{
int countRecs = 0;
-#if VDRVERSNUM > 20300
LOCK_RECORDINGS_READ;
const cRecordings *vdrrecordings = Recordings;
-#else
- cRecordings *vdrrecordings = &Recordings;
-#endif
for (const cRecording *recording = vdrrecordings->First(); recording; recording = vdrrecordings->Next(recording))
{
if (recording->IsEdited()) continue; // ignore recordings edited
diff --git a/epgsearchsvdrp.c b/epgsearchsvdrp.c
index 6b3c039..7398b9c 100644
--- a/epgsearchsvdrp.c
+++ b/epgsearchsvdrp.c
@@ -232,11 +232,7 @@ cString cPluginEpgsearch::SVDRPCommand(const char *Command, const char *Option,
{
LogFile.Log(1,"search '%s' deleted via SVDRP", search->search);
cMutexLock SearchExtsLock(&SearchExts);
- if (delTimers
-#if VDRVERSNUM < 20300
- && !Timers.BeingEdited()
-#endif
- )
+ if (delTimers)
search->DeleteAllTimers();
SearchExts.Del(search);
SearchExts.Save();
@@ -566,24 +562,16 @@ cString cPluginEpgsearch::SVDRPCommand(const char *Command, const char *Option,
eTimerMatch timerMatch;
bool hasTimer = false;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
if (vdrtimers->GetMatch(pEvent, &timerMatch))
hasTimer = (timerMatch == tmFull);
if (!result->search->useAsSearchTimer)
result->needsTimer = false;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(pEvent->ChannelID(), true,true);
int timerMode = hasTimer?1:(result->needsTimer?2:0);
@@ -1059,12 +1047,8 @@ cString cPluginEpgsearch::SVDRPCommand(const char *Command, const char *Option,
ReplyCode = 901;
return cString::sprintf("invalid channel id");
}
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *ch = vdrchannels->GetByChannelID(chID,true,true);
if (!ch)
{
@@ -1075,12 +1059,8 @@ cString cPluginEpgsearch::SVDRPCommand(const char *Command, const char *Option,
}
else
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
string sBuffer;
for (int i = 0; i < vdrchannels->Count(); i++)
{
diff --git a/epgsearchtools.c b/epgsearchtools.c
index 7c09243..f3c9ae3 100644
--- a/epgsearchtools.c
+++ b/epgsearchtools.c
@@ -527,13 +527,8 @@ const cEvent* GetEvent(const cTimer* timer)
for (int seconds = 0; seconds <= 3; seconds++)
{
{
-#if VDRVERSNUM > 20300
LOCK_SCHEDULES_READ;
const cSchedules *schedules = Schedules;
-#else
- cSchedulesLock SchedulesLock;
- const cSchedules *schedules = cSchedules::Schedules(SchedulesLock);
-#endif
if (schedules) {
const cSchedule *Schedule = schedules->GetSchedule(channel->GetChannelID());
if (Schedule) {
@@ -714,12 +709,8 @@ int ChannelNrFromEvent(const cEvent* pEvent)
{
if (!pEvent)
return -1;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->GetByChannelID(pEvent->ChannelID(), true, true);
if (!channel)
return -1;
diff --git a/mail.c b/mail.c
index 369cbfa..37308f7 100644
--- a/mail.c
+++ b/mail.c
@@ -50,12 +50,8 @@ string cMailTimerNotification::Format(const string& templ) const
if (!pEvent) return "";
eTimerMatch TimerMatch = tmNone;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
const cTimer* pTimer = vdrtimers->GetMatch(pEvent, &TimerMatch);
if (!pTimer) return "";
@@ -76,13 +72,8 @@ string cMailTimerNotification::Format(const string& templ) const
const cEvent* cMailTimerNotification::GetEvent() const
{
-#if VDRVERSNUM > 20300
LOCK_SCHEDULES_READ;
const cSchedules *schedules = Schedules;
-#else
- cSchedulesLock schedulesLock;
- const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
-#endif
if (!schedules) return NULL;
const cSchedule *schedule = schedules->GetSchedule(channelID);
if (!schedule) return NULL;
@@ -91,12 +82,8 @@ const cEvent* cMailTimerNotification::GetEvent() const
bool cMailTimerNotification::operator< (const cMailTimerNotification &N) const
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->GetByChannelID(channelID,true,true);
const cChannel* channelOther = vdrchannels->GetByChannelID(N.channelID,true,true);
if (!channel || !channelOther)
@@ -138,12 +125,8 @@ cMailDelTimerNotification::cMailDelTimerNotification(const string& Formatted, tC
bool cMailDelTimerNotification::operator< (const cMailDelTimerNotification &N) const
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->GetByChannelID(channelID,true,true);
const cChannel* channelOther = vdrchannels->GetByChannelID(N.channelID,true,true);
if (!channel || !channelOther)
diff --git a/menu_blacklistedit.c b/menu_blacklistedit.c
index 6263c38..ad5a449 100644
--- a/menu_blacklistedit.c
+++ b/menu_blacklistedit.c
@@ -349,12 +349,8 @@ eOSState cMenuBlacklistEdit::ProcessKey(eKeys Key)
case kOk:
if (data.useChannel==1)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *ch = vdrchannels->GetByNumber(channelMin);
if (ch)
data.channelMin = ch;
diff --git a/menu_commands.c b/menu_commands.c
index 88b7b64..6e97a35 100644
--- a/menu_commands.c
+++ b/menu_commands.c
@@ -100,12 +100,8 @@ void cMenuSearchCommands::LoadCommands()
eOSState cMenuSearchCommands::Switch(void)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(event->ChannelID(), true, true);
if (channel && cDevice::PrimaryDevice()->SwitchChannel(channel, true))
return osEnd;
@@ -126,13 +122,9 @@ eOSState cMenuSearchCommands::Record(void)
if (!event) return osContinue;
eTimerMatch timerMatch = tmNone;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
cTimer* timer = vdrtimers->GetMatch(event, &timerMatch);
if (timerMatch == tmFull)
{
@@ -181,21 +173,15 @@ eOSState cMenuSearchCommands::Record(void)
#endif
SetAux(timer, fullaux);
-#if VDRVERSNUM > 20300
if (*Setup.SVDRPDefaultHost)
timer->SetRemote(Setup.SVDRPDefaultHost);
-#endif
vdrtimers->Add(timer);
timer->Matches();
vdrtimers->SetModified();
-#if VDRVERSNUM > 20300
if (!HandleRemoteTimerModifications(timer)) {
delete timer;
}
else
-#else
- LogFile.iSysLog("timer %s added (active)", *timer->ToDescr());
-#endif
return osBack;
}
return osContinue;
@@ -253,12 +239,8 @@ eOSState cMenuSearchCommands::CreateSearchTimer(void)
cSearchExt* pNew = new cSearchExt;
strcpy(pNew->search, event->Title());
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
pNew->channelMin = pNew->channelMax = vdrchannels->GetByChannelID(event->ChannelID());
return AddSubMenu(new cMenuEditSearchExt(pNew, true, false, true));
}
@@ -307,12 +289,8 @@ eOSState cMenuSearchCommands::Execute(void)
buffer = cString::sprintf("%s...", command->Title());
Skins.Message(mtStatus, buffer);
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
buffer = cString::sprintf("'%s' %ld %ld %d '%s' '%s'",
EscapeString(event->Title()).c_str(),
event->StartTime(),
diff --git a/menu_conflictcheck.c b/menu_conflictcheck.c
index 601bc03..8c8d322 100644
--- a/menu_conflictcheck.c
+++ b/menu_conflictcheck.c
@@ -163,12 +163,8 @@ eOSState cMenuConflictCheck::ProcessKey(eKeys Key)
cMenuConflictCheckDetailsItem::cMenuConflictCheckDetailsItem(cConflictCheckTimerObj* TimerObj)
{
timerObj = TimerObj;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
hasTimer = timerObj->OrigTimer(vdrtimers)?timerObj->OrigTimer(vdrtimers)->HasFlags(tfActive):false;
Update(true);
}
@@ -176,12 +172,8 @@ cMenuConflictCheckDetailsItem::cMenuConflictCheckDetailsItem(cConflictCheckTimer
bool cMenuConflictCheckDetailsItem::Update(bool Force)
{
bool oldhasTimer = hasTimer;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
hasTimer = timerObj->OrigTimer(vdrtimers)?timerObj->OrigTimer(vdrtimers)->HasFlags(tfActive):false;
if (Force || hasTimer != oldhasTimer)
{
@@ -275,13 +267,9 @@ eOSState cMenuConflictCheckDetails::Commands(eKeys Key)
eOSState cMenuConflictCheckDetails::ToggleTimer(cConflictCheckTimerObj* TimerObj)
{
cTimers *vdrtimers;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
vdrtimers = Timers;
-#else
- vdrtimers = &Timers;
-#endif
if (!TimerObj || !TimerObj->OrigTimer(vdrtimers)) return osContinue;
TimerObj->OrigTimer(vdrtimers)->OnOff(); // Toggles Timer Flag
vdrtimers->SetModified();
@@ -302,13 +290,9 @@ bool cMenuConflictCheckDetails::Update(bool Force)
eOSState cMenuConflictCheckDetails::DeleteTimer(cConflictCheckTimerObj* TimerObj)
{
-#if VDRVERSNUM > 20300
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
cTimer* timer = TimerObj->OrigTimer(vdrtimers);
// Check if this timer is active:
if (timer) {
@@ -316,11 +300,7 @@ eOSState cMenuConflictCheckDetails::DeleteTimer(cConflictCheckTimerObj* TimerObj
if (timer->Recording()) {
if (Interface->Confirm(trVDR("Timer still recording - really delete?"))) {
timer->Skip();
-#if VDRVERSNUM > 20300
cRecordControls::Process(vdrtimers, time(NULL));
-#else
- cRecordControls::Process(time(NULL));
-#endif
}
else
return osContinue;
@@ -346,12 +326,8 @@ eOSState cMenuConflictCheckDetails::ShowSummary()
const cEvent *ei = curTimerObj->Event();
if (ei)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(ei->ChannelID(), true, true);
if (channel)
return AddSubMenu(new cMenuEventSearchSimple(ei, eventObjects));
@@ -441,12 +417,8 @@ eOSState cMenuConflictCheckDetails::ProcessKey(eKeys Key)
for (it = timerObj->concurrentTimers->begin(); it != timerObj->concurrentTimers->end(); ++it)
{
bool found = false;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- const cTimers *vdrtimers = &Timers;
-#endif
for(const cTimer* checkT = vdrtimers->First(); checkT; checkT = vdrtimers->Next(checkT))
{
checkT->Matches();
diff --git a/menu_deftimercheckmethod.c b/menu_deftimercheckmethod.c
index 2e24820..f529d6e 100644
--- a/menu_deftimercheckmethod.c
+++ b/menu_deftimercheckmethod.c
@@ -140,12 +140,8 @@ void cMenuDefTimerCheckMethod::Set()
Clear();
delete modes;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
modes = new int[vdrchannels->Count()];
int i=0;
for (const cChannel *channel = vdrchannels->First(); channel; channel = vdrchannels->Next(channel), i++)
@@ -168,12 +164,8 @@ eOSState cMenuDefTimerCheckMethod::ProcessKey(eKeys Key)
case kOk:
{
int i=0;
-#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]);
diff --git a/menu_dirselect.c b/menu_dirselect.c
index f9abded..9ba46a7 100644
--- a/menu_dirselect.c
+++ b/menu_dirselect.c
@@ -130,17 +130,10 @@ void cMenuDirSelect::CreateDirSet(bool extraDirs)
directorySet.clear();
// add distinct directories from current recordings
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
LOCK_RECORDINGS_READ;
const cRecordings *vdrrecordings = Recordings;
-#else
- const cTimers *vdrtimers = &Timers;
- cRecordings *vdrrecordings = &Recordings;
- if (Recordings.Count() == 0)
- Recordings.Load();
-#endif
for (const cRecording *recording = vdrrecordings->First(); recording; recording = vdrrecordings->Next(recording))
{
if (recording->HierarchyLevels() > 0)
diff --git a/menu_event.c b/menu_event.c
index 4136795..e90d123 100644
--- a/menu_event.c
+++ b/menu_event.c
@@ -82,15 +82,10 @@ void cMenuEventSearch::Set()
if (event)
{
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cTimers *vdrtimers = &Timers;
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(event->ChannelID(), true, true);
bool canSwitch = false;
if (channel)
@@ -243,12 +238,8 @@ void cMenuEventSearchSimple::Set()
if (event)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(event->ChannelID(), true, true);
if (channel)
{
diff --git a/menu_favorites.c b/menu_favorites.c
index f04aea2..f74d3d9 100644
--- a/menu_favorites.c
+++ b/menu_favorites.c
@@ -122,12 +122,8 @@ eOSState cMenuFavorites::OnYellow()
cMenuSearchResultsItem *item = (cMenuSearchResultsItem *)Get(Current());
if (item && item->event)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(item->event->ChannelID(), true, true);
cMenuWhatsOnSearch::scheduleChannel = channel;
cMenuWhatsOnSearch::currentShowMode = showNow;
diff --git a/menu_main.c b/menu_main.c
index 35ffd67..af99afc 100644
--- a/menu_main.c
+++ b/menu_main.c
@@ -56,19 +56,11 @@ cMenuSearchMain::cMenuSearchMain(void)
shiftTime = 0;
InWhatsOnMenu = false;
InFavoritesMenu = false;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByNumber(cDevice::CurrentChannel());
-#if VDRVERSNUM > 20300
LOCK_SCHEDULES_READ;
schedules = Schedules;
-#else
- schedules = cSchedules::Schedules(schedulesLock);
-#endif
if (channel) {
cMenuWhatsOnSearch::SetCurrentChannel(channel->Number());
if (EPGSearchConfig.StartMenu == 0 || forceMenu != 0)
@@ -187,14 +179,10 @@ eOSState cMenuSearchMain::Record(void)
cMenuMyScheduleItem *item = (cMenuMyScheduleItem *)Get(Current());
cTimers *vdrtimers;
if (item) {
-#if VDRVERSNUM > 20300
{
LOCK_TIMERS_READ;
vdrtimers = (cTimers *)Timers;
}
-#else
- vdrtimers = &Timers;
-#endif
if (item->timerMatch == tmFull)
{
eTimerMatch tm = tmNone;
@@ -210,12 +198,10 @@ eOSState cMenuSearchMain::Record(void)
cTimer *timer = new cTimer(item->event);
PrepareTimerFile(item->event, timer);
-#if VDRVERSNUM > 20300
{
LOCK_TIMERS_READ;
vdrtimers = (cTimers *)Timers;
}
-#endif
cTimer *t = vdrtimers->GetTimer(timer);
if (EPGSearchConfig.onePressTimerCreation == 0 || t || !item->event || (!t && item->event && item->event->StartTime() - (Setup.MarginStart+2) * 60 < time(NULL)))
{
@@ -253,7 +239,6 @@ eOSState cMenuSearchMain::Record(void)
#endif
SetAux(timer, fullaux);
-#if VDRVERSNUM > 20300
if (*Setup.SVDRPDefaultHost)
timer->SetRemote(Setup.SVDRPDefaultHost);
{
@@ -261,19 +246,12 @@ eOSState cMenuSearchMain::Record(void)
vdrtimers = Timers;
vdrtimers->Add(timer); // implicit SetModified
}
-#else
- vdrtimers->Add(timer);
-#endif
gl_timerStatusMonitor->SetConflictCheckAdvised();
timer->Matches();
-#if VDRVERSNUM < 20300
- vdrtimers->SetModified();
-#else
if (!HandleRemoteTimerModifications(timer)) {
delete timer;
}
else
-#endif
LogFile.iSysLog("timer %s added (active)", *timer->ToDescr());
if (HasSubMenu())
@@ -290,12 +268,8 @@ eOSState cMenuSearchMain::Switch(void)
{
cMenuMyScheduleItem *item = (cMenuMyScheduleItem *)Get(Current());
if (item) {
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(item->event->ChannelID(), true, true);
if (channel && cDevice::PrimaryDevice()->SwitchChannel(channel, true))
return osEnd;
@@ -353,12 +327,8 @@ void cMenuSearchMain::SetHelpKeys(bool Force)
SetHelp((EPGSearchConfig.redkeymode==0?(hasTimer?trVDR("Button$Timer"):trVDR("Button$Record")):tr("Button$Commands")), trVDR("Button$Now"), trVDR("Button$Next"), EPGSearchConfig.bluekeymode==0?trVDR("Button$Switch"):tr("Button$Search"));
else
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const char* szGreenToggled = CHANNELNAME(vdrchannels->GetByNumber(currentChannel-1,-1));
const char* szYellowToggled = CHANNELNAME(vdrchannels->GetByNumber(currentChannel+1,1));
@@ -372,12 +342,8 @@ void cMenuSearchMain::SetHelpKeys(bool Force)
eOSState cMenuSearchMain::Shift(int iMinutes)
{
shiftTime += iMinutes;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByNumber(currentChannel);
PrepareSchedule(channel);
Display();
@@ -492,12 +458,8 @@ eOSState cMenuSearchMain::ProcessKey(eKeys Key)
cMenuMyScheduleItem* Item = (cMenuMyScheduleItem *)Get(Current());
if (Item && Item->event)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(Item->event->ChannelID(), true, true);
if (channel)
ChannelNr = channel->Number();
@@ -516,12 +478,8 @@ eOSState cMenuSearchMain::ProcessKey(eKeys Key)
}
else
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByNumber(currentChannel-1,-1);
if (channel) {
@@ -554,12 +512,8 @@ eOSState cMenuSearchMain::ProcessKey(eKeys Key)
}
else
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByNumber(currentChannel+1,1);
if (channel) {
PrepareSchedule(channel);
diff --git a/menu_myedittimer.c b/menu_myedittimer.c
index 359f12f..c3bd0e1 100644
--- a/menu_myedittimer.c
+++ b/menu_myedittimer.c
@@ -74,9 +74,6 @@ cMenuMyEditTimer::cMenuMyEditTimer(cTimer *Timer, bool New, const cEvent* Event,
Set();
SetHelp(addIfConfirmed?NULL:trVDR("Button$Delete"), NULL, NULL, NULL);
}
-#if VDRVERSNUM < 20300
- Timers.IncBeingEdited();
-#endif
}
void cMenuMyEditTimer::SplitFile()
@@ -130,12 +127,8 @@ void cMenuMyEditTimer::Set()
#ifdef USE_PINPLUGIN
if (cOsd::pinValid || !fskProtection) Add(new cMenuEditChanItem(tr("Channel"), &channel));
else {
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
cString buf = cString::sprintf("%s\t%s", tr("Channel"), vdrchannels->GetByNumber(channel)->Name());
Add(new cOsdItem(buf));
}
@@ -168,12 +161,8 @@ void cMenuMyEditTimer::Set()
}
else if (IsSingleEvent() && event)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
checkmode = DefTimerCheckModes.GetMode(vdrchannels->GetByNumber(channel));
char* checkmodeAux = GetAuxValue(timer, "update");
if (checkmodeAux)
@@ -208,9 +197,6 @@ cMenuMyEditTimer::~cMenuMyEditTimer()
{
if (timer && addIfConfirmed)
delete timer; // apparently it wasn't confirmed
-#if VDRVERSNUM < 20300
- Timers.DecBeingEdited();
-#endif
}
void cMenuMyEditTimer::HandleSubtitle()
@@ -247,7 +233,6 @@ bool cMenuMyEditTimer::IsSingleEvent(void) const
eOSState cMenuMyEditTimer::DeleteTimer()
{
// Check if this timer is active:
-#if VDRVERSNUM > 20300
LOCK_TIMERS_WRITE;
if (!Timers) {
ERROR(tr("Epgsearch: Recursive LOCK DeleteTimer failed"));
@@ -255,19 +240,12 @@ eOSState cMenuMyEditTimer::DeleteTimer()
}
Timers->SetExplicitModify();
cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
if (timer && !addIfConfirmed) {
if (Interface->Confirm(trVDR("Delete timer?"))) {
if (timer->Recording()) {
if (Interface->Confirm(trVDR("Timer still recording - really delete?"))) {
timer->Skip();
-#if VDRVERSNUM > 20300
cRecordControls::Process(vdrtimers, time(NULL));
-#else
- cRecordControls::Process(time(NULL));
-#endif
}
else
return osContinue;
@@ -354,12 +332,8 @@ eOSState cMenuMyEditTimer::ProcessKey(eKeys Key)
{
case kOk:
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *ch = vdrchannels->GetByNumber(channel);
if (!ch)
{
@@ -441,7 +415,6 @@ eOSState cMenuMyEditTimer::ProcessKey(eKeys Key)
free(tmpFile);
free(tmpDir);
-#if VDRVERSNUM > 20300
{
LOCK_TIMERS_WRITE;
if (!Timers) {
@@ -452,12 +425,8 @@ eOSState cMenuMyEditTimer::ProcessKey(eKeys Key)
cTimers* vdrtimers = Timers;
if (*Setup.SVDRPDefaultHost)
timer->SetRemote(Setup.SVDRPDefaultHost);
-#else
- cTimers* vdrtimers = &Timers;
-#endif
if (addIfConfirmed) {
vdrtimers->Add(timer);
-#if VDRVERSNUM > 20300
vdrtimers->SetModified();
if (!HandleRemoteTimerModifications(timer)) {
delete timer;
@@ -468,15 +437,8 @@ eOSState cMenuMyEditTimer::ProcessKey(eKeys Key)
}
LOCK_SCHEDULES_READ;
timer->SetEventFromSchedule(Schedules);
-#else
- }
- timer->SetEventFromSchedule();
-#endif
timer->Matches();
gl_timerStatusMonitor->SetConflictCheckAdvised();
-#if VDRVERSNUM < 20300
- vdrtimers->SetModified();
-#endif
addIfConfirmed = false;
} else {
free(tmpFile);
diff --git a/menu_quicksearch.c b/menu_quicksearch.c
index 53aeff5..6706c6d 100644
--- a/menu_quicksearch.c
+++ b/menu_quicksearch.c
@@ -248,12 +248,8 @@ eOSState cMenuQuickSearch::ProcessKey(eKeys Key)
case kOk:
if (data.useChannel==1)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *ch = vdrchannels->GetByNumber(channelMin);
if (ch)
data.channelMin = ch;
diff --git a/menu_searchedit.c b/menu_searchedit.c
index 624a343..3a0693a 100644
--- a/menu_searchedit.c
+++ b/menu_searchedit.c
@@ -636,12 +636,8 @@ eOSState cMenuEditSearchExt::ProcessKey(eKeys Key)
case kOk:
if (data.useChannel==1)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *ch = vdrchannels->GetByNumber(channelMin);
if (ch)
data.channelMin = ch;
diff --git a/menu_searchresults.c b/menu_searchresults.c
index 9aca121..48b78d9 100644
--- a/menu_searchresults.c
+++ b/menu_searchresults.c
@@ -63,12 +63,8 @@ cMenuSearchResultsItem::cMenuSearchResultsItem(const cEvent *EventInfo, bool Epi
menuTemplate = MenuTemplate?MenuTemplate:cTemplFile::GetTemplateByName("MenuSearchResults");
search = Search;
inSwitchList = false;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
Update(vdrtimers, true);
}
@@ -83,11 +79,7 @@ bool cMenuSearchResultsItem::Update(const cTimers* vdrtimers, bool Force)
bool OldInSwitchList = inSwitchList;
bool hasMatch = false;
const cTimer* timer = NULL;
-#if VDRVERSNUM > 20300
if (event) timer = vdrtimers->GetMatch(event, &timerMatch);
-#else
- if (event) timer = ((cTimers*)vdrtimers)->GetMatch(event, &timerMatch);
-#endif
if (event) inSwitchList = (SwitchTimers.InSwitchList(event)!=NULL);
if (timer) hasMatch = true;
@@ -192,12 +184,8 @@ cMenuSearchResultsItem::cMenuSearchResultsItem(const cRecording *Recording)
void cMenuSearchResultsItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = event?vdrchannels->GetByChannelID(event->ChannelID(), true, true):NULL;
if (!event)
DisplayMenu->SetItem(Text(), Index, Current, Selectable);
@@ -245,13 +233,9 @@ eOSState cMenuSearchResults::Record(void)
UpdateCurrent();
cMenuSearchResultsItem *item = (cMenuSearchResultsItem *)Get(Current());
if (item) {
-#if VDRVERSNUM > 20300
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
if (item->timerMatch == tmFull)
{
eTimerMatch tm = tmNone;
@@ -305,21 +289,15 @@ eOSState cMenuSearchResults::Record(void)
#endif
SetAux(timer, fullaux);
-#if VDRVERSNUM > 20300
if (*Setup.SVDRPDefaultHost)
timer->SetRemote(Setup.SVDRPDefaultHost);
-#endif
vdrtimers->Add(timer);
gl_timerStatusMonitor->SetConflictCheckAdvised();
timer->Matches();
vdrtimers->SetModified();
-#if VDRVERSNUM > 20300
if (!HandleRemoteTimerModifications(timer)) {
delete timer;
}
-#else
- LogFile.iSysLog("timer %s added (active)", *timer->ToDescr());
-#endif
if (HasSubMenu())
CloseSubMenu();
@@ -337,12 +315,8 @@ eOSState cMenuSearchResults::Switch(void)
UpdateCurrent();
cMenuSearchResultsItem *item = (cMenuSearchResultsItem *)Get(Current());
if (item) {
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(item->event->ChannelID(), true, true);
if (channel && cDevice::PrimaryDevice()->SwitchChannel(channel, true))
return osEnd;
@@ -373,12 +347,8 @@ eOSState cMenuSearchResults::ShowSummary()
const cEvent *ei = ((cMenuSearchResultsItem *)Get(Current()))->event;
if (ei)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(ei->ChannelID(), true, true);
if (channel)
return AddSubMenu(new cMenuEventSearch(ei, eventObjects));
@@ -491,12 +461,8 @@ eOSState cMenuSearchResults::ProcessKey(eKeys Key)
}
if (!HasSubMenu())
{
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
if ((HadSubMenu || gl_TimerProgged) && Update(vdrtimers))
{
if (gl_TimerProgged) // when using epgsearch's timer edit menu, update is delayed because of SVDRP
@@ -814,12 +780,8 @@ bool cMenuSearchResultsForRecs::BuildList()
int current = Current();
Clear();
-#if VDRVERSNUM > 20300
LOCK_RECORDINGS_READ;
const cRecordings *vdrrecordings = Recordings;
-#else
- cRecordings *vdrrecordings = &Recordings;
-#endif
for (const cRecording *recording = vdrrecordings->First(); recording; recording = vdrrecordings->Next(recording)) {
const cRecordingInfo *recInfo = recording->Info();
if (!recInfo) continue;
@@ -878,12 +840,8 @@ bool cMenuSearchResultsForRecs::BuildList()
const cRecording *cMenuSearchResultsForRecs::GetRecording(cMenuSearchResultsItem *Item)
{
-#if VDRVERSNUM > 20300
LOCK_RECORDINGS_READ;
const cRecordings *vdrrecordings = Recordings;
-#else
- cRecordings *vdrrecordings = &Recordings;
-#endif
const cRecording *recording = vdrrecordings->GetByName(Item->FileName());
if (!recording)
ERROR(tr("Error while accessing recording!"));
diff --git a/menu_switchtimers.c b/menu_switchtimers.c
index 3b82313..59e9217 100644
--- a/menu_switchtimers.c
+++ b/menu_switchtimers.c
@@ -134,12 +134,8 @@ void cMenuSwitchTimerItem::Set()
tm *tm = localtime_r(&startTime, &tm_r);
strftime(datebuf, sizeof(datebuf), "%d.%m", tm);
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->GetByChannelID(switchTimer->channelID,true,true);
msprintf(&buffer, "%s\t%d\t%s\t%s\t%d\'\t%s~%s", switchTimer->mode==1?"":">", channel?channel->Number():-1, datebuf, TIMESTRING(startTime), switchTimer->switchMinsBefore, event->Title()?event->Title():"", event->ShortText()?event->ShortText():"");
diff --git a/menu_templateedit.c b/menu_templateedit.c
index fc7d9c3..9e2edda 100644
--- a/menu_templateedit.c
+++ b/menu_templateedit.c
@@ -187,12 +187,8 @@ eOSState cMenuEditTemplate::ProcessKey(eKeys Key)
case kOk:
if (data.useChannel==1)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *ch = vdrchannels->GetByNumber(channelMin);
if (ch)
data.channelMin = ch;
diff --git a/menu_timersdone.c b/menu_timersdone.c
index 2f38d2e..2c7a871 100644
--- a/menu_timersdone.c
+++ b/menu_timersdone.c
@@ -44,12 +44,8 @@ void cMenuTimerDoneItem::Set(void)
tm *tm = localtime_r(&timerDone->start, &tm_r);
strftime(buf, sizeof(buf), "%d.%m.%y %H:%M", tm);
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* ch = vdrchannels->GetByChannelID(timerDone->channelID, true, true);
msprintf(&buffer, "%d\t%s\t%s~%s", ch?ch->Number():0, buf, timerDone->title.c_str(), timerDone->shorttext.c_str());
SetText(buffer, false);
diff --git a/menu_whatson.c b/menu_whatson.c
index 09f46a1..fa55408 100644
--- a/menu_whatson.c
+++ b/menu_whatson.c
@@ -81,14 +81,9 @@ bool cMenuMyScheduleItem::Update(bool Force)
bool OldInSwitchList = inSwitchList;
bool hasMatch = false;
const cTimer* timer = NULL;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
if (event) timer = vdrtimers->GetMatch(event, &timerMatch);
-#else
- cTimers *vdrtimers = &Timers;
- if (event) timer = ((cTimers*)vdrtimers)->GetMatch(event, &timerMatch);
-#endif
if (event) inSwitchList = (SwitchTimers.InSwitchList(event)!=NULL);
if (timer) hasMatch = true;
@@ -430,12 +425,8 @@ void cMenuWhatsOnSearch::LoadSchedules()
if (currentChannel > maxChannel)
maxChannel = 0;
-#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))
{
if (!Channel->GroupSep())
@@ -575,13 +566,9 @@ eOSState cMenuWhatsOnSearch::Record(void)
cMenuMyScheduleItem *item = (cMenuMyScheduleItem *)Get(Current());
if (item)
{
-#if VDRVERSNUM > 20300
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
if (item->timerMatch == tmFull)
{
eTimerMatch tm = tmNone;
@@ -602,11 +589,7 @@ eOSState cMenuWhatsOnSearch::Record(void)
PrepareTimerFile(item->event, timer);
}
else
-#if VDRVERSNUM > 20300
timer = new cTimer(false, false, item->channel);
-#else
- timer = new cTimer(false, false, (cChannel*)item->channel);
-#endif
cTimer *t = vdrtimers->GetTimer(timer);
if (EPGSearchConfig.onePressTimerCreation == 0 || t || !item->event || (!t && item->event && item->event->StartTime() - (Setup.MarginStart+2) * 60 < time(NULL)))
@@ -645,25 +628,19 @@ eOSState cMenuWhatsOnSearch::Record(void)
fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
#endif
SetAux(timer, fullaux);
-#if VDRVERSNUM > 20300
if (*Setup.SVDRPDefaultHost)
timer->SetRemote(Setup.SVDRPDefaultHost);
-#endif
vdrtimers->Add(timer);
-#if VDRVERSNUM > 20300
if (!HandleRemoteTimerModifications(timer)) {
delete timer;
ERROR("Epgsearch: RemoteTimerModifications failed");
}
else {
-#endif
gl_timerStatusMonitor->SetConflictCheckAdvised();
timer->Matches();
vdrtimers->SetModified();
LogFile.iSysLog("timer %s added (active)", *timer->ToDescr());
-#if VDRVERSNUM > 20300
}
-#endif
if (HasSubMenu())
CloseSubMenu();
@@ -757,12 +734,8 @@ eOSState cMenuWhatsOnSearch::Shift(int iMinutes)
if (mi)
{
currentChannel = mi->channel->Number();
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
scheduleChannel = vdrchannels->GetByNumber(currentChannel);
}
LoadSchedules();
@@ -779,12 +752,8 @@ eOSState cMenuWhatsOnSearch::ShowSummary()
const cEvent *ei = ((cMenuMyScheduleItem *)Get(Current()))->event;
if (ei)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(ei->ChannelID(), true, true);
if (channel)
return AddSubMenu(new cMenuEventSearch(ei, eventObjects, SurfModeChannel));
@@ -910,12 +879,8 @@ eOSState cMenuWhatsOnSearch::ProcessKey(eKeys Key)
if (mi && mi->Selectable())
{
currentChannel = mi->channel->Number();
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
scheduleChannel = vdrchannels->GetByNumber(currentChannel);
}
}
diff --git a/pending_notifications.c b/pending_notifications.c
index 8d3046d..4f6955d 100644
--- a/pending_notifications.c
+++ b/pending_notifications.c
@@ -121,12 +121,8 @@ const char *cPendingNotification::ToText(void) const
free(buffer);
buffer = NULL;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(channelID, true, true);
if (!channel)
LogFile.Log(3,"invalid channel in pending notifications!");
diff --git a/recdone.c b/recdone.c
index e9b52e0..1b57926 100644
--- a/recdone.c
+++ b/recdone.c
@@ -200,12 +200,8 @@ const char *cRecDone::ToText(void)
free(buffer);
buffer = NULL;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(channelID, true, true);
if (!channel)
LogFile.Log(3,"invalid channel in recs done!");
@@ -232,12 +228,8 @@ bool cRecDone::Save(FILE *f)
int cRecDone::ChannelNr()
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel* channel = vdrchannels->GetByChannelID(channelID, true, true);
if (!channel)
return -1;
diff --git a/recstatus.c b/recstatus.c
index 587be82..c53888f 100644
--- a/recstatus.c
+++ b/recstatus.c
@@ -48,12 +48,8 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const
if (EPGSearchConfig.checkTimerConflOnRecording)
cConflictCheckThread::Init((cPluginEpgsearch*)cPluginManager::GetPlugin("epgsearch"), true);
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
for (const cTimer *ti = vdrtimers->First(); ti; ti = vdrtimers->Next(ti))
if (ti->Recording())
{
@@ -119,12 +115,8 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const
// check if timer still exists
bool found = false;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
for (const cTimer *ti = vdrtimers->First(); ti; ti = vdrtimers->Next(ti))
if (ti == tiR->timer)
{
@@ -142,12 +134,8 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const
// check if recording has ended before timer end
bool complete = true;
-#if VDRVERSNUM > 20300
LOCK_RECORDINGS_READ;
const cRecordings *vdrrecordings = Recordings;
-#else
- cRecordings *vdrrecordings = &Recordings;
-#endif
const cRecording *pRecording = vdrrecordings->GetByName(Filename);
long timerLengthSecs = tiR->timer->StopTime()-tiR->timer->StartTime();
int recFraction = 100;
diff --git a/recstatus.h b/recstatus.h
index 0d08b6c..c0104f9 100644
--- a/recstatus.h
+++ b/recstatus.h
@@ -38,9 +38,7 @@ public:
class cRecStatusMonitor : public cStatus
{
-#if VDRVERSNUM > 20300
public:
-#endif
cList<cRecDoneTimerObj> TimersRecording;
protected:
virtual void Recording(const cDevice *Device, const char *Name, const char*, bool On);
diff --git a/searchtimer_thread.c b/searchtimer_thread.c
index af33576..a99e65f 100644
--- a/searchtimer_thread.c
+++ b/searchtimer_thread.c
@@ -101,12 +101,8 @@ void cSearchTimerThread::Stop(void) {
const cTimer *cSearchTimerThread::GetTimer(const cTimers* vdrtimers, cSearchExt *searchExt, const cEvent *pEvent, bool& bTimesMatchExactly)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(pEvent->ChannelID(), true, true);
if (!channel)
return NULL;
@@ -234,18 +230,10 @@ void cSearchTimerThread::Action(void)
while(EITScanner.Active() && m_Active && Running());
LogFile.Log(1,"EPG scan finished");
}
-#if VDRVERSNUM > 20300
// wait if TimersWriteLock is set or waited for
{
LOCK_TIMERS_WRITE;
}
-#else
- if (Timers.BeingEdited())
- {
- Wait.Wait(1000);
- continue;
- }
-#endif
LogFile.iSysLog("search timer update started");
UserVars.ResetCache(); // reset internal cache of user vars
@@ -266,12 +254,8 @@ void cSearchTimerThread::Action(void)
continue;
}
{
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
pOutdatedTimers = searchExt->GetTimerList(vdrtimers, pOutdatedTimers);
} // End of Block should release ReadLock
@@ -296,12 +280,8 @@ void cSearchTimerThread::Action(void)
continue;
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(pEvent->ChannelID(), true, true);
if (!channel)
continue;
@@ -332,15 +312,11 @@ void cSearchTimerThread::Action(void)
// search for an already existing timer
bool bTimesMatchExactly = false;
-#if VDRVERSNUM > 20300
const cTimer *t = NULL;
{
LOCK_TIMERS_READ;
t = GetTimer(Timers,searchExt, pEvent, bTimesMatchExactly);
}
-#else
- const cTimer *t = GetTimer(&Timers,searchExt, pEvent, bTimesMatchExactly);
-#endif
char* Summary = NULL;
uint timerMod = tmNoChange;
@@ -534,22 +510,16 @@ void cSearchTimerThread::Action(void)
const cTimer* t = tObj->timer;
// timer could have been deleted meanwhile, so check if its still there
bool found = false;
-#if VDRVERSNUM > 20300
{
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
for(const cTimer* checkT = vdrtimers->First(); checkT; checkT = vdrtimers->Next(checkT))
if (checkT == t)
{
found = true;
break;
}
-#if VDRVERSNUM > 20300
}
-#endif
if (!found) continue;
if (TimerWasModified(t)) continue;
@@ -746,11 +716,9 @@ bool cSearchTimerThread::AddModTimer(cTimer* Timer, int index, cSearchExt* searc
}
else
tmpSummary = SummaryExtended(searchExt, Timer, pEvent);
-#if VDRVERSNUM > 20300
if (*Setup.SVDRPDefaultHost)
Timer->SetRemote(Setup.SVDRPDefaultHost);
else {
-#endif
if (index==0)
msprintf(&cmdbuf, "NEWT %d:%d:%s:%s:%s:%d:%d:%s:%s",
Flags,
@@ -777,11 +745,9 @@ bool cSearchTimerThread::AddModTimer(cTimer* Timer, int index, cSearchExt* searc
if (!SendViaSVDRP(cmdbuf))
return false;
-#if VDRVERSNUM > 20300
}
if (!HandleRemoteTimerModifications(Timer))
return false;
-#endif
if (gl_timerStatusMonitor) gl_timerStatusMonitor->SetConflictCheckAdvised();
@@ -832,13 +798,8 @@ void cSearchTimerThread::DelRecording(int index)
void cSearchTimerThread::CheckExpiredRecs()
{
LogFile.Log(1, "check for expired recordings started");
-#if VDRVERSNUM > 20300
LOCK_RECORDINGS_WRITE;
cRecordings *vdrrecordings = Recordings;
-#else
- cThreadLock RecordingsLock(&Recordings);
- cRecordings *vdrrecordings = &Recordings;
-#endif
cList<cRecordingObj> DelRecordings;
for (cRecording *recording = vdrrecordings->First(); recording && m_Active; recording = vdrrecordings->Next(recording))
{
@@ -947,16 +908,10 @@ void cSearchTimerThread::CheckManualTimers(void)
{
LogFile.Log(1, "manual timer check started");
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
LOCK_SCHEDULES_READ;
const cSchedules *schedules = Schedules;
-#else
- cTimers *vdrtimers = &Timers;
- cSchedulesLock SchedulesLock;
- const cSchedules* schedules = cSchedules::Schedules(SchedulesLock);
-#endif
for (const cTimer *ti = vdrtimers->First(); ti && m_Active; ti = vdrtimers->Next(ti))
{
@@ -1068,13 +1023,8 @@ void cSearchTimerThread::CheckEPGHours()
time_t checkTime = time(NULL) + EPGSearchConfig.checkEPGHours * 60 * 60;
-#if VDRVERSNUM > 20300
LOCK_SCHEDULES_READ;
const cSchedules *schedules = Schedules;
-#else
- cSchedulesLock SchedulesLock;
- const cSchedules* schedules = cSchedules::Schedules(SchedulesLock);
-#endif
cChannelGroup channelsWithSmallEPG;
cChannelGroupItem* channelInGroup = channelGroup->channels.First();
diff --git a/services.c b/services.c
index 3c2dac8..02b9934 100644
--- a/services.c
+++ b/services.c
@@ -145,24 +145,16 @@ std::list<std::string> cEpgsearchServiceHandler::TranslateResults(cSearchResults
eTimerMatch timerMatch;
bool hasTimer = false;
-#if VDRVERSNUM > 20300
LOCK_TIMERS_READ;
const cTimers *vdrtimers = Timers;
-#else
- cTimers *vdrtimers = &Timers;
-#endif
if (vdrtimers->GetMatch(pEvent, &timerMatch))
hasTimer = (timerMatch == tmFull);
if (!result->search->useAsSearchTimer)
result->needsTimer = false;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(pEvent->ChannelID(), true, true);
int timerMode = hasTimer?1:(result->needsTimer?2:0);
diff --git a/status_thread.c b/status_thread.c
index f9c7a3e..1092694 100644
--- a/status_thread.c
+++ b/status_thread.c
@@ -41,8 +41,6 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
#include <vdr/tools.h>
#include <vdr/plugin.h>
-#if VDRVERSNUM > 20300
-
#define ALLOWED_BREAK_INSECS 2
extern int updateForced;
@@ -250,4 +248,3 @@ void cStatusThread::Action(void)
}
m_Active = false;
}
-#endif
diff --git a/switchtimer.c b/switchtimer.c
index d145c7a..7df4352 100644
--- a/switchtimer.c
+++ b/switchtimer.c
@@ -114,13 +114,8 @@ const cEvent* cSwitchTimer::Event()
const cEvent* event = NULL;
if (startTime > now)
{
-#if VDRVERSNUM > 20300
LOCK_SCHEDULES_READ;
const cSchedules *schedules = Schedules;
-#else
- cSchedulesLock SchedulesLock;
- const cSchedules* schedules = cSchedules::Schedules(SchedulesLock);
-#endif
if (!schedules) return NULL;
const cSchedule *Schedule = schedules->GetSchedule(channelID);
if (Schedule)
@@ -141,12 +136,8 @@ cString cSwitchTimer::ToText(bool& ignore)
ignore = true;
return NULL;
}
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(channelID, true, true);
if (!channel) return NULL;
cString buffer = cString::sprintf("%s:%u:%ld:%d:%d:%d",
diff --git a/switchtimer_thread.c b/switchtimer_thread.c
index 3b2ce99..9da5421 100644
--- a/switchtimer_thread.c
+++ b/switchtimer_thread.c
@@ -88,12 +88,8 @@ void cSwitchTimerThread::Action(void)
{
if (switchTimer->startTime - now < switchTimer->switchMinsBefore*60 + MSG_DELAY + 1)
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(switchTimer->channelID, true, true);
bool doSwitch = (switchTimer->mode == 0);
bool doAsk = (switchTimer->mode == 2);
diff --git a/templatefile.c b/templatefile.c
index fdce3bf..830548b 100644
--- a/templatefile.c
+++ b/templatefile.c
@@ -210,12 +210,8 @@ bool cTemplFile::Parse(const char *Name, const char *Value)
void cTemplFile::PrepareDefaultTemplates()
{
char channelnr[20] = "";
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
sprintf(channelnr, "%%chnr%%:%d|", CHNUMWIDTH);
bool text2skin = !(strcmp(Setup.OSDSkin, "soppalusikka") == 0 ||
diff --git a/timer_thread.c b/timer_thread.c
index f319426..ec82977 100644
--- a/timer_thread.c
+++ b/timer_thread.c
@@ -89,17 +89,9 @@ void cTimerThread::Action(void)
m_Active=false;
break;
}
-#if VDRVERSNUM > 20300
{
LOCK_TIMERS_WRITE;
}
-#else
- if (Timers.BeingEdited())
- {
- sleepSec(1);
- continue;
- }
-#endif
bool bSuccess = SendViaSVDRP(m_cmd);
if (!bSuccess)
{
diff --git a/timerdone.c b/timerdone.c
index 06d2b23..34d3b97 100644
--- a/timerdone.c
+++ b/timerdone.c
@@ -126,12 +126,8 @@ bool cTimerDone::Parse(const char *s)
cString cTimerDone::ToText(void) const
{
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(channelID, true, true);
string info = string(DAYDATETIME(start)) + " - " + string(channel?channel->Name():"");
@@ -153,13 +149,8 @@ bool cTimerDone::Save(FILE *f)
const cEvent* cTimerDone::GetEvent() const
{
-#if VDRVERSNUM > 20300
LOCK_SCHEDULES_READ;
const cSchedules *schedules = Schedules;
-#else
- cSchedulesLock SchedulesLock;
- const cSchedules* schedules = cSchedules::Schedules(SchedulesLock);
-#endif
if (!schedules) return NULL;
const cSchedule *Schedule = schedules->GetSchedule(channelID);
if (!Schedule) return NULL;
diff --git a/uservars.h b/uservars.h
index 15be5cf..f19ea06 100644
--- a/uservars.h
+++ b/uservars.h
@@ -176,12 +176,8 @@ public:
string Evaluate(const cEvent* e, bool escapeStrings = false)
{
if (!e) return "";
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(e->ChannelID(), true);
if (!channel) return "";
@@ -421,12 +417,8 @@ public:
string Evaluate(const cEvent* e, bool escapeStrings = false)
{
if (!e) return "";
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(e->ChannelID(), true);
string res = channel?channel->ShortName(true):"";
if (escapeStrings) return "'" + EscapeString(res) + "'"; else return res;
@@ -439,12 +431,8 @@ public:
string Evaluate(const cEvent* e, bool escapeStrings = false)
{
if (!e) return "";
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(e->ChannelID(), true);
string res = channel?channel->Name():"";
if (escapeStrings) return "'" + EscapeString(res) + "'"; else return res;
@@ -457,12 +445,8 @@ class cChannelDataVar : public cInternalVar {
string Evaluate(const cEvent* e, bool escapeStrings = false)
{
if (!e) return "";
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(e->ChannelID(), true);
return channel?CHANNELSTRING(channel):"";
}
@@ -475,12 +459,8 @@ public:
{
if (!e) return "";
ostringstream os;
-#if VDRVERSNUM > 20300
LOCK_CHANNELS_READ;
const cChannels *vdrchannels = Channels;
-#else
- cChannels *vdrchannels = &Channels;
-#endif
const cChannel *channel = vdrchannels->GetByChannelID(e->ChannelID(), true);
while(channel && !channel->GroupSep())
channel = vdrchannels->Prev(channel);