Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#6862 closed defect (fixed)

Refactor ProgramInfo so it can be used in plugins.

Reported by: danielk Owned by: danielk
Priority: minor Milestone: 0.23
Component: MythTV - General Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This is just a first pass. It compiles, but I haven't even run it yet.

The split on ProgramInfo/RecordingInfo? and remoteutil/tvremoteutil is purely on linkage right now. I plan to make the split make functional sense later.

ProgramList? & RecordingList? also need some attention, right now there is lots of code duplication. And as noted in the pre-existing comment, a few places could benefit from different containers than a linked list. I will probably rewrite the helper code to be container agnostic to avoid code duplication and then use the appropriate containers in the code.

There are also a some TODO's, for instance comm flagging does not set the edit flag in programinfo.

Attachments (4)

6862-v1.patch.bz2 (59.1 KB) - added by danielk 10 years ago.
6862-v2.patch (92.8 KB) - added by danielk 10 years ago.
2nd pass of refactoring
6862-v4.patch (93.4 KB) - added by danielk 10 years ago.
updated patch
6862-v5.patch (93.8 KB) - added by danielk 10 years ago.
Updated patch

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by danielk

Attachment: 6862-v1.patch.bz2 added

comment:1 Changed 10 years ago by danielk

(In [21408]) Refs #6862. Refactor ProgramInfo? so that it can be used in plugins and split remoteutil.{cpp,h} for the same purpose.

This creates a new class RecordingInfo? which is just the ProgramInfo? with the ScheduledRecording? pointer and those functions which are particular to scheduling recordings as opposed to mythvideo videos and the like.

ProgramInfo? still contains the same fields and serializes the same way.

As noted in the ticket, ProgramList/RecordingList? are non-ideal as is. But changing those requires code changes. This changeset mostly just moves things around to avoid libmythtv linkage in the plugins and the associated ABI problems.

This changeset changes the binary ABI for plugins so a distclean is recommended and full rebuild of the plugins is required.

comment:2 Changed 10 years ago by danielk

Milestone: 0.220.23

The DB load method refactors for ProgramList/RecordingList? can wait until 0.23.

comment:3 Changed 10 years ago by Janne Grunau

(In [21414]) fix linking with --enable-symbol-visibility after [21408]. Refs #6862

Changed 10 years ago by danielk

Attachment: 6862-v2.patch added

2nd pass of refactoring

comment:4 Changed 10 years ago by danielk

This second pass removes a little over 700 lines of redundant code. There were some bugs that crept in due to the reduntant code only being updated in one of several locations, so this is not a functionally neutral patch.

Changed 10 years ago by danielk

Attachment: 6862-v4.patch added

updated patch

Changed 10 years ago by danielk

Attachment: 6862-v5.patch added

Updated patch

comment:5 Changed 10 years ago by danielk

Resolution: fixed
Status: newclosed

(In [22799]) Fixes #6862. ProgramList/RecordingList? refactor.

This eliminates a few hundred lines of of duplicated code. There had been some divergance in the code that initialized ProgramInfo? lists despite the comments in the code on how to keep them in sync. This attempts to merge all of those but if anyone notices a missing flag or some such thing please open a ticket. This also eliminates some of the Q3PtrList compatibility methods, these were left in as part of the initial Qt4 port, but were not flagged as depreciated and so unfortunately were used in some new code. The ProgramDetail? class has put into it's own header and cpp file so it can be moved back into to the appropriate library. Finally, the data structure has been changed from a doubly linked list to a deque for greater speed in most places where it is used. (Uncomment '#define PGLIST_USE_LINKED_LIST' if you want to time the linked list version in some algorithm.)

comment:6 Changed 10 years ago by danielk

(In [22836]) Refs #6862. Trim a few lines of unnecessary code, wrt to ProgramInfo? refactor.

Note: See TracTickets for help on using tickets.