mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-02-23 19:29:40 +08:00
bug fix in ipfilter
This commit is contained in:
parent
09c97decb6
commit
a5b8d3c730
@ -1085,7 +1085,9 @@ void options_imp::on_addFilterRange_clicked(){
|
||||
|
||||
|
||||
|
||||
if(!ok || startIP.isEmpty()
|
||||
if(!ok) {
|
||||
return;
|
||||
} else if(startIP.isEmpty()
|
||||
|| (!startIP.contains(is_ipv4) && !startIP.contains(is_ipv6))){
|
||||
QMessageBox::critical(0, tr("Invalid IP"), tr("This IP is invalid."));
|
||||
return;
|
||||
@ -1100,7 +1102,9 @@ void options_imp::on_addFilterRange_clicked(){
|
||||
tr("End IP:"), QLineEdit::Normal,
|
||||
startIP, &ok);
|
||||
// check IP
|
||||
if (!ok || lastIP.isEmpty()
|
||||
if (!ok) {
|
||||
return;
|
||||
} else if(lastIP.isEmpty()
|
||||
|| (!lastIP.contains(is_ipv4) && !lastIP.contains(is_ipv6))
|
||||
|| (ipv4 == true && !lastIP.contains(is_ipv4))
|
||||
|| (ipv4 == false && !lastIP.contains(is_ipv6))){
|
||||
@ -1114,6 +1118,7 @@ void options_imp::on_addFilterRange_clicked(){
|
||||
"", &ok);
|
||||
if (!ok){
|
||||
comment = QString("");
|
||||
return;
|
||||
}
|
||||
QFile ipfilter(misc::qBittorrentPath() + "ipfilter.dat");
|
||||
if (!ipfilter.open(QIODevice::Append | QIODevice::WriteOnly | QIODevice::Text)){
|
||||
|
Loading…
Reference in New Issue
Block a user