[mythtv] Sort by programid bug

John Patrick Poet john at BlueSkyTours.com
Tue Feb 8 21:31:05 UTC 2005


On Tue, 1 Feb 2005, Bruce Markey wrote:

> > mythtv/programs/mythfrontend/playbackbox.cpp
> > John Poet's patch to allow sorting of episodes by programid
> > instead of recording date.
>
> John, sorry I didn't look at this before it went in but in
> playing with it now, I've found a significant bug. After
> playing a file then exiting playback, it does not find it's
> matching item in the list and the selection highlight seems
> to always fall to the last item on the list.
>
> I think what needs to be addressed is in the section starting
> around line 1234:
>
>     // Try to find our old place in the title list.  Scan the new
>     // titles backwards until we find where we were or go past.  This
>     // is somewhat inefficient, but it works.
>
>     QString oldsTitle = oldtitle;
>     oldsTitle.remove(prefixes);
>     titleIndex = titleList.count() - 1;
>     for (int i = titleIndex; i >= 0; i--)
>     {
>
>         sTitle = titleList[i];
>         sTitle.remove(prefixes);
>
>         if (oldsTitle > sTitle)
>             break;
>
>         titleIndex = i;
>
>         if (oldsTitle == sTitle)
>             break;
>     }
>
> This loop is geared to match a list sorted by title but you need
> some sort of "if (episodeSort == "Id")" variation that loops
> over programid. This means that you'll probably need some sort
> of programidList also.
>
> --  bjm


Yeah, I see that.  It would be nice to come up with some generic solution
which is independent of the sort method, but that would probably just make
it unnecessarily complicated.

I will look into this ASAP, but I see a that .17 is immanent and may not get
it done it time.  If you want to just remove this option from the current
CVS, for the .17 release, feel free to do so.

Thanks,

John


More information about the mythtv-dev mailing list