Browse Source

Removing option to disable the OS disk cache because it has limited use and is unreliable in Windows.

adaptive-webui-19844
John Peterson 12 years ago
parent
commit
6894a4b640
  1. 12
      src/preferences/advancedsettings.h
  2. 16
      src/preferences/preferences.h
  3. 3
      src/qtlibtorrent/qbtsession.cpp

12
src/preferences/advancedsettings.h

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
#include "preferences.h"
enum AdvSettingsCols {PROPERTY, VALUE};
enum AdvSettingsRows {DISK_CACHE, OS_WRITE_CACHE, OS_READ_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, NETWORK_ADDRESS, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, NETWORK_ADDRESS, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
UPDATE_CHECK,
#endif
@ -29,7 +29,7 @@ class AdvancedSettings: public QTableWidget { @@ -29,7 +29,7 @@ class AdvancedSettings: public QTableWidget {
private:
QSpinBox spin_cache, outgoing_ports_min, outgoing_ports_max, spin_list_refresh, spin_maxhalfopen, spin_tracker_port;
QCheckBox cb_write_cache, cb_read_cache, cb_ignore_limits_lan, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts,
QCheckBox cb_ignore_limits_lan, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts,
cb_super_seeding, cb_program_notifications, cb_tracker_status, cb_confirm_torrent_deletion,
cb_enable_tracker_ext;
QComboBox combo_iface;
@ -69,8 +69,6 @@ public slots: @@ -69,8 +69,6 @@ public slots:
Preferences pref;
// Disk write cache
pref.setDiskCacheSize(spin_cache.value());
pref.disableOSWriteCache(cb_write_cache.isChecked());
pref.disableOSReadCache(cb_read_cache.isChecked());
// Outgoing ports
pref.setOutgoingPortsMin(outgoing_ports_min.value());
pref.setOutgoingPortsMax(outgoing_ports_max.value());
@ -172,12 +170,6 @@ private slots: @@ -172,12 +170,6 @@ private slots:
spin_cache.setValue(pref.diskCacheSize());
updateCacheSpinSuffix(spin_cache.value());
setRow(DISK_CACHE, tr("Disk write cache size"), &spin_cache);
// OS write cache
cb_write_cache.setChecked(pref.disableOSWriteCache());
setRow(OS_WRITE_CACHE, tr("Disable OS caching of disk writes"), &cb_write_cache);
// OS read cache
cb_read_cache.setChecked(pref.disableOSReadCache());
setRow(OS_READ_CACHE, tr("Disable OS caching of disk reads"), &cb_read_cache);
// Outgoing port Min
outgoing_ports_min.setMinimum(0);
outgoing_ports_min.setMaximum(65535);

16
src/preferences/preferences.h

@ -952,22 +952,6 @@ public: @@ -952,22 +952,6 @@ public:
setValue(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), size);
}
bool disableOSWriteCache() const {
return value(QString::fromUtf8("Preferences/Advanced/DisableOSWriteCache"), false).toBool();
}
void disableOSWriteCache(bool disable) {
setValue(QString::fromUtf8("Preferences/Advanced/DisableOSWriteCache"), disable);
}
bool disableOSReadCache() const {
return value(QString::fromUtf8("Preferences/Advanced/DisableOSReadCache"), false).toBool();
}
void disableOSReadCache(bool disable) {
setValue(QString::fromUtf8("Preferences/Advanced/DisableOSReadCache"), disable);
}
uint outgoingPortsMin() const {
return value(QString::fromUtf8("Preferences/Advanced/OutgoingPortsMin"), 0).toUInt();
}

3
src/qtlibtorrent/qbtsession.cpp

@ -405,9 +405,6 @@ void QBtSession::configureSession() { @@ -405,9 +405,6 @@ void QBtSession::configureSession() {
int cache_size = pref.diskCacheSize();
sessionSettings.cache_size = cache_size ? cache_size * 64 : -1;
qDebug() << "Using a disk cache size of" << pref.diskCacheSize() << "MiB";
// Disabling the OS disk cache is intended to reduce memory usage (especially when checking files) but might be unreliable
sessionSettings.disk_io_write_mode = pref.disableOSWriteCache() ? session_settings::disable_os_cache : session_settings::enable_os_cache;
sessionSettings.disk_io_read_mode = pref.disableOSReadCache() ? session_settings::disable_os_cache : session_settings::enable_os_cache;
#if LIBTORRENT_VERSION_MINOR > 15
sessionSettings.anonymous_mode = pref.isAnonymousModeEnabled();
if (sessionSettings.anonymous_mode) {

Loading…
Cancel
Save