volume ID added to VolumesModel

This commit is contained in:
Luis Ángel San Martín 2013-10-14 19:31:52 +02:00
parent e924e74c07
commit 0d63bce2b5
4 changed files with 13 additions and 2 deletions

View File

@ -38,8 +38,9 @@ void VolumesModel::load(const QString &json)
QString publisher = resultsValue.property("publisher").property("name").toString();
QString url = resultsValue.property("image").property("medium_url").toString();
QString deck = resultsValue.property("deck").toString();
QString id = resultsValue.property("id").toString();
QStringList & l = *(new QStringList);
l << name << year << numIssues << publisher << url << deck;
l << name << year << numIssues << publisher << url << deck << id;
test = name.isEmpty() && year.isEmpty() && numIssues.isEmpty() && url.isEmpty();
if(numResults>0 && !test)
_data.push_back(&l);

View File

@ -36,7 +36,8 @@ public:
ISSUES,
PUBLISHER,
COVER_URL,
DECK
DECK,
ID
};
};

View File

@ -137,6 +137,7 @@ void SelectVolume::loadVolumeInfo(const QModelIndex & mi)
QStringList * data = static_cast<QStringList *>(mi.internalPointer());
QString coverURL = data->at(VolumesModel::COVER_URL);
QString deck = data->at(VolumesModel::DECK);
QString id = data->at(VolumesModel::ID);
//cover->setText(coverURL);
detailLabel->setText(deck);
@ -146,6 +147,7 @@ void SelectVolume::loadVolumeInfo(const QModelIndex & mi)
connect(search,SIGNAL(timeout()),this,SLOT(queryTimeOut())); //TODO
connect(search,SIGNAL(finished()),search,SLOT(deleteLater()));
search->get();
}
void SelectVolume::setCover(const QByteArray & data)
@ -162,3 +164,9 @@ void SelectVolume::setCover(const QByteArray & data)
cover->update();
}
void SelectVolume::setDescription(const QString &description)
{
}

View File

@ -18,6 +18,7 @@ public:
public slots:
void loadVolumeInfo(const QModelIndex & mi);
void setCover(const QByteArray &);
void setDescription(const QString & description);
private:
QLabel * cover;
QLabel * detailLabel;