Correct an error with the recording sign in grid

This commit is contained in:
kamel5 2019-04-06 18:22:24 +02:00
parent 9009f4f385
commit 6f7042d41f
4 changed files with 30 additions and 47 deletions

View File

@ -5,21 +5,11 @@ cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime
this->channel = channel;
this->num = num;
this->myTime = myTime;
#if VDRVERSNUM >= 20301
hasTimer = false;
const cSchedule *Schedule = NULL;
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
if (schedules) {
Schedule = schedules->GetSchedule(channel);
hasTimer = Schedule ? Schedule->HasTimer() : false;
}
#else
#if VDRVERSNUM < 20301
hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
#if VDRVERSNUM >= 20301
#else
#if VDRVERSNUM < 20301
schedulesLock = new cSchedulesLock(false, 100);
#endif
header = NULL;
@ -29,8 +19,7 @@ cChannelColumn::~cChannelColumn(void) {
if (header)
delete header;
grids.Clear();
#if VDRVERSNUM >= 20301
#else
#if VDRVERSNUM < 20301
delete schedulesLock;
#endif
}
@ -383,25 +372,14 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid,
}
void cChannelColumn::SetTimers() {
#if VDRVERSNUM >= 20301
hasTimer = false;
const cSchedule *Schedule = NULL;
{
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
if (schedules) {
Schedule = schedules->GetSchedule(channel);
hasTimer = Schedule ? Schedule->HasTimer() : false;
}
}
#else
#if VDRVERSNUM < 20301
hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
bool gridHadTimer = grid->HasTimer();
grid->SetTimer();
if (gridHadTimer != grid->HasTimer())
if (gridHadTimer || gridHadTimer != grid->HasTimer())
grid->SetDirty();
bool gridHadSwitchTimer = grid->HasSwitchTimer();
grid->SetSwitchTimer();

View File

@ -62,22 +62,23 @@ void cEpgGrid::PositionPixmap() {
}
void cEpgGrid::SetTimer() {
hasTimer = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Event_v1_0 rt;
rt.event = event;
if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt))
hasTimer = true;
else
hasTimer = false;
#if VDRVERSNUM >= 30400
} else if (event->HasTimer()) {
#if VDRVERSNUM >= 20301
} else {
eTimerMatch TimerMatch = tmNone;
LOCK_TIMERS_READ;
const cTimers *timers = Timers;
if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
hasTimer = true;
#else
} else if (column->HasTimer()) {
hasTimer = event->HasTimer();
#endif
} else {
hasTimer = false;
}
}

View File

@ -50,9 +50,17 @@ bool cRecManager::CheckEventForTimer(const cEvent *event) {
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
if (rtMatch.timerMatch == tmFull)
hasTimer = true;
} else
} else {
#if VDRVERSNUM >= 20301
eTimerMatch TimerMatch = tmNone;
LOCK_TIMERS_READ;
const cTimers *timers = Timers;
if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
hasTimer = true;
#else
hasTimer = event->HasTimer();
#endif
}
return hasTimer;
}
@ -175,7 +183,6 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
}
void cRecManager::DeleteTimer(int timerID) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
#if VDRVERSNUM >= 20301
cTimer *t;
{
@ -191,7 +198,6 @@ void cRecManager::DeleteTimer(int timerID) {
}
void cRecManager::DeleteTimer(const cEvent *event) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
if (!event)
return;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
@ -202,7 +208,6 @@ void cRecManager::DeleteTimer(const cEvent *event) {
}
void cRecManager::DeleteLocalTimer(const cEvent *event) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
const cTimer *t;
#if VDRVERSNUM >= 20301
{
@ -218,7 +223,6 @@ void cRecManager::DeleteLocalTimer(const cEvent *event) {
}
void cRecManager::DeleteTimer(const cTimer *timer) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
#if VDRVERSNUM >= 20301
LOCK_TIMERS_WRITE;
cTimers* timers = Timers;

View File

@ -139,11 +139,15 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
if (!channelStart)
return;
#if VDRVERSNUM >= 20301
const cChannels *channels;
{
LOCK_CHANNELS_READ;
for (const cChannel *channel = channelStart; channel; channel = Channels->Next(channel)) {
channels = Channels;
}
#else
for (const cChannel *channel = channelStart; channel; channel = Channels.Next(channel)) {
cChannels *channels = &Channels;
#endif
for (const cChannel *channel = channelStart; channel; channel = channels->Next(channel)) {
if (!channel->GroupSep()) {
if (channelGroups->IsInLastGroup(channel)) {
break;
@ -165,11 +169,7 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
int numCurrent = columns.Count();
int numBack = tvguideConfig.numGrids - numCurrent;
int newChannelNumber = columns.First()->getChannel()->Number() - numBack;
#if VDRVERSNUM >= 20301
const cChannel *newStart = Channels->GetByNumber(newChannelNumber);
#else
const cChannel *newStart = Channels.GetByNumber(newChannelNumber);
#endif
const cChannel *newStart = channels->GetByNumber(newChannelNumber);
readChannels(newStart);
}
}