[Bug 303336] Model Errors
David Edmundson
kde at davidedmundson.co.uk
Wed Jul 11 00:41:34 BST 2012
https://bugs.kde.org/show_bug.cgi?id=303336
--- Comment #1 from David Edmundson <kde at davidedmundson.co.uk> ---
FRom the code:
if (newEntries.size() > 0) {
Q_FOREACH(const Tpl::EntityPtr &entity, newEntries) {
EntityModelItem *parent =
m_rootItem->item(pendingEntities->account());
if (!parent) {
beginInsertRows(QModelIndex(), m_rootItem->itemCount(),
m_rootItem->itemCount());
parent = new EntityModelItem(m_rootItem);
parent->setData(QVariant::fromValue(pendingEntities->account()),
EntityModel::AccountRole);
m_rootItem->addItem(parent);
endInsertRows();
}
QModelIndex parentIndex = index(parent->row(), 0, QModelIndex());
beginInsertRows(parentIndex,
m_rootItem->item(parentIndex.row())->row(),
m_rootItem->item(parentIndex.row())->row() + 1);
EntityModelItem *item = new EntityModelItem(parent);
item->setData(QVariant::fromValue(pendingEntities->account()),
EntityModel::AccountRole);
item->setData(QVariant::fromValue(entity),
EntityModel::EntityRole);
parent->addItem(item);
if (pendingEntities->account()->connection()) {
Tp::PendingOperation *op =
pendingEntities->account()->connection()->contactManager()->contactsForIdentifiers(
QStringList() <<
entity->identifier());
connect(op, SIGNAL(finished(Tp::PendingOperation*)),
this,
SLOT(onEntityContactRetrieved(Tp::PendingOperation*)));
}
}
endInsertRows();
}
}
these beginInsertRows and endInsertRows doe not line up.
if there are many entities being inserted, beginInsert is called many times,
endInsert only once.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Kde-telepathy-bugs
mailing list