mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 22:37:59 +00:00
Make TorrentContentModel populating more efficient
Step to improve issue #24.
This commit is contained in:
parent
e0114ebffc
commit
d849ac32f9
@ -70,14 +70,7 @@ const QList<TorrentContentModelItem*>& TorrentContentModelFolder::children() con
|
|||||||
void TorrentContentModelFolder::appendChild(TorrentContentModelItem* item)
|
void TorrentContentModelFolder::appendChild(TorrentContentModelItem* item)
|
||||||
{
|
{
|
||||||
Q_ASSERT(item);
|
Q_ASSERT(item);
|
||||||
|
m_childItems.append(item);
|
||||||
int i=0;
|
|
||||||
for ( ; i < m_childItems.size(); ++i) {
|
|
||||||
QString newchild_name = item->name();
|
|
||||||
if (QString::localeAwareCompare(newchild_name, m_childItems.at(i)->name()) < 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
m_childItems.insert(i, item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TorrentContentModelItem* TorrentContentModelFolder::child(int row) const
|
TorrentContentModelItem* TorrentContentModelFolder::child(int row) const
|
||||||
|
Loading…
Reference in New Issue
Block a user