Prepare for libtorrent v1.1 support

This commit is contained in:
Vladimir Golovnev (Glassez)
2016-01-20 09:57:02 +03:00
parent 31be920ba4
commit c93ada1e7b
6 changed files with 48 additions and 34 deletions

View File

@@ -30,6 +30,7 @@
#define BITTORRENT_TORRENTINFO_H
#include <QtGlobal>
#include <libtorrent/torrent_info.hpp>
class QString;
@@ -47,7 +48,10 @@ namespace BitTorrent
class TorrentInfo
{
public:
explicit TorrentInfo(boost::intrusive_ptr<const libtorrent::torrent_info> nativeInfo = boost::intrusive_ptr<const libtorrent::torrent_info>());
typedef boost::intrusive_ptr<const libtorrent::torrent_info> NativeConstPtr;
typedef boost::intrusive_ptr<libtorrent::torrent_info> NativePtr;
explicit TorrentInfo(NativeConstPtr nativeInfo = NativeConstPtr());
TorrentInfo(const TorrentInfo &other);
static TorrentInfo loadFromFile(const QString &path, QString &error);
@@ -77,10 +81,11 @@ namespace BitTorrent
QByteArray metadata() const;
void renameFile(uint index, const QString &newPath);
boost::intrusive_ptr<libtorrent::torrent_info> nativeInfo() const;
NativePtr nativeInfo() const;
private:
boost::intrusive_ptr<libtorrent::torrent_info> m_nativeInfo;
NativeConstPtr m_nativeInfo;
};
}