Merge pull request #3844 from glassez/added_time

Use libtorrent::torrent_status::added_time (Closes #3764).
This commit is contained in:
sledgehammer999 2015-10-11 04:14:30 -05:00
commit 9646794bb1
4 changed files with 1 additions and 7 deletions

View File

@ -89,7 +89,6 @@ bool upgradeResumeFile(const QString &filepath)
libtorrent::entry fastNew;
fastNew = fastOld;
fastNew["qBt-addedTime"] = fastOld.dict_find_int_value("qBt-added_time");
int priority = fastOld.dict_find_int_value("qBt-queuePosition");
QFile file2(QString("%1.%2").arg(filepath).arg(priority > 0 ? priority : 0));

View File

@ -2369,7 +2369,6 @@ bool loadTorrentResumeData(const QByteArray &data, AddTorrentData &out, MagnetUr
libt::lazy_bdecode(data.constData(), data.constData() + data.size(), fast, ec);
if ((fast.type() != libt::lazy_entry::dict_t) && !ec) return false;
out.addedTime = QDateTime::fromTime_t(fast.dict_find_int_value("qBt-addedTime"));
out.savePath = Utils::Fs::fromNativePath(Utils::String::fromStdString(fast.dict_find_string_value("qBt-savePath")));
out.ratioLimit = Utils::String::fromStdString(fast.dict_find_string_value("qBt-ratioLimit")).toDouble();
out.label = Utils::String::fromStdString(fast.dict_find_string_value("qBt-label"));

View File

@ -192,7 +192,6 @@ TorrentHandle::TorrentHandle(Session *session, const libtorrent::torrent_handle
, m_state(TorrentState::Unknown)
, m_renameCount(0)
, m_name(data.name)
, m_addedTime(data.resumed ? data.addedTime : QDateTime::currentDateTime())
, m_savePath(Utils::Fs::toNativePath(data.savePath))
, m_label(data.label)
, m_hasSeedStatus(data.resumed ? data.hasSeedStatus : false)
@ -500,7 +499,7 @@ QString TorrentHandle::label() const
QDateTime TorrentHandle::addedTime() const
{
return m_addedTime;
return QDateTime::fromTime_t(m_nativeStatus.added_time);
}
qreal TorrentHandle::ratioLimit() const
@ -1429,7 +1428,6 @@ void TorrentHandle::handleSaveResumeDataAlert(libtorrent::save_resume_data_alert
resumeData["qBt-paused"] = isPaused();
resumeData["qBt-forced"] = isForced();
}
resumeData["qBt-addedTime"] = m_addedTime.toTime_t();
resumeData["qBt-savePath"] = Utils::String::toStdString(m_savePath);
resumeData["qBt-ratioLimit"] = Utils::String::toStdString(QString::number(m_ratioLimit));
resumeData["qBt-label"] = Utils::String::toStdString(m_label);

View File

@ -97,7 +97,6 @@ namespace BitTorrent
// for new torrents
QVector<int> filePriorities;
// for resumed torrents
QDateTime addedTime;
qreal ratioLimit;
AddTorrentData();
@ -363,7 +362,6 @@ namespace BitTorrent
// Persistent data
QString m_name;
QDateTime m_addedTime;
QString m_savePath;
QString m_label;
bool m_hasSeedStatus;