mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
parent
59aac32eb9
commit
fec3a87421
2 changed files with 16 additions and 0 deletions
|
@ -856,3 +856,18 @@ void TorrentsController::removeCategoriesAction()
|
|||
for (const QString &category : categories)
|
||||
BitTorrent::Session::instance()->removeCategory(category);
|
||||
}
|
||||
|
||||
void TorrentsController::categoriesAction()
|
||||
{
|
||||
QJsonObject categories;
|
||||
const auto categoriesList = BitTorrent::Session::instance()->categories();
|
||||
for (auto it = categoriesList.cbegin(); it != categoriesList.cend(); ++it) {
|
||||
const auto &key = it.key();
|
||||
categories[key] = QJsonObject {
|
||||
{"name", key},
|
||||
{"savePath", it.value()}
|
||||
};
|
||||
}
|
||||
|
||||
setResult(categories);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ private slots:
|
|||
void createCategoryAction();
|
||||
void editCategoryAction();
|
||||
void removeCategoriesAction();
|
||||
void categoriesAction();
|
||||
void addAction();
|
||||
void deleteAction();
|
||||
void addTrackersAction();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue