mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Merge pull request #12978 from arvidn/plugin-lt2-compat
support changes to plugin API in libtorrent-2.0
This commit is contained in:
commit
96f9a657f1
2 changed files with 10 additions and 4 deletions
|
@ -53,12 +53,12 @@ lt::feature_flags_t NativeSessionExtension::implemented_features()
|
||||||
return alert_feature;
|
return alert_feature;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<lt::torrent_plugin> NativeSessionExtension::new_torrent(const lt::torrent_handle &torrentHandle, void *)
|
std::shared_ptr<lt::torrent_plugin> NativeSessionExtension::new_torrent(const lt::torrent_handle &torrentHandle, ClientData)
|
||||||
{
|
{
|
||||||
return std::make_shared<NativeTorrentExtension>(torrentHandle);
|
return std::make_shared<NativeTorrentExtension>(torrentHandle);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
boost::shared_ptr<lt::torrent_plugin> NativeSessionExtension::new_torrent(const lt::torrent_handle &torrentHandle, void *)
|
boost::shared_ptr<lt::torrent_plugin> NativeSessionExtension::new_torrent(const lt::torrent_handle &torrentHandle, ClientData)
|
||||||
{
|
{
|
||||||
return boost::make_shared<NativeTorrentExtension>(torrentHandle);
|
return boost::make_shared<NativeTorrentExtension>(torrentHandle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,11 +33,17 @@
|
||||||
|
|
||||||
class NativeSessionExtension final : public lt::plugin
|
class NativeSessionExtension final : public lt::plugin
|
||||||
{
|
{
|
||||||
|
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||||
|
using ClientData = lt::client_data_t;
|
||||||
|
#else
|
||||||
|
using ClientData = void *;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10200)
|
#if (LIBTORRENT_VERSION_NUM >= 10200)
|
||||||
lt::feature_flags_t implemented_features() override;
|
lt::feature_flags_t implemented_features() override;
|
||||||
std::shared_ptr<lt::torrent_plugin> new_torrent(const lt::torrent_handle &torrentHandle, void *userData) override;
|
std::shared_ptr<lt::torrent_plugin> new_torrent(const lt::torrent_handle &torrentHandle, ClientData) override;
|
||||||
#else
|
#else
|
||||||
boost::shared_ptr<lt::torrent_plugin> new_torrent(const lt::torrent_handle &torrentHandle, void *userData) override;
|
boost::shared_ptr<lt::torrent_plugin> new_torrent(const lt::torrent_handle &torrentHandle, ClientData) override;
|
||||||
#endif
|
#endif
|
||||||
void on_alert(const lt::alert *alert) override;
|
void on_alert(const lt::alert *alert) override;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue