|
|
@ -35,6 +35,7 @@ |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QMessageBox> |
|
|
|
|
|
|
|
|
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
|
|
|
|
#include "base/global.h" |
|
|
|
#include "categoryfiltermodel.h" |
|
|
|
#include "categoryfiltermodel.h" |
|
|
|
#include "categoryfilterproxymodel.h" |
|
|
|
#include "categoryfilterproxymodel.h" |
|
|
|
#include "guiiconprovider.h" |
|
|
|
#include "guiiconprovider.h" |
|
|
@ -232,8 +233,7 @@ void CategoryFilterWidget::removeCategory() |
|
|
|
void CategoryFilterWidget::removeUnusedCategories() |
|
|
|
void CategoryFilterWidget::removeUnusedCategories() |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto session = BitTorrent::Session::instance(); |
|
|
|
auto session = BitTorrent::Session::instance(); |
|
|
|
for (auto i = session->categories().cbegin(); i != session->categories().cend(); ++i) { |
|
|
|
for (const QString &category : copyAsConst(session->categories().keys())) { |
|
|
|
const QString &category = i.key(); |
|
|
|
|
|
|
|
if (model()->data(static_cast<CategoryFilterProxyModel *>(model())->index(category), Qt::UserRole) == 0) |
|
|
|
if (model()->data(static_cast<CategoryFilterProxyModel *>(model())->index(category), Qt::UserRole) == 0) |
|
|
|
session->removeCategory(category); |
|
|
|
session->removeCategory(category); |
|
|
|
} |
|
|
|
} |
|
|
|