mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-25 02:36:10 +03:00
parent
610d5ef5ff
commit
0cbe4882c3
2 changed files with 9 additions and 2 deletions
|
@ -240,11 +240,11 @@ void CustomDiskIOThread::handleCompleteFiles(lt::storage_index_t storage, const
|
||||||
|
|
||||||
lt::storage_interface *customStorageConstructor(const lt::storage_params ¶ms, lt::file_pool &pool)
|
lt::storage_interface *customStorageConstructor(const lt::storage_params ¶ms, lt::file_pool &pool)
|
||||||
{
|
{
|
||||||
return new CustomStorage {params, pool};
|
return new CustomStorage(params, pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomStorage::CustomStorage(const lt::storage_params ¶ms, lt::file_pool &filePool)
|
CustomStorage::CustomStorage(const lt::storage_params ¶ms, lt::file_pool &filePool)
|
||||||
: lt::default_storage {params, filePool}
|
: lt::default_storage(params, filePool)
|
||||||
, m_savePath {params.path}
|
, m_savePath {params.path}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,10 @@
|
||||||
#include "base/utils/os.h"
|
#include "base/utils/os.h"
|
||||||
#endif // Q_OS_MACOS || Q_OS_WIN
|
#endif // Q_OS_MACOS || Q_OS_WIN
|
||||||
|
|
||||||
|
#ifndef QBT_USES_LIBTORRENT2
|
||||||
|
#include "customstorage.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace BitTorrent;
|
using namespace BitTorrent;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
@ -1860,6 +1864,9 @@ void TorrentImpl::reload()
|
||||||
|
|
||||||
auto *const extensionData = new ExtensionData;
|
auto *const extensionData = new ExtensionData;
|
||||||
p.userdata = LTClientData(extensionData);
|
p.userdata = LTClientData(extensionData);
|
||||||
|
#ifndef QBT_USES_LIBTORRENT2
|
||||||
|
p.storage = customStorageConstructor;
|
||||||
|
#endif
|
||||||
m_nativeHandle = m_nativeSession->add_torrent(p);
|
m_nativeHandle = m_nativeSession->add_torrent(p);
|
||||||
|
|
||||||
m_nativeStatus = extensionData->status;
|
m_nativeStatus = extensionData->status;
|
||||||
|
|
Loading…
Reference in a new issue