summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-16 06:23:56 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-16 06:23:56 (GMT)
commit2cca5b73a7364c47337345e0c02dabce394735c5 (patch)
tree376a41b4667add90c249c4a60580651c15403860
parent680b887ae28b91500076a74deef76387f2fe753b (diff)
Continue to parse json document
-rw-r--r--webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
index 6df6ed6..01054e8 100644
--- a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
+++ b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
@@ -175,9 +175,48 @@ void CreatePhishingUrlDataBaseJob::parseResult(const QByteArray &value)
if (answer.isEmpty()) {
//TODO
} else {
- const QVariantList info = answer.value(QStringLiteral("listUpdateResponses")).toList();
- //TODO
+ QMapIterator<QString, QVariant> i(answer);
+ while (i.hasNext()) {
+ i.next();
+ qDebug()<<" i.key" << i.key();
+ if (i.key() == QLatin1String("listUpdateResponses")) {
+ const QVariantList info = i.value().toList();
+ if (info.count() == 1) {
+ if (info.at(0).canConvert<QVariantMap>()) {
+ QMapIterator<QString, QVariant> mapIt(info.at(0).toMap());
+ while (mapIt.hasNext()) {
+ mapIt.next();
+ const QString mapKey = mapIt.key();
+ if (mapKey == QLatin1String("additions")) {
+
+ } else if (mapKey == QLatin1String("checksum")) {
+
+ } else if (mapKey == QLatin1String("newClientState")) {
+
+ } else if (mapKey == QLatin1String("newClientState")) {
+
+ } else if (mapKey == QLatin1String("platformType")) {
+
+ } else if (mapKey == QLatin1String("responseType")) {
+
+ } else if (mapKey == QLatin1String("threatEntryType")) {
+
+ } else if (mapKey == QLatin1String("threatType")) {
+
+ } else {
+ qDebug() << " unknow key " << mapKey;
+ }
+
+ }
+ }
+ }
+ } else if (i.key() == QLatin1String("minimumWaitDuration")) {
+
+ //qDebug() << " i.key()" << i.key();
+ } else {
+ qDebug() <<" map key unknown " << i.key();
+ }
+ }
}
- //TODO
}
}