void TagFilterModel::tagAdded(const QString &tag) { const int row = m_tagItems.count(); beginInsertRows(QModelIndex(), row, row); addToModel(tag, 0); endInsertRows(); }
void TagFilterModel::populate() { using Torrent = BitTorrent::TorrentHandle; const auto *session = BitTorrent::Session::instance(); const auto torrents = session->torrents(); // All torrents addToModel(getSpecialAllTag(), torrents.count()); const int untaggedCount = std::count_if(torrents.cbegin(), torrents.cend(), [](Torrent *torrent) { return torrent->tags().isEmpty(); }); addToModel(getSpecialUntaggedTag(), untaggedCount); for (const QString &tag : asConst(session->tags())) { const int count = std::count_if(torrents.cbegin(), torrents.cend(), [tag](Torrent *torrent) { return torrent->hasTag(tag); }); addToModel(tag, count); } }
void PCPolyhedron::increaseLod(const PCPtr& nuCloud) { PCModelObject::increaseLod(nuCloud); addToModel(nuCloud); }