Ticket #10411: channelgroup-fix.diff

File channelgroup-fix.diff, 1.9 KB (added by anonymous, 8 years ago)
  • mythtv/programs/mythfrontend/guidegrid.cpp

    diff --git a/mythtv/programs/mythfrontend/guidegrid.cpp b/mythtv/programs/mythfrontend/guidegrid.cpp
    index 870975e..de379c7 100644
    a b void GuideGrid::generateListings() 
    16231623
    16241624void GuideGrid::ChannelGroupMenu(int mode)
    16251625{
    1626     if (m_changrplist.empty())
     1626    ChannelGroupList channels = ChannelGroup::GetChannelGroups(mode == 0);
     1627   
     1628    if (channels.empty())
    16271629    {
    16281630      QString message = tr("You don't have any channel groups defined");
    16291631
    void GuideGrid::ChannelGroupMenu(int mode) 
    16501652        {
    16511653            // add channel to group menu
    16521654            menuPopup->SetReturnEvent(this, "channelgrouptogglemenu");
    1653             ChannelGroupList channels = ChannelGroup::GetChannelGroups(true);
    1654             for (uint i = 0; i < channels.size(); ++i)
    1655                 menuPopup->AddButton(channels[i].name);
    16561655        }
    16571656        else
    16581657        {
    16591658            // switch to channel group menu
    16601659            menuPopup->SetReturnEvent(this, "channelgroupmenu");
    16611660            menuPopup->AddButton(QObject::tr("All Channels"));
    1662             for (uint i = 0; i < m_changrplist.size(); ++i)
    1663                 menuPopup->AddButton(m_changrplist[i].name);
    16641661        }
    16651662
     1663        for (uint i = 0; i < channels.size(); ++i)
     1664            menuPopup->AddButton(channels[i].name);
     1665
    16661666        menuPopup->AddButton(tr("Cancel"));
    16671667
    16681668        popupStack->AddScreen(menuPopup);
    void GuideGrid::toggleChannelFavorite(int grpid) 
    17041704        // Only allow delete if viewing the favorite group in question
    17051705        ChannelGroup::ToggleChannel(chanid, grpid, true);
    17061706
     1707    //regenerate the list of non empty group in case it did change
     1708    m_changrplist = ChannelGroup::GetChannelGroups(false);
     1709
    17071710    // If viewing favorites, refresh because a channel was removed
    17081711    if (m_changrpid != -1)
    17091712    {