mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
Improve Torrent content tree structure creation
Use QHash to cache folder items. PR #16183.
This commit is contained in:
@@ -81,17 +81,6 @@ TorrentContentModelItem *TorrentContentModelFolder::child(int row) const
|
||||
{
|
||||
return m_childItems.value(row, nullptr);
|
||||
}
|
||||
|
||||
TorrentContentModelFolder *TorrentContentModelFolder::childFolderWithName(const QString &name) const
|
||||
{
|
||||
for (TorrentContentModelItem *child : asConst(m_childItems))
|
||||
{
|
||||
if ((child->itemType() == FolderType) && (child->name() == name))
|
||||
return static_cast<TorrentContentModelFolder *>(child);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int TorrentContentModelFolder::childCount() const
|
||||
{
|
||||
return m_childItems.count();
|
||||
|
||||
Reference in New Issue
Block a user