[mythtv-commits] Ticket #1354: MythVideo fails to display files with square brackets in properly

MythTV mythtv at cvs.mythtv.org
Wed Mar 1 10:56:39 UTC 2006


#1354: MythVideo fails to display files with square brackets in properly
----------------------------------------+-----------------------------------
 Reporter:  scoultas at steveandcathy.com  |        Owner:  jdonavan
     Type:  defect                      |       Status:  new     
 Priority:  minor                       |    Milestone:  unknown 
Component:  mythvideo                   |      Version:  0.19    
 Severity:  low                         |   Resolution:          
----------------------------------------+-----------------------------------
Comment (by sphery <mtdean at thirdcontact.com>):

 As discussed in http://www.gossamer-
 threads.com/lists/mythtv/dev/184376#184376 , removing the bracketed text
 from the filename to create the video name is most likely not a bug (but,
 rather, the intended behavior); however, the inability to display multiple
 videos with the same name is a bug.

 The problem is in videolist.cpp.  If the user chooses to sort videos by
 title, !VideoList re-sorts the videos after stripping articles from the
 beginning of the video name.  (All other sorting is done by MySQL with the
 query, so the bug only appears if sorting by title.)  The !VideoList uses
 a hack with a QMap keyed by the video name without the initial articles to
 perform the sort.  Because the QMap replaces values given the same key,
 only one video with any given name (before or after the initial articles
 are removed) survives the sort.

 Since QMap's insertMulti() function and QMultiMap were introduced in QT4,
 I couldn't just modify the hack to use either of them, instead.  And,
 since QPtrList is only available in QT4 as a QT3 compatibility class, it
 seemed that doing a proper sort by creating a subclass of QPtrList and
 providing a compareItems() function would result in a new class that would
 be completely unnecessary if Myth is ported to QT4 (especially since QT4
 allows passing a "compare" function to qSort() for sorting a QList).

 Therefore, I added a hack to the hack by appending the string version of
 the video's ID to the end of the key.  That way, each key used for the map
 is unique and all videos survive the sort.

 If you prefer a proper sort, let me know and I'll do another patch.
 (Sorry about the long description for the short patch. :)

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/1354>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list