Basic JSON RESTful client fetching items from a local server at application start and adding them to the model.
This commit is contained in:
@ -193,6 +193,12 @@ void TableModel::insertItems(int startPosition,
|
||||
const QModelIndex& parentIndex) {
|
||||
const QList<ModelItemValues> valueList = JsonParser::toItemValuesList(jsonDoc, ITEM_KEY_STRING);
|
||||
|
||||
if (valueList.empty()) {
|
||||
/// don't try inserting if no values to insert
|
||||
qDebug() << "No items found in JSON document. Not adding anything...";
|
||||
return;
|
||||
}
|
||||
|
||||
insertItems(startPosition, valueList, parentIndex);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user