Ticket #2206: channelbase_browse_mode.diff

File channelbase_browse_mode.diff, 1005 bytes (added by Isaac Richards, 13 years ago)
  • channelbase.cpp

     
    7474
    7575uint ChannelBase::GetNextChannel(const QString &channum, int direction) const
    7676{
     77/*
    7778    InputMap::const_iterator it = inputs.find(currentInputID);
    7879    if (it == inputs.end())
    7980        return 0;
    8081
    8182    uint chanid = ChannelUtil::GetChanID((*it)->sourceid, channum);
     83*/
     84    // Problem: In 'browse mode' when we transition to a different inputid the
     85    // currentInputID and curchannelname are not updated correctly(?) and can't be used.
     86    // Soln: Use allchannels to get the chanid from the channum.
     87    uint chanid = 0;
     88    DBChanList::const_iterator it = allchannels.begin();
     89    while (it != allchannels.end())
     90    {
     91        if (it->channum == channum)
     92        {
     93            chanid = it->chanid;
     94            break;
     95        }
     96        it++;
     97    }
    8298    return GetNextChannel(chanid, direction);
    8399}
    84100