mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 11:49:01 +03:00
Merge pull request #3188 from glassez/datetime
Fix time_t 0 special meaning.
This commit is contained in:
commit
93bbda851a
1 changed files with 8 additions and 2 deletions
|
@ -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…
Reference in a new issue