Ticket #2592: 2592.patch

File 2592.patch, 1.4 KB (added by myth@…, 13 years ago)

Fix (kinda)

  • mythplugins/mythmusic/mythmusic/metadata.cpp

     
    12521252    }
    12531253}
    12541254
    1255 
    12561255void MusicNode::printYourself(int indent_level)
    12571256{
    12581257
     
    12911290    return ((Metadata*)item1)->compare((Metadata*)item2);
    12921291}
    12931292
     1293void MetadataPtrList::sort()
     1294{
     1295    // Ensure everything has a track number, fixes ticket#2592. Best
     1296    // effort purely, may assign an already used track number to
     1297    // another track. Warranty void when read.
     1298    int pos = 1;
     1299    for (QPtrListIterator<Metadata> it (*this); *it; ++it && ++pos)
     1300    {
     1301        if ((*it)->Track() == 0)
     1302            (*it)->setTrack(pos);
     1303    }
     1304    return QPtrList<Metadata>::sort();
     1305}
     1306
    12941307int MusicNodePtrList::compareItems (QPtrCollection::Item item1,
    12951308                                    QPtrCollection::Item item2)
    12961309{
  • mythplugins/mythmusic/mythmusic/metadata.h

     
    191191  public:
    192192    MetadataPtrList() {}
    193193    ~MetadataPtrList() {}
     194    void sort();       
    194195
    195196  protected:
    196197    int compareItems(QPtrCollection::Item item1,