Ticket #8572: mythtv-8572-compile_fixes_for_qt_4_7-templates.patch

File mythtv-8572-compile_fixes_for_qt_4_7-templates.patch, 3.2 KB (added by sphery, 14 years ago)

Hack to just make MythTV compile. This marks the 2 locations that still need fixing in trunk and -fixes after [26391] (and includes a third change that's only necessary because of the hack that's being used elsewhere).

  • libs/libmyth/mythdeque.h

    ---
     libs/libmyth/mythdeque.h    |    9 	8 +	1 -	0 !
     libs/libmythtv/tv_rec.h     |    6 	5 +	1 -	0 !
     libs/libmythupnp/eventing.h |    9 	7 +	2 -	0 !
     3 files changed, 20 insertions(+), 4 deletions(-)
    
    old new class MythDeque : public deque<T> 
    1616{
    1717  public:
    1818    /// \brief Removes item from front of list and returns a copy. O(1).
     19// TODO: QString(0) or QString(NULL) is ambiguous in Qt4.7 and deprecated since
     20// Qt4.  Instead, QString() or QString((const char *)0) should be used.
     21// This template is used with T of AVFrame*, XvMCOSD*, TVState, DBEventEIT*,
     22// TuningRequest, DSMCCPacket*, int, VideoFrame*, AVSubtitle, QString,
     23// QKeyEvent*, UDPNotifyOSDSet*, ProcessRequestThread, and
     24// DeferredDeleteStruct.
    1925    T dequeue()
    2026    {
    2127        if (deque<T>::empty())
    22             return (T)(0);
     28            return T();
     29//            return (T)(0);
    2330        T item = deque<T>::front();
    2431        deque<T>::pop_front();
    2532        return item;
  • libs/libmythupnp/eventing.h

    old new class UPNP_PUBLIC StateVariables 
    228228
    229229        // ------------------------------------------------------------------
    230230
     231// TODO: QString(0) or QString(NULL) is ambiguous in Qt4.7 and deprecated since
     232// Qt4.  Instead, QString() or QString((const char *)0) should be used.
     233// This template is used with T of QString and unsigned short.
    231234        template < class T >
    232235        T GetValue( const QString &sName )
    233236        {
    234237            SVMap::iterator it = m_map.find(sName);
    235238            if (it == m_map.end())
    236                 return T(0);
     239                return T();
     240//                return T(0);
    237241
    238242            StateVariable< T > *pVariable =
    239243                dynamic_cast< StateVariable< T > *>( *it );
    class UPNP_PUBLIC StateVariables 
    241245            if (pVariable != NULL)
    242246                return pVariable->GetValue();
    243247
    244             return T(0);
     248            return T();
     249//            return T(0);
    245250        }
    246251
    247252        uint BuildNotifyBody(QTextStream &ts, TaskTime ttLastNotified) const;
  • libs/libmythtv/tv_rec.h

    old new class FireWireDBOptions 
    9393class TuningRequest
    9494{
    9595  public:
    96     TuningRequest(uint f) :
     96// TODO: This hack is only required to allow use of MythDeque<T>::dequeue()
     97// with T = TuningRequest because of the hack used to make
     98// MythDeque<T>::dequeue() compile with Qt 4.7
     99//    TuningRequest(uint f) :
     100    TuningRequest(uint f = 0) :
    97101        flags(f), program(NULL), channel(QString::null),
    98102        input(QString::null), majorChan(0), minorChan(0), progNum(-1) {;}
    99103    TuningRequest(uint f, RecordingInfo *p) :