Support item tabs based on item group string
This commit is contained in:
parent
0e09b6f46c
commit
a17cd23a4e
29 changed files with 527 additions and 181 deletions
|
|
@ -10,7 +10,7 @@ ItemLoaderSource::ItemLoaderSource(const QJsonObject& json, QObject *parent):
|
|||
|
||||
void ItemLoaderSource::refresh()
|
||||
{
|
||||
std::vector<std::shared_ptr<Item>> items;
|
||||
std::vector<ItemAddRequest> itemAddRequests;
|
||||
const QJsonArray itemsArray(json["Items"].toArray());
|
||||
for(int i = 0; i < itemsArray.size(); ++i)
|
||||
{
|
||||
|
|
@ -21,11 +21,15 @@ void ItemLoaderSource::refresh()
|
|||
std::shared_ptr<Item> newItem = Item::loadItem(itemObject);
|
||||
if(newItem)
|
||||
{
|
||||
items.push_back(newItem);
|
||||
qDebug()<<"Loaded item"<<newItem->getName();
|
||||
ItemAddRequest request;
|
||||
request.type = ITEM_UPDATE_LOADED;
|
||||
request.payload = newItem;
|
||||
request.changes = ItemFieldChanges(true);
|
||||
itemAddRequests.push_back(request);
|
||||
}
|
||||
}
|
||||
gotItems(items, ITEM_UPDATE_LOADED);
|
||||
gotItems(itemAddRequests);
|
||||
}
|
||||
|
||||
void ItemLoaderSource::updateJson(const QJsonObject& json)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue