mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-10 23:42:46 -07:00
Add async io threads option to AdvancedSettings
This commit is contained in:
parent
553bd8e22c
commit
670a8e27af
4 changed files with 36 additions and 1 deletions
|
@ -79,6 +79,9 @@ enum AdvSettingsRows
|
|||
|
||||
// libtorrent section
|
||||
LIBTORRENT_HEADER,
|
||||
#if LIBTORRENT_VERSION_NUM >= 10100
|
||||
ASYNC_IO_THREADS,
|
||||
#endif
|
||||
// cache
|
||||
DISK_CACHE,
|
||||
DISK_CACHE_TTL,
|
||||
|
@ -144,6 +147,10 @@ void AdvancedSettings::saveAdvancedSettings()
|
|||
Preferences *const pref = Preferences::instance();
|
||||
BitTorrent::Session *const session = BitTorrent::Session::instance();
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM >= 10100
|
||||
// Async IO threads
|
||||
session->setAsyncIOThreads(spinBoxAsyncIOThreads.value());
|
||||
#endif
|
||||
// Disk write cache
|
||||
session->setDiskCacheSize(spinBoxCache.value());
|
||||
session->setDiskCacheTTL(spinBoxCacheTTL.value());
|
||||
|
@ -308,6 +315,14 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||
item(LIBTORRENT_HEADER, PROPERTY)->setFont(boldFont);
|
||||
labelLibtorrentLink.setText(QString("<a href=\"%1\">%2</a>").arg("https://www.libtorrent.org/reference.html", tr("Open documentation")));
|
||||
labelLibtorrentLink.setOpenExternalLinks(true);
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM >= 10100
|
||||
// Async IO threads
|
||||
spinBoxAsyncIOThreads.setMinimum(1);
|
||||
spinBoxAsyncIOThreads.setMaximum(1024);
|
||||
spinBoxAsyncIOThreads.setValue(session->asyncIOThreads());
|
||||
addRow(ASYNC_IO_THREADS, tr("Asynchronous I/O threads"), &spinBoxAsyncIOThreads);
|
||||
#endif
|
||||
// Disk write cache
|
||||
spinBoxCache.setMinimum(-1);
|
||||
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue