Ticket #4098: libmythtv-channeleditor-rememberLastChannel-22102007.diff

File libmythtv-channeleditor-rememberLastChannel-22102007.diff, 803 bytes (added by Matthew Wire <devel@…>, 17 years ago)
  • libs/libmythtv/channeleditor.cpp

     
    116116    clearSelections();
    117117    addSelection(QObject::tr("(New Channel)"));
    118118    bool fAllSources = true;
     119    int nCount = 0;
    119120
    120121    QString querystr = "SELECT channel.name,channum,chanid ";
    121122
     
    184185                name += " (" + sourceid  + ")";
    185186
    186187            addSelection(name, chanid, (chanid == currentValue) ? true : false);
     188
     189            nCount++;
     190           
     191            // nCount increments first since "(New Channel)" offsets list by one
     192            if (chanid == currentValue)
     193                setCurrentItem(nCount);
    187194        }
    188195    }
    189196}