Browse Source

Fix time_t 0 special meaning.

Return null QDateTime object when converting from 0 time_t value.
adaptive-webui-19844
Vladimir Golovnev (Glassez) 10 years ago
parent
commit
56df8c2dd0
  1. 10
      src/core/bittorrent/torrenthandle.cpp

10
src/core/bittorrent/torrenthandle.cpp

@ -916,12 +916,18 @@ int TorrentHandle::incompleteCount() const @@ -916,12 +916,18 @@ int TorrentHandle::incompleteCount() const
QDateTime TorrentHandle::lastSeenComplete() const
{
return QDateTime::fromTime_t(m_nativeStatus.last_seen_complete);
if (m_nativeStatus.last_seen_complete > 0)
return QDateTime::fromTime_t(m_nativeStatus.last_seen_complete);
else
return QDateTime();
}
QDateTime TorrentHandle::completedTime() const
{
return QDateTime::fromTime_t(m_nativeStatus.completed_time);
if (m_nativeStatus.completed_time > 0)
return QDateTime::fromTime_t(m_nativeStatus.completed_time);
else
return QDateTime();
}
int TorrentHandle::timeSinceUpload() const

Loading…
Cancel
Save