Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 55318 Details for
Bug 87947
Mythtv 0.17 and QT 3.3.4 cause Daylight Savings problem
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
qdate daylight savings time patch without ~ files
mythtv-0.17-qdate.patch (text/plain), 4.63 KB, created by
Jerome
on 2005-04-04 16:37:19 UTC
(
hide
)
Description:
qdate daylight savings time patch without ~ files
Filename:
MIME Type:
Creator:
Jerome
Created:
2005-04-04 16:37:19 UTC
Size:
4.63 KB
patch
obsolete
>diff -urN mythtv-0.17-org/libs/libmyth/util.cpp mythtv-0.17/libs/libmyth/util.cpp >--- mythtv-0.17-org/libs/libmyth/util.cpp 2005-01-27 18:43:13.000000000 -0500 >+++ mythtv-0.17/libs/libmyth/util.cpp 2005-04-04 17:38:30.000000000 -0400 >@@ -742,6 +742,23 @@ > return text; > } > >+int MythSecsTo(const QDateTime &from, const QDateTime &to) >+{ >+ return (from.time().secsTo(to.time()) + >+ from.date().daysTo(to.date()) * 60 * 60 * 24); >+} >+ >+QDateTime MythUTCToLocal(const QDateTime &utc) >+{ >+ QDateTime local = QDateTime(QDate(1970, 1, 1)); >+ >+ int timesecs = MythSecsTo(local, utc); >+ QDateTime localdt; >+ localdt.setTime_t(timesecs); >+ >+ return localdt; >+} >+ > long long stringToLongLong(const QString &str) > { > long long retval = 0; >diff -urN mythtv-0.17-org/libs/libmyth/util.h mythtv-0.17/libs/libmyth/util.h >--- mythtv-0.17-org/libs/libmyth/util.h 2005-01-23 17:45:30.000000000 -0500 >+++ mythtv-0.17/libs/libmyth/util.h 2005-04-04 17:53:12.000000000 -0400 >@@ -3,6 +3,7 @@ > > #include <qsocket.h> > #include <qstringlist.h> >+#include <qdatetime.h> > #include <qcolor.h> > > #include <time.h> >@@ -47,6 +48,9 @@ > > QString cutDownString(QString text, QFont *testFont, int maxwidth); > >+QDateTime MythUTCToLocal(const QDateTime &utc); >+int MythSecsTo(const QDateTime &from, const QDateTime &to); >+ > long long stringToLongLong(const QString &str); > QString longLongToString(long long ll); > >diff -urN mythtv-0.17-org/libs/libmythtv/datadirect.cpp mythtv-0.17/libs/libmythtv/datadirect.cpp >--- mythtv-0.17-org/libs/libmythtv/datadirect.cpp 2005-01-28 02:33:46.000000000 -0500 >+++ mythtv-0.17/libs/libmythtv/datadirect.cpp 2005-04-04 18:27:15.183220112 -0400 >@@ -1,6 +1,7 @@ > #include "datadirect.h" > #include "../libmyth/mythwidgets.h" > #include "../libmyth/mythcontext.h" >+#include "util.h" > > #include <qfile.h> > #include <qstring.h> >@@ -68,16 +69,9 @@ > curr_schedule.stationid = pxmlatts.value("station"); > > QString timestr = pxmlatts.value("time"); >- QDateTime basedt = QDateTime(QDate(1970, 1, 1)); >+ QDateTime UTCdt= QDateTime::fromString(timestr, Qt::ISODate); > >- QDateTime UTCdt; >- QDateTime localdt; >- UTCdt = QDateTime::fromString(pxmlatts.value("time"), Qt::ISODate); >- >- int timesecs = basedt.secsTo(UTCdt); >- localdt.setTime_t(timesecs); >- >- curr_schedule.time = localdt; >+ curr_schedule.time = MythUTCToLocal(UTCdt); > QString durstr; > > durstr = pxmlatts.value("duration"); >diff -urN mythtv-0.17-org/libs/libmythtv/siparser.cpp mythtv-0.17/libs/libmythtv/siparser.cpp >--- mythtv-0.17-org/libs/libmythtv/siparser.cpp 2005-02-06 13:15:30.000000000 -0500 >+++ mythtv-0.17/libs/libmythtv/siparser.cpp 2005-04-04 17:46:01.000000000 -0400 >@@ -931,17 +931,7 @@ > QDateTime UTCTime = QDateTime(QDate(year,month,day),QTime(hour,min,sec)); > > // Convert to localtime >- QDateTime EPOCTime = QDateTime(QDate(1970, 1, 1)); >- int timesecs = EPOCTime.secsTo(UTCTime); >- >- QDateTime LocalTime; >- >- LocalTime.setTime_t(timesecs); >- >- QString UTCText = UTCTime.toString(); >- QString LocalText = LocalTime.toString(); >- >- return LocalTime; >+ return MythUTCToLocal(UTCTime); > > } > >@@ -1993,14 +1983,9 @@ > // Get event time and add on GPS Second Difference > // QDateTime UTCTime = ATSCEPOC.addSecs(offset - (((STTHandler*) Table[STT])->GPSOffset) ); > QDateTime UTCTime = ATSCEPOC.addSecs(offset - 13 ); >- // Get UTC >- QDateTime UTCEPOC = QDateTime(QDate(1970,1,1)); >- // Now sloppily convert it to localtime >- >- int timesecs = UTCEPOC.secsTo(UTCTime); >- QDateTime LocalTime; >- LocalTime.setTime_t(timesecs); >- return LocalTime; >+ >+ // Convert to localtime >+ return MythUTCToLocal(UTCTime); > } > > /* >diff -urN mythtv-0.17-org/programs/mythfilldatabase/filldata.cpp mythtv-0.17/programs/mythfilldatabase/filldata.cpp >--- mythtv-0.17-org/programs/mythfilldatabase/filldata.cpp 2005-02-09 16:35:13.000000000 -0500 >+++ mythtv-0.17/programs/mythfilldatabase/filldata.cpp 2005-04-04 17:50:28.000000000 -0400 >@@ -1013,13 +1013,8 @@ > > if (!quiet) > cout << "Clearing data for source...\n"; >- QDateTime basedt = QDateTime(QDate(1970, 1, 1)); >- QDateTime fromlocaldt; >- int timesecs = basedt.secsTo(ddprocessor.getActualListingsFrom()); >- fromlocaldt.setTime_t(timesecs); >- QDateTime tolocaldt; >- timesecs = basedt.secsTo(ddprocessor.getActualListingsTo()); >- tolocaldt.setTime_t(timesecs); >+ QDateTime fromlocaldt= MythUTCToLocal(ddprocessor.getActualListingsFrom()); >+ QDateTime tolocaldt= MythUTCToLocal(ddprocessor.getActualListingsTo()); > > if (!quiet) > cout << "Clearing from " << fromlocaldt.toString()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 87947
:
55294
|
55295
| 55318