Allow creating new packs

This commit is contained in:
Nicolas Werner 2021-08-06 04:31:30 +02:00
parent 16d0190f4e
commit e5a6b2b6ef
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
6 changed files with 58 additions and 6 deletions

View file

@ -74,3 +74,21 @@ ImagePackListModel::packAt(int row)
QQmlEngine::setObjectOwnership(e, QQmlEngine::CppOwnership);
return e;
}
SingleImagePackModel *
ImagePackListModel::newPack(bool inRoom)
{
ImagePackInfo info{};
if (inRoom)
info.source_room = room_id;
return new SingleImagePackModel(info);
}
bool
ImagePackListModel::containsAccountPack() const
{
for (const auto &p : packs)
if (p->roomid().isEmpty())
return true;
return false;
}