mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Fix time_t 0 special meaning.
Return null QDateTime object when converting from 0 time_t value.
This commit is contained in:
parent
8897001567
commit
56df8c2dd0
1 changed files with 8 additions and 2 deletions
|
@ -916,12 +916,18 @@ int TorrentHandle::incompleteCount() const
|
||||||
|
|
||||||
QDateTime TorrentHandle::lastSeenComplete() const
|
QDateTime TorrentHandle::lastSeenComplete() const
|
||||||
{
|
{
|
||||||
|
if (m_nativeStatus.last_seen_complete > 0)
|
||||||
return QDateTime::fromTime_t(m_nativeStatus.last_seen_complete);
|
return QDateTime::fromTime_t(m_nativeStatus.last_seen_complete);
|
||||||
|
else
|
||||||
|
return QDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime TorrentHandle::completedTime() const
|
QDateTime TorrentHandle::completedTime() const
|
||||||
{
|
{
|
||||||
|
if (m_nativeStatus.completed_time > 0)
|
||||||
return QDateTime::fromTime_t(m_nativeStatus.completed_time);
|
return QDateTime::fromTime_t(m_nativeStatus.completed_time);
|
||||||
|
else
|
||||||
|
return QDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
int TorrentHandle::timeSinceUpload() const
|
int TorrentHandle::timeSinceUpload() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue