mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 22:33:34 -07:00
Update categoryfiltermodel.cpp
This commit is contained in:
parent
871ba0866e
commit
fb349f0d78
1 changed files with 7 additions and 3 deletions
|
@ -25,7 +25,7 @@
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
#include <memory>
|
||||||
#include "categoryfiltermodel.h"
|
#include "categoryfiltermodel.h"
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
@ -333,8 +333,12 @@ void CategoryFilterModel::categoryAdded(const QString &categoryName)
|
||||||
|
|
||||||
const int row = parent->childCount();
|
const int row = parent->childCount();
|
||||||
beginInsertRows(index(parent), row, row);
|
beginInsertRows(index(parent), row, row);
|
||||||
new CategoryModelItem(
|
std::unique_ptr<CategoryModelItem> newItem = std::make_unique<CategoryModelItem>(
|
||||||
parent, m_isSubcategoriesEnabled ? shortName(categoryName) : categoryName);
|
parent, m_isSubcategoriesEnabled ? shortName(categoryName) : categoryName
|
||||||
|
);
|
||||||
|
|
||||||
|
parent->addChild(std::move(newItem));
|
||||||
|
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue