Browse Source

Replace obsoleted QDateTime::toTime_t()

adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
2346bc8f7c
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 8
      src/webui/api/serialize/serialize_torrent.cpp
  2. 4
      src/webui/api/torrentscontroller.cpp

8
src/webui/api/serialize/serialize_torrent.cpp

@ -106,8 +106,8 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent) @@ -106,8 +106,8 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent)
{KEY_TORRENT_SUPER_SEEDING, torrent.superSeeding()},
{KEY_TORRENT_FORCE_START, torrent.isForced()},
{KEY_TORRENT_SAVE_PATH, Utils::Fs::toNativePath(torrent.savePath())},
{KEY_TORRENT_ADDED_ON, torrent.addedTime().toTime_t()},
{KEY_TORRENT_COMPLETION_ON, torrent.completedTime().toTime_t()},
{KEY_TORRENT_ADDED_ON, torrent.addedTime().toSecsSinceEpoch()},
{KEY_TORRENT_COMPLETION_ON, torrent.completedTime().toSecsSinceEpoch()},
{KEY_TORRENT_TRACKER, torrent.currentTracker()},
{KEY_TORRENT_DL_LIMIT, torrent.downloadLimit()},
{KEY_TORRENT_UP_LIMIT, torrent.uploadLimit()},
@ -121,7 +121,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent) @@ -121,7 +121,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent)
{KEY_TORRENT_MAX_SEEDING_TIME, torrent.maxSeedingTime()},
{KEY_TORRENT_RATIO_LIMIT, torrent.ratioLimit()},
{KEY_TORRENT_SEEDING_TIME_LIMIT, torrent.seedingTimeLimit()},
{KEY_TORRENT_LAST_SEEN_COMPLETE_TIME, torrent.lastSeenComplete().toTime_t()},
{KEY_TORRENT_LAST_SEEN_COMPLETE_TIME, torrent.lastSeenComplete().toSecsSinceEpoch()},
{KEY_TORRENT_AUTO_TORRENT_MANAGEMENT, torrent.isAutoTMMEnabled()},
{KEY_TORRENT_TIME_ACTIVE, torrent.activeTime()},
{KEY_TORRENT_AVAILABILITY, torrent.distributedCopies()},
@ -138,7 +138,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent) @@ -138,7 +138,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent)
else {
QDateTime dt = QDateTime::currentDateTime();
dt = dt.addSecs(-torrent.timeSinceActivity());
ret[KEY_TORRENT_LAST_ACTIVITY_TIME] = dt.toTime_t();
ret[KEY_TORRENT_LAST_ACTIVITY_TIME] = dt.toSecsSinceEpoch();
}
return ret;

4
src/webui/api/torrentscontroller.cpp

@ -346,8 +346,8 @@ void TorrentsController::propertiesAction() @@ -346,8 +346,8 @@ void TorrentsController::propertiesAction()
dataDict[KEY_PROP_CREATED_BY] = torrent->creator();
dataDict[KEY_PROP_ADDITION_DATE] = static_cast<double>(torrent->addedTime().toSecsSinceEpoch());
if (torrent->hasMetadata()) {
dataDict[KEY_PROP_LAST_SEEN] = torrent->lastSeenComplete().isValid() ? static_cast<int>(torrent->lastSeenComplete().toTime_t()) : -1;
dataDict[KEY_PROP_COMPLETION_DATE] = torrent->completedTime().isValid() ? static_cast<int>(torrent->completedTime().toTime_t()) : -1;
dataDict[KEY_PROP_LAST_SEEN] = torrent->lastSeenComplete().isValid() ? torrent->lastSeenComplete().toSecsSinceEpoch() : -1;
dataDict[KEY_PROP_COMPLETION_DATE] = torrent->completedTime().isValid() ? torrent->completedTime().toSecsSinceEpoch() : -1;
dataDict[KEY_PROP_CREATION_DATE] = static_cast<double>(torrent->creationDate().toSecsSinceEpoch());
}
else {

Loading…
Cancel
Save