Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/base/bittorrent/customstorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@
m_storageData[storageHolder] =
{
savePath,
#if LIBTORRENT_VERSION_NUM < 20100
// libtorrent < 2.1.0
storageParams.mapped_files ? *storageParams.mapped_files : storageParams.files,
#else
// libtorrent >= 2.1.0
// fix: error: 'const struct libtorrent::storage_params' has no member named 'mapped_files'
storageParams.files,
#endif
storageParams.priorities
};

Expand Down Expand Up @@ -156,7 +163,17 @@
, [=, this, handler = std::move(handler)](const std::string &name, lt::file_index_t index, const lt::storage_error &error)
{
if (!error)
{
#if LIBTORRENT_VERSION_NUM < 20100
// libtorrent < 2.1.0
m_storageData[storage].files.rename_file(index, name);
#else
// libtorrent >= 2.1.0
// FIXME rename_file is deprecated since libtorrent 77eb55f31e53f798d9b88c946d434b8076310d00
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check notice

Code scanning / CodeQL

FIXME comment Note

FIXME comment: rename_file is deprecated since libtorrent 77eb55f31e53f798d9b88c946d434b8076310d00
// https://github.com/arvidn/libtorrent/pull/7983
m_storageData[storage].files.rename_file(index, name);
#endif
}
handler(name, index, error);
});
}
Expand Down
Loading