Cherry-pick 813951402c15850642a88487f08779aeba98055c from libmygpo-qt

This commit is contained in:
David Sansome 2012-03-07 13:20:40 +00:00
parent 17dfc99462
commit 8a2e282676
1 changed files with 8 additions and 1 deletions

View File

@ -135,7 +135,14 @@ QVariantMap JsonCreator::episodeActionToQVariantMap( const EpisodeActionPtr epis
map.insert( QLatin1String( "action" ), QLatin1String( "download" ) );
if( episodeAction->timestamp() != 0 ) {
#if QT_VERSION >= 0x040700
QDateTime dateTime = QDateTime::fromMSecsSinceEpoch(episodeAction->timestamp() );
#else
QDateTime dateTime = QDateTime::fromTime_t(episodeAction->timestamp() / 1000 );
QTime time = dateTime.time();
time.addMSecs(episodeAction->timestamp() % 1000 );
dateTime.setTime(time);
#endif
map.insert( QLatin1String( "timestamp" ), dateTime.toString(Qt::ISODate) );
}
if( episodeAction->started() != 0 )