Ticket #6318: recGroup-cycle-1a.patch

File recGroup-cycle-1a.patch, 2.8 KB (added by jppoet@…, 17 years ago)

Remove some useless code

  • programs/mythfrontend/playbackbox.cpp

     
    345345    }
    346346
    347347    // recording group stuff
     348    m_recGroupIdx = -1;
    348349    m_recGroupType.clear();
    349350    m_recGroupType[m_recGroup] = (displayCat) ? "category" : "recgroup";
    350351    if (m_groupnameAsAllProg)
     
    14281429        m_titleList << tr("LiveTV");
    14291430    m_titleList << sortedList.values();
    14301431
     1432    // Populate list of recording groups
     1433    if (m_progCache)
     1434    {
     1435        QString name;
     1436
     1437        m_recGroups.clear();
     1438        m_recGroupIdx = -1;
     1439
     1440        m_recGroups.append("All Programs");
     1441
     1442        MSqlQuery query(MSqlQuery::InitCon());
     1443
     1444        query.prepare("SELECT distinct recgroup from recorded WHERE "
     1445                      "deletepending = 0 ORDER BY recgroup");
     1446        if (query.exec())
     1447        {
     1448            while (query.next())
     1449            {
     1450                name = query.value(0).toString();
     1451                if (name != "Deleted" && name != "LiveTV")
     1452                    m_recGroups.append(name);
     1453            }
     1454
     1455            m_recGroupIdx = m_recGroups.indexOf(m_recGroup);
     1456            if (m_recGroupIdx < 0)
     1457                m_recGroupIdx = 0;
     1458        }
     1459    }
     1460
    14311461    updateGroupList();
    14321462    updateUsage();
    14331463
     
    31473177            m_viewMask = m_viewMaskToggle(m_viewMask, VIEW_TITLES);
    31483178            m_connected = FillList(true);
    31493179        }
     3180        else if (action == "PAGERIGHT")
     3181        {
     3182            if (m_recGroupIdx >= 0 && !m_recGroups.empty())
     3183            {
     3184                if (++m_recGroupIdx >= m_recGroups.size())
     3185                    m_recGroupIdx = 0;
     3186                displayRecGroup(m_recGroups[m_recGroupIdx]);
     3187            }
     3188        }
     3189        else if (action == "PAGELEFT")
     3190        {
     3191            if (m_recGroupIdx >= 0 && !m_recGroups.empty())
     3192            {
     3193                if (--m_recGroupIdx < 0)
     3194                    m_recGroupIdx = m_recGroups.size() - 1;
     3195                displayRecGroup(m_recGroups[m_recGroupIdx]);
     3196            }
     3197        }
    31503198        else if (action == "CHANGERECGROUP")
    31513199            showGroupFilter();
    31523200        else if (action == "CHANGEGROUPVIEW")
  • programs/mythfrontend/playbackbox.h

     
    373373    int                 m_progsInDB;  ///< total number of recordings in DB
    374374    bool                m_isFilling;
    375375
     376    QStringList         m_recGroups;
     377    int                 m_recGroupIdx;
     378
    376379    // Other state
    377380    /// Program currently selected for deletion
    378381    ProgramInfo *m_delItem;