mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 13:28:50 +03:00
Merge pull request #10865 from Chocobo1/libt
Use newer libtorrent API (part 4)
This commit is contained in:
commit
c0557c296a
1 changed files with 11 additions and 0 deletions
|
@ -45,6 +45,10 @@
|
||||||
#include <libtorrent/time.hpp>
|
#include <libtorrent/time.hpp>
|
||||||
#include <libtorrent/version.hpp>
|
#include <libtorrent/version.hpp>
|
||||||
|
|
||||||
|
#if (LIBTORRENT_VERSION_NUM >= 10200)
|
||||||
|
#include <libtorrent/write_resume_data.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QBitArray>
|
#include <QBitArray>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -1689,10 +1693,17 @@ void TorrentHandle::handleTorrentResumedAlert(const lt::torrent_resumed_alert *p
|
||||||
|
|
||||||
void TorrentHandle::handleSaveResumeDataAlert(const lt::save_resume_data_alert *p)
|
void TorrentHandle::handleSaveResumeDataAlert(const lt::save_resume_data_alert *p)
|
||||||
{
|
{
|
||||||
|
#if (LIBTORRENT_VERSION_NUM < 10200)
|
||||||
const bool useDummyResumeData = !(p && p->resume_data);
|
const bool useDummyResumeData = !(p && p->resume_data);
|
||||||
lt::entry dummyEntry;
|
lt::entry dummyEntry;
|
||||||
|
|
||||||
lt::entry &resumeData = useDummyResumeData ? dummyEntry : *(p->resume_data);
|
lt::entry &resumeData = useDummyResumeData ? dummyEntry : *(p->resume_data);
|
||||||
|
#else
|
||||||
|
const bool useDummyResumeData = !p;
|
||||||
|
|
||||||
|
lt::entry resumeData = useDummyResumeData ? lt::entry() : lt::write_resume_data(p->params);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (useDummyResumeData) {
|
if (useDummyResumeData) {
|
||||||
resumeData["qBt-magnetUri"] = toMagnetUri().toStdString();
|
resumeData["qBt-magnetUri"] = toMagnetUri().toStdString();
|
||||||
resumeData["qBt-paused"] = isPaused();
|
resumeData["qBt-paused"] = isPaused();
|
||||||
|
|
Loading…
Reference in a new issue