mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
FEATURE: Give feedback regarding the IP filter parsing
This commit is contained in:
parent
747eb4562a
commit
af63ba9a8d
3 changed files with 19 additions and 3 deletions
|
@ -386,7 +386,7 @@ void QBtSession::configureSession() {
|
|||
sessionSettings.auto_scrape_min_interval = 900; // 15 minutes
|
||||
#endif
|
||||
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
|
||||
if(pref.isQueueingSystemEnabled()) {
|
||||
sessionSettings.active_downloads = pref.getMaxActiveDownloads();
|
||||
|
@ -1749,6 +1749,8 @@ void QBtSession::enableIPFilter(QString filter) {
|
|||
qDebug("Enabling IPFiler");
|
||||
if(!filterParser) {
|
||||
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) {
|
||||
filterPath = filter;
|
||||
|
@ -1761,6 +1763,7 @@ void QBtSession::disableIPFilter() {
|
|||
qDebug("Disabling IPFilter");
|
||||
s->set_ip_filter(ip_filter());
|
||||
if(filterParser) {
|
||||
disconnect(filterParser.data(), 0, this, 0);
|
||||
delete filterParser;
|
||||
}
|
||||
filterPath = "";
|
||||
|
@ -2547,3 +2550,13 @@ qlonglong QBtSession::getETA(const QString &hash) const
|
|||
{
|
||||
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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue