mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 00:58:32 -04:00
fixed json loading in VolumesModel
This commit is contained in:
parent
95612284ac
commit
9938167a90
@ -27,7 +27,8 @@ void VolumesModel::load(const QString &json)
|
||||
{
|
||||
int numResults = sc.property("number_of_total_results").toString().toInt(); //fix to weird behaviour using hasNext
|
||||
QScriptValueIterator it(sc.property("results"));
|
||||
while (numResults > 0) {
|
||||
bool test;
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
QString numIssues = it.value().property("count_of_issues").toString();
|
||||
QString year = it.value().property("start_year").toString();
|
||||
@ -36,7 +37,9 @@ void VolumesModel::load(const QString &json)
|
||||
QString url = it.value().property("image").property("screen_url").toString();
|
||||
QStringList & l = *(new QStringList);
|
||||
l << name << year << numIssues << publisher << url;
|
||||
_data.push_back(&l);
|
||||
test = name.isEmpty() && year.isEmpty() && numIssues.isEmpty() && url.isEmpty();
|
||||
if(numResults>0 && !test)
|
||||
_data.push_back(&l);
|
||||
numResults--;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user