|
|
@ -386,7 +386,7 @@ void QBtSession::configureSession() { |
|
|
|
sessionSettings.auto_scrape_min_interval = 900; // 15 minutes
|
|
|
|
sessionSettings.auto_scrape_min_interval = 900; // 15 minutes
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
sessionSettings.cache_size = pref.diskCacheSize()*64; |
|
|
|
sessionSettings.cache_size = pref.diskCacheSize()*64; |
|
|
|
addConsoleMessage(tr("Using a disk cache size of %1 MiB").arg(pref.diskCacheSize())); |
|
|
|
qDebug() << "Using a disk cache size of" << pref.diskCacheSize() << "MiB"; |
|
|
|
// Queueing System
|
|
|
|
// Queueing System
|
|
|
|
if(pref.isQueueingSystemEnabled()) { |
|
|
|
if(pref.isQueueingSystemEnabled()) { |
|
|
|
sessionSettings.active_downloads = pref.getMaxActiveDownloads(); |
|
|
|
sessionSettings.active_downloads = pref.getMaxActiveDownloads(); |
|
|
@ -1749,6 +1749,8 @@ void QBtSession::enableIPFilter(QString filter) { |
|
|
|
qDebug("Enabling IPFiler"); |
|
|
|
qDebug("Enabling IPFiler"); |
|
|
|
if(!filterParser) { |
|
|
|
if(!filterParser) { |
|
|
|
filterParser = new FilterParserThread(this, s); |
|
|
|
filterParser = new FilterParserThread(this, s); |
|
|
|
|
|
|
|
connect(filterParser.data(), SIGNAL(IPFilterParsed(int)), SLOT(handleIPFilterParsed(int))); |
|
|
|
|
|
|
|
connect(filterParser.data(), SIGNAL(IPFilterError()), SLOT(handleIPFilterError())); |
|
|
|
} |
|
|
|
} |
|
|
|
if(filterPath.isEmpty() || filterPath != filter) { |
|
|
|
if(filterPath.isEmpty() || filterPath != filter) { |
|
|
|
filterPath = filter; |
|
|
|
filterPath = filter; |
|
|
@ -1761,6 +1763,7 @@ void QBtSession::disableIPFilter() { |
|
|
|
qDebug("Disabling IPFilter"); |
|
|
|
qDebug("Disabling IPFilter"); |
|
|
|
s->set_ip_filter(ip_filter()); |
|
|
|
s->set_ip_filter(ip_filter()); |
|
|
|
if(filterParser) { |
|
|
|
if(filterParser) { |
|
|
|
|
|
|
|
disconnect(filterParser.data(), 0, this, 0); |
|
|
|
delete filterParser; |
|
|
|
delete filterParser; |
|
|
|
} |
|
|
|
} |
|
|
|
filterPath = ""; |
|
|
|
filterPath = ""; |
|
|
@ -2547,3 +2550,13 @@ qlonglong QBtSession::getETA(const QString &hash) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return m_speedMonitor->getETA(hash); |
|
|
|
return m_speedMonitor->getETA(hash); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QBtSession::handleIPFilterParsed(int ruleCount) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
addConsoleMessage(tr("Successfuly parsed the provided IP filter: %1 rules were applied.", "%1 is a number").arg(ruleCount)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QBtSession::handleIPFilterError() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
addConsoleMessage(tr("Error: Failed to parse the provided IP filter."), "red"); |
|
|
|
|
|
|
|
} |
|
|
|