Ticket #10877: 10877-v2.patch

File 10877-v2.patch, 14.2 KB (added by danielk, 14 years ago)
  • mythtv/libs/libmythbase/mthread.cpp

    diff --git a/mythtv/libs/libmythbase/mthread.cpp b/mythtv/libs/libmythbase/mthread.cpp
    index 8764d1e..609d22a 100644
    a b using namespace std;  
    3232// MythTV headers
    3333#include "mythlogging.h"
    3434#include "mythdbcon.h"
    35 #include "mthread.h"
    3635#include "mythtimer.h"
     36#include "mythdate.h"
    3737#include "logging.h"
     38#include "mthread.h"
    3839#include "mythdb.h"
    3940
    4041bool is_current_thread(MThread *thread)
    void MThread::RunEpilog(void)  
    227228void MThread::ThreadSetup(const QString &name)
    228229{
    229230    loggingRegisterThread(name);
    230     qsrand(QDateTime::currentDateTime().toTime_t() ^
    231            QTime::currentTime().msec());
     231    qsrand(MythDate::current().toTime_t() ^ QTime::currentTime().msec());
    232232}
    233233
    234234void MThread::ThreadCleanup(void)
  • mythtv/libs/libmythbase/mythcommandlineparser.cpp

    diff --git a/mythtv/libs/libmythbase/mythcommandlineparser.cpp b/mythtv/libs/libmythbase/mythcommandlineparser.cpp
    index c269a83..3bbac88 100644
    a b QString MythCommandLineParser::GetLogFilePath(void)  
    24432443
    24442444    logdir  = finfo.filePath();
    24452445    logfile = QCoreApplication::applicationName() + "." +
    2446               QDateTime::currentDateTime().toString("yyyyMMddhhmmss") +
    2447               QString(".%1").arg(pid) + ".log";
     2446        MythDate::toString(MythDate::current(), MythDate::kFilename) +
     2447        QString(".%1").arg(pid) + ".log";
    24482448
    24492449    SetValue("logdir", logdir);
    24502450    SetValue("logfile", logfile);
  • mythtv/libs/libmythbase/mythcorecontext.cpp

    diff --git a/mythtv/libs/libmythbase/mythcorecontext.cpp b/mythtv/libs/libmythbase/mythcorecontext.cpp
    index f7896b6..61b86b7 100644
    a b using namespace std;  
    3939#include "logging.h"
    4040#include "mthread.h"
    4141#include "serverpool.h"
     42#include "mythdate.h"
    4243
    4344#define LOC      QString("MythCoreContext: ")
    4445
    MythCoreContextPrivate::MythCoreContextPrivate(MythCoreContext *lparent,  
    106107      m_blockingClient(false)
    107108{
    108109    MThread::ThreadSetup("CoreContext");
    109     srandom(QDateTime::currentDateTime().toTime_t() ^
    110             QTime::currentTime().msec());
     110    srandom(MythDate::current().toTime_t() ^ QTime::currentTime().msec());
    111111}
    112112
    113113MythCoreContextPrivate::~MythCoreContextPrivate()
  • mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp

    diff --git a/mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp b/mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp
    index d837067..9493288 100644
    a b  
    99#include <QKeyEvent>
    1010
    1111#include "mthread.h"
     12#include "mythdate.h"
    1213#include "mythlogging.h"
    1314#include "mythcorecontext.h"
    1415#include "mythuiactions.h"
    void MythAirplayServer::SendResponse(QTcpSocket *socket,  
    742743    reply.append(StatusToString(status));
    743744    reply.append("\r\n");
    744745    reply.append("DATE: ");
    745     reply.append(QDateTime::currentDateTime().toString("ddd, d MMM yyyy hh:mm:ss"));
     746    reply.append(MythDate::current().toString("ddd, d MMM yyyy hh:mm:ss"));
    746747    reply.append(" GMT\r\n");
    747748    if (header.size())
    748749        reply.append(header);
  • mythtv/libs/libmythtv/HLS/httplivestream.cpp

    diff --git a/mythtv/libs/libmythtv/HLS/httplivestream.cpp b/mythtv/libs/libmythtv/HLS/httplivestream.cpp
    index f297e7a..0978d40 100644
    a b  
    2929#include <QUrl>
    3030
    3131#include "mythcorecontext.h"
     32#include "mythdate.h"
    3233#include "mythdirs.h"
    3334#include "mythtimer.h"
    3435#include "mthreadpool.h"
    HTTPLiveStream::HTTPLiveStream(QString srcFile, uint16_t width, uint16_t height,  
    101102    m_bitrate(bitrate),
    102103    m_audioBitrate(abitrate),    m_audioOnlyBitrate(aobitrate),
    103104    m_sampleRate(srate),
    104     m_created(QDateTime::currentDateTime()),
    105     m_lastModified(QDateTime::currentDateTime()),
     105    m_created(MythDate::current()),
     106    m_lastModified(MythDate::current()),
    106107    m_percentComplete(0),
    107108    m_status(kHLSStatusUndefined)
    108109{
    bool HTTPLiveStream::LoadFromDB(void)  
    671672    m_curSegment         = query.value(7).toUInt();
    672673    m_segmentCount       = query.value(8).toUInt();
    673674    m_percentComplete    = query.value(9).toUInt();
    674     m_created            = query.value(10).toDateTime();
    675     m_lastModified       = query.value(11).toDateTime();
     675    m_created            = MythDate::as_utc(query.value(10).toDateTime());
     676    m_lastModified       = MythDate::as_utc(query.value(11).toDateTime());
    676677    m_relativeURL        = query.value(12).toString();
    677678    m_fullURL            = query.value(13).toString();
    678679    m_status             = (HTTPLiveStreamStatus)(query.value(14).toInt());
  • mythtv/libs/libmythtv/osd.cpp

    diff --git a/mythtv/libs/libmythtv/osd.cpp b/mythtv/libs/libmythtv/osd.cpp
    index 6b2f09f..d75e231 100644
    a b void OSD::SetText(const QString &window, QHash<QString,QString> &map,  
    498498    {
    499499        int startts = map["startts"].toInt();
    500500        int endts   = map["endts"].toInt();
    501         int nowts   = QDateTime::currentDateTime().toTime_t();
     501        int nowts   = MythDate::current().toTime_t();
    502502        if (startts > nowts)
    503503        {
    504504            bar->SetUsed(0);
  • mythtv/libs/libmythtv/recordingrule.cpp

    diff --git a/mythtv/libs/libmythtv/recordingrule.cpp b/mythtv/libs/libmythtv/recordingrule.cpp
    index e0a0872..434ebba 100644
    a b bool RecordingRule::Load(bool asTemplate)  
    180180    // and influence watch list weighting
    181181    if (!asTemplate)
    182182    {
    183         m_nextRecording = query.value(43).toDateTime();
    184         m_lastRecorded = query.value(44).toDateTime();
    185         m_lastDeleted = query.value(45).toDateTime();
     183        m_nextRecording = MythDate::as_utc(query.value(43).toDateTime());
     184        m_lastRecorded = MythDate::as_utc(query.value(44).toDateTime());
     185        m_lastDeleted = MythDate::as_utc(query.value(45).toDateTime());
    186186        m_averageDelay = query.value(46).toInt();
    187187    }
    188188
  • mythtv/libs/libmythui/mythuiclock.cpp

    diff --git a/mythtv/libs/libmythui/mythuiclock.cpp b/mythtv/libs/libmythui/mythuiclock.cpp
    index 422d143..7892174 100644
    a b void MythUIClock::SetText(const QString &text)  
    7373
    7474    if (txt.isEmpty())
    7575    {
    76         m_Time = QDateTime::currentDateTime();
     76        m_Time = MythDate::current();
    7777        txt = GetTimeText();
    7878    }
    7979
  • mythtv/programs/mythbackend/services/channel.cpp

    diff --git a/mythtv/programs/mythbackend/services/channel.cpp b/mythtv/programs/mythbackend/services/channel.cpp
    index 555d670..386a18d 100644
    a b  
    3838#include "sourceutil.h"
    3939#include "cardutil.h"
    4040#include "datadirect.h"
     41#include "mythdate.h"
    4142
    4243#include "serviceUtil.h"
    4344
    DTC::VideoMultiplexList* Channel::GetVideoMultiplexList( int nSourceID,  
    562563            pVideoMultiplex->setRollOff(            query.value(19).toString()      );
    563564            pVideoMultiplex->setSIStandard(         query.value(20).toString()      );
    564565            pVideoMultiplex->setServiceVersion(     query.value(21).toInt()         );
    565             pVideoMultiplex->setUpdateTimeStamp(    query.value(22).toDateTime()    );
     566            pVideoMultiplex->setUpdateTimeStamp(
     567                MythDate::as_utc(query.value(22).toDateTime()));
    566568            pVideoMultiplex->setDefaultAuthority(   query.value(23).toString()      );
    567569        }
    568570    }
    DTC::VideoMultiplex* Channel::GetVideoMultiplex( int nMplexID )  
    642644        pVideoMultiplex->setRollOff(            query.value(18).toString()      );
    643645        pVideoMultiplex->setSIStandard(         query.value(19).toString()      );
    644646        pVideoMultiplex->setServiceVersion(     query.value(20).toInt()         );
    645         pVideoMultiplex->setUpdateTimeStamp(    query.value(21).toDateTime()    );
     647        pVideoMultiplex->setUpdateTimeStamp(
     648            MythDate::as_utc(query.value(21).toDateTime()));
    646649        pVideoMultiplex->setDefaultAuthority(   query.value(22).toString()      );
    647650    }
    648651
  • mythtv/programs/mythbackend/services/dvr.cpp

    diff --git a/mythtv/programs/mythbackend/services/dvr.cpp b/mythtv/programs/mythbackend/services/dvr.cpp
    index 9582bd4..fd36f2f 100644
    a b  
    3737#include "jobqueue.h"
    3838#include "encoderlink.h"
    3939#include "remoteutil.h"
     40#include "mythdate.h"
    4041
    4142#include "serviceUtil.h"
    4243#include <mythscheduler.h>
    DTC::ProgramList* Dvr::GetUpcomingList( int nStartIndex,  
    323324    for(; it < tmpList.end(); ++it)
    324325    {
    325326        if (!bShowAll && ((*it)->GetRecordingStatus() <= rsWillRecord) &&
    326             ((*it)->GetRecordingStartTime() >=
    327              QDateTime::currentDateTime()))
     327            ((*it)->GetRecordingStartTime() >= MythDate::current()))
    328328        {
    329329            recordingList.push_back(new RecordingInfo(**it));
    330330        }
    331         else if (bShowAll && ((*it)->GetRecordingStartTime() >=
    332              QDateTime::currentDateTime()))
     331        else if (bShowAll &&
     332                 ((*it)->GetRecordingStartTime() >= MythDate::current()))
    333333        {
    334334            recordingList.push_back(new RecordingInfo(**it));
    335335        }
    DTC::ProgramList* Dvr::GetUpcomingList( int nStartIndex,  
    359359    pPrograms->setStartIndex    ( nStartIndex     );
    360360    pPrograms->setCount         ( nCount          );
    361361    pPrograms->setTotalAvailable( recordingList.size() );
    362     pPrograms->setAsOf          ( QDateTime::currentDateTime() );
     362    pPrograms->setAsOf          ( MythDate::current() );
    363363    pPrograms->setVersion       ( MYTH_BINARY_VERSION );
    364364    pPrograms->setProtoVer      ( MYTH_PROTO_VERSION  );
    365365   
    DTC::ProgramList* Dvr::GetConflictList( int nStartIndex,  
    383383    for(; it < tmpList.end(); ++it)
    384384    {
    385385        if (((*it)->GetRecordingStatus() == rsConflict) &&
    386             ((*it)->GetRecordingStartTime() >=
    387              QDateTime::currentDateTime()))
     386            ((*it)->GetRecordingStartTime() >= MythDate::current()))
    388387        {
    389388            recordingList.push_back(new RecordingInfo(**it));
    390389        }
    DTC::ProgramList* Dvr::GetConflictList( int nStartIndex,  
    414413    pPrograms->setStartIndex    ( nStartIndex     );
    415414    pPrograms->setCount         ( nCount          );
    416415    pPrograms->setTotalAvailable( recordingList.size() );
    417     pPrograms->setAsOf          ( QDateTime::currentDateTime() );
     416    pPrograms->setAsOf          ( MythDate::current() );
    418417    pPrograms->setVersion       ( MYTH_BINARY_VERSION );
    419418    pPrograms->setProtoVer      ( MYTH_PROTO_VERSION  );
    420419
    DTC::RecRuleList* Dvr::GetRecordScheduleList( int nStartIndex,  
    578577    pRecRules->setStartIndex    ( nStartIndex     );
    579578    pRecRules->setCount         ( nCount          );
    580579    pRecRules->setTotalAvailable( recList.size() );
    581     pRecRules->setAsOf          ( QDateTime::currentDateTime() );
     580    pRecRules->setAsOf          ( MythDate::current() );
    582581    pRecRules->setVersion       ( MYTH_BINARY_VERSION );
    583582    pRecRules->setProtoVer      ( MYTH_PROTO_VERSION  );
    584583
  • mythtv/programs/mythbackend/services/myth.cpp

    diff --git a/mythtv/programs/mythbackend/services/myth.cpp b/mythtv/programs/mythbackend/services/myth.cpp
    index b96d258..a0f449f 100644
    a b DTC::LogMessageList *Myth::GetLogs( const QString &HostName,  
    496496            pLogMessage->setFilename( query.value(5).toString() );
    497497            pLogMessage->setLine( query.value(6).toInt() );
    498498            pLogMessage->setFunction( query.value(7).toString() );
    499             pLogMessage->setTime( query.value(8).toDateTime() );
     499            pLogMessage->setTime(MythDate::as_utc(query.value(8).toDateTime()));
    500500            pLogMessage->setLevel( logLevelGetName(
    501501                                       (LogLevel_t)query.value(9).toInt()) );
    502502            pLogMessage->setMessage( query.value(10).toString() );
  • mythtv/programs/mythbackend/upnpcdstv.cpp

    diff --git a/mythtv/programs/mythbackend/upnpcdstv.cpp b/mythtv/programs/mythbackend/upnpcdstv.cpp
    index c0b8ff4..daae4b5 100644
    a b void UPnpCDSTv::AddItem( const UPnpCDSRequest *pRequest,  
    285285                         MSqlQuery               &query )
    286286{
    287287    int            nChanid      = query.value( 0).toInt();
    288     QDateTime      dtStartTime  = query.value( 1).toDateTime();
    289     QDateTime      dtEndTime    = query.value( 2).toDateTime();
     288    QDateTime      dtStartTime  = MythDate::as_utc(query.value(1).toDateTime());
     289    QDateTime      dtEndTime    = MythDate::as_utc(query.value(2).toDateTime());
    290290    QString        sTitle       = query.value( 3).toString();
    291291    QString        sSubtitle    = query.value( 4).toString();
    292292    QString        sDescription = query.value( 5).toString();
    void UPnpCDSTv::AddItem( const UPnpCDSRequest *pRequest,  
    296296    uint64_t       nFileSize    = query.value( 9).toULongLong();
    297297    QString        sBaseName    = query.value(10).toString();
    298298
    299     QDateTime      dtProgStart  = query.value(11).toDateTime();
    300     QDateTime      dtProgEnd    = query.value(12).toDateTime();
     299    QDateTime      dtProgStart  =MythDate::as_utc(query.value(11).toDateTime());
     300    QDateTime      dtProgEnd    =MythDate::as_utc(query.value(12).toDateTime());
    301301    QString        sStorageGrp  = query.value(13).toString();
    302302
    303303    // ----------------------------------------------------------------------
  • mythtv/programs/mythbackend/upnpcdsvideo.cpp

    diff --git a/mythtv/programs/mythbackend/upnpcdsvideo.cpp b/mythtv/programs/mythbackend/upnpcdsvideo.cpp
    index 99872fb..d328168 100644
    a b void UPnpCDSVideo::AddItem( const UPnpCDSRequest *pRequest,  
    252252    // int             nSeason      = query.value(10).toInt();
    253253    // int             nEpisode     = query.value(11).toInt();
    254254    QString        sCoverArt    = query.value(12).toString();
    255     QDateTime      dtInsertDate = query.value(13).toDateTime();
     255    QDateTime      dtInsertDate =MythDate::as_utc(query.value(13).toDateTime());
    256256    QString        sHostName    = query.value(14).toString();
    257257
    258258    // ----------------------------------------------------------------------