mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Merge pull request #11781 from FranciscoPombal/piece_extent_affinity
Add piece_extent_affinity to AdvancedSettings
This commit is contained in:
commit
146e8213a5
6 changed files with 49 additions and 1 deletions
|
@ -383,6 +383,7 @@ Session::Session(QObject *parent)
|
|||
#else
|
||||
, m_coalesceReadWriteEnabled(BITTORRENT_SESSION_KEY("CoalesceReadWrite"), false)
|
||||
#endif
|
||||
, m_usePieceExtentAffinity(BITTORRENT_SESSION_KEY("PieceExtentAffinity"), false)
|
||||
, m_isSuggestMode(BITTORRENT_SESSION_KEY("SuggestMode"), false)
|
||||
, m_sendBufferWatermark(BITTORRENT_SESSION_KEY("SendBufferWatermark"), 500)
|
||||
, m_sendBufferLowWatermark(BITTORRENT_SESSION_KEY("SendBufferLowWatermark"), 10)
|
||||
|
@ -1322,6 +1323,10 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
|||
settingsPack.set_bool(lt::settings_pack::coalesce_reads, isCoalesceReadWriteEnabled());
|
||||
settingsPack.set_bool(lt::settings_pack::coalesce_writes, isCoalesceReadWriteEnabled());
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 10202)
|
||||
settingsPack.set_bool(lt::settings_pack::piece_extent_affinity, usePieceExtentAffinity());
|
||||
#endif
|
||||
|
||||
settingsPack.set_int(lt::settings_pack::suggest_mode, isSuggestModeEnabled()
|
||||
? lt::settings_pack::suggest_read_cache : lt::settings_pack::no_piece_suggestions);
|
||||
|
||||
|
@ -3249,6 +3254,19 @@ bool Session::isSuggestModeEnabled() const
|
|||
return m_isSuggestMode;
|
||||
}
|
||||
|
||||
bool Session::usePieceExtentAffinity() const
|
||||
{
|
||||
return m_usePieceExtentAffinity;
|
||||
}
|
||||
|
||||
void Session::setPieceExtentAffinity(const bool enabled)
|
||||
{
|
||||
if (enabled == m_usePieceExtentAffinity) return;
|
||||
|
||||
m_usePieceExtentAffinity = enabled;
|
||||
configureDeferred();
|
||||
}
|
||||
|
||||
void Session::setSuggestMode(const bool mode)
|
||||
{
|
||||
if (mode == m_isSuggestMode) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue