Browse Source

Make TorrentContentModel populating more efficient

Step to improve issue #24.
adaptive-webui-19844
Christophe Dumez 12 years ago
parent
commit
d849ac32f9
  1. 9
      src/torrentcontentmodelfolder.cpp

9
src/torrentcontentmodelfolder.cpp

@ -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…
Cancel
Save