mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Merge pull request #11356 from Chocobo1/banIP
Allow to select multiple entries in "banned IP" dialog
This commit is contained in:
commit
475fbfb712
2 changed files with 9 additions and 2 deletions
|
@ -107,8 +107,12 @@ void BanListOptionsDialog::on_buttonBanIP_clicked()
|
||||||
|
|
||||||
void BanListOptionsDialog::on_buttonDeleteIP_clicked()
|
void BanListOptionsDialog::on_buttonDeleteIP_clicked()
|
||||||
{
|
{
|
||||||
const QModelIndexList selection = m_ui->bannedIPList->selectionModel()->selectedIndexes();
|
QModelIndexList selection = m_ui->bannedIPList->selectionModel()->selectedIndexes();
|
||||||
for (const auto &i : selection)
|
std::sort(selection.begin(), selection.end(), [](const QModelIndex &left, const QModelIndex &right)
|
||||||
|
{
|
||||||
|
return (left.row() > right.row());
|
||||||
|
});
|
||||||
|
for (const QModelIndex &i : selection)
|
||||||
m_sortFilter->removeRow(i.row());
|
m_sortFilter->removeRow(i.row());
|
||||||
|
|
||||||
m_modified = true;
|
m_modified = true;
|
||||||
|
|
|
@ -49,6 +49,9 @@
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||||
|
</property>
|
||||||
<property name="rootIsDecorated">
|
<property name="rootIsDecorated">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue