Skip to content

Commit

Permalink
Change ChannelBase::GetCardID() to return uint instead of int.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kristjansson committed Dec 7, 2012
1 parent c1c09f7 commit b9637f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 4 additions & 5 deletions mythtv/libs/libmythtv/recorders/channelbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ void ChannelBase::HandleScriptEnd(bool ok)
/** \fn ChannelBase::GetCardID(void) const
* \brief Returns card id.
*/
int ChannelBase::GetCardID(void) const
uint ChannelBase::GetCardID(void) const
{
if (m_cardid > 0)
return m_cardid;
Expand All @@ -868,10 +868,9 @@ int ChannelBase::GetCardID(void) const
return m_pParent->GetCaptureCardNum();

if (GetDevice().isEmpty())
return -1;
return 0;

uint tmpcardid = CardUtil::GetFirstCardID(GetDevice());
return (tmpcardid <= 0) ? -1 : tmpcardid;
return CardUtil::GetFirstCardID(GetDevice());
}

int ChannelBase::GetChanID() const
Expand Down Expand Up @@ -907,7 +906,7 @@ bool ChannelBase::InitializeInputs(void)
{
ClearInputMap();

uint cardid = max(GetCardID(), 0);
uint cardid = GetCardID();
if (!cardid)
{
LOG(VB_GENERAL, LOG_ERR,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/channelbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ChannelBase
// \brief Set cardid for scanning
void SetCardID(uint _cardid) { m_cardid = _cardid; }

virtual int GetCardID(void) const;
virtual uint GetCardID(void) const;

static ChannelBase *CreateChannel(
TVRec *tv_rec,
Expand Down
4 changes: 1 addition & 3 deletions mythtv/libs/libmythtv/recorders/dvbchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,6 @@ bool DVBChannel::ProbeTuningParams(DTVMultiplex &tuning) const
*/
int DVBChannel::GetChanID() const
{
int cardid = GetCardID();

MSqlQuery query(MSqlQuery::InitCon());

query.prepare("SELECT chanid "
Expand All @@ -948,7 +946,7 @@ int DVBChannel::GetChanID() const
" cardinput.cardid = :CARDID");

query.bindValue(":CHANNUM", m_curchannelname);
query.bindValue(":CARDID", cardid);
query.bindValue(":CARDID", GetCardID());

if (!query.exec() || !query.isActive())
{
Expand Down

0 comments on commit b9637f8

Please sign in to comment.