Skip to content

Commit

Permalink
[pvr] fixed CPVRTimers::DeleteTimersOnChannel after 32343cb
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Oct 22, 2012
1 parent 7a766f7 commit a466e13
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions xbmc/pvr/timers/PVRTimers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,23 +440,22 @@ bool CPVRTimers::DeleteTimersOnChannel(const CPVRChannel &channel, bool bDeleteR
{
for (vector<CPVRTimerInfoTagPtr>::iterator timerIt = it->second->begin(); timerIt != it->second->end(); )
{
CPVRTimerInfoTagPtr timer = (*timerIt);

if (bCurrentlyActiveOnly &&
(CDateTime::GetCurrentDateTime() < timer->StartAsLocalTime() ||
CDateTime::GetCurrentDateTime() > timer->EndAsLocalTime()))
continue;

if (!bDeleteRepeating && timer->m_bIsRepeating)
continue;

if (timer->ChannelNumber() == channel.ChannelNumber() && timer->m_bIsRadio == channel.IsRadio())
bool bDeleteActiveItem = !bCurrentlyActiveOnly ||
(CDateTime::GetCurrentDateTime() > (*timerIt)->StartAsLocalTime() &&
CDateTime::GetCurrentDateTime() < (*timerIt)->EndAsLocalTime());
bool bDeleteRepeatingItem = bDeleteRepeating || !(*timerIt)->m_bIsRepeating;
bool bChannelsMatch = (*timerIt)->ChannelNumber() == channel.ChannelNumber() &&
(*timerIt)->m_bIsRadio == channel.IsRadio();

if (bDeleteActiveItem && bDeleteRepeatingItem && bChannelsMatch)
{
bReturn = timer->DeleteFromClient(true) || bReturn;
bReturn = (*timerIt)->DeleteFromClient(true) || bReturn;
timerIt = it->second->erase(timerIt);
}
else
timerIt++;
{
++timerIt;
}
}
}

Expand Down

0 comments on commit a466e13

Please sign in to comment.