Add a poolAt() convenience function to the model

This will allow retrieving pools from the UI.
This commit is contained in:
Luca Beltrame 2015-02-15 00:58:31 +01:00
commit 5a4d2afa84
2 changed files with 6 additions and 1 deletions

View file

@ -44,7 +44,6 @@ DanbooruPoolModel::~DanbooruPoolModel()
void DanbooruPoolModel::addPool(DanbooruPool *pool)
{
beginInsertRows(QModelIndex(), m_items.size(), m_items.size());
qDebug() << "POOL NAME" << pool->name();
m_items.append(pool);
endInsertRows();
}
@ -117,6 +116,11 @@ void DanbooruPoolModel::clear()
reset();
}
DanbooruPool* DanbooruPoolModel::poolAt(int index) const
{
return m_items.at(index);
}
} // namespace Danbooru