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->channel = channel;
this->num = num; this->num = num;
this->myTime = myTime; this->myTime = myTime;
#if VDRVERSNUM >= 20301 #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
hasTimer = channel->HasTimer(); hasTimer = channel->HasTimer();
#endif #endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel); hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
#if VDRVERSNUM >= 20301 #if VDRVERSNUM < 20301
#else
schedulesLock = new cSchedulesLock(false, 100); schedulesLock = new cSchedulesLock(false, 100);
#endif #endif
header = NULL; header = NULL;
@ -29,8 +19,7 @@ cChannelColumn::~cChannelColumn(void) {
if (header) if (header)
delete header; delete header;
grids.Clear(); grids.Clear();
#if VDRVERSNUM >= 20301 #if VDRVERSNUM < 20301
#else
delete schedulesLock; delete schedulesLock;
#endif #endif
} }
@ -383,25 +372,14 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid,
} }
void cChannelColumn::SetTimers() { void cChannelColumn::SetTimers() {
#if VDRVERSNUM >= 20301 #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
hasTimer = channel->HasTimer(); hasTimer = channel->HasTimer();
#endif #endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel); hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
bool gridHadTimer = grid->HasTimer(); bool gridHadTimer = grid->HasTimer();
grid->SetTimer(); grid->SetTimer();
if (gridHadTimer != grid->HasTimer()) if (gridHadTimer || gridHadTimer != grid->HasTimer())
grid->SetDirty(); grid->SetDirty();
bool gridHadSwitchTimer = grid->HasSwitchTimer(); bool gridHadSwitchTimer = grid->HasSwitchTimer();
grid->SetSwitchTimer(); grid->SetSwitchTimer();

View File

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

View File

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

View File

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