[mythtv-commits] Ticket #13069: Fix QObject related compile warnings in trunk

MythTV noreply at mythtv.org
Thu Nov 2 00:55:35 UTC 2017


#13069: Fix QObject related compile warnings in trunk
--------------------------------------+-----------------------------
 Reporter:  David Hampton <mythtv@…>  |          Owner:  dhampton
     Type:  Developer Task            |         Status:  accepted
 Priority:  minor                     |      Milestone:  29.0
Component:  MythTV - General          |        Version:  Master Head
 Severity:  medium                    |     Resolution:
 Keywords:                            |  Ticket locked:  0
--------------------------------------+-----------------------------

Comment (by David Hampton <mythtv@…>):

 In [changeset:"752a0070cbeed18eccb322c1c103eb51370bc665/mythtv"]:
 {{{
 #!CommitTicketReference repository="mythtv"
 revision="752a0070cbeed18eccb322c1c103eb51370bc665"
 Eliminate MythCookieJar copy constructor.

 MythCookieJar fix attempt #3.

 The MythCookieJar object is based on QObject and therefore shouldn't
 have a public copy constructor. Unfortunately its two main purposes
 are to load/save cookies from/to a file, and to copy cookies between
 multiple cookie jars.  This fix simply splits the copy constructor
 into its two components; creating a new jar and copying cookies from
 one jar to another.  It is probably not the ideal solution, but it has
 the smallest impact on the existing code base.

 General: Instances of QObject (and its subclasses) should be
 considered unique items that cannot be copied.  Knowing that each
 object has only one parent and an arbitrary number of children makes
 it easier to understand this. Even if you "clone" the object by
 setting all the member variables to the same values, you can't set the
 parent and child variables to the same values without screwing up the
 one-to-many relationship of parent to children.

 See:
 http://doc.qt.io/qt-5/qobject.html#Q_DISABLE_COPY
 https://www.ics.com/designpatterns/book/qobject.html

 Refs #13069
 }}}

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13069#comment:5>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list