Allow control of cache expiry interval (libtorrent 0.16.10 allocator can now return cache to kernel)

This commit is contained in:
Nick Tiskov
2013-03-18 13:45:30 +04:00
parent 2647d9e994
commit 6b660d505c
3 changed files with 36 additions and 1 deletions

View File

@@ -959,13 +959,27 @@ public:
}
uint diskCacheSize() const {
#if LIBTORRENT_VERSION_NUM >= 001610
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), 0).toUInt();
#else
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), 128).toUInt();
#endif
}
void setDiskCacheSize(uint size) {
setValue(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheSize"), size);
}
#if LIBTORRENT_VERSION_NUM >= 001610
uint diskCacheTTL() const {
return value(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheTTL"), 60).toUInt();
}
void setDiskCacheTTL(uint ttl) {
setValue(QString::fromUtf8("Preferences/Downloads/DiskWriteCacheTTL"), ttl);
}
#endif
uint outgoingPortsMin() const {
return value(QString::fromUtf8("Preferences/Advanced/OutgoingPortsMin"), 0).toUInt();
}