summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-16 06:48:53 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-16 06:48:53 (GMT)
commit3baeca18c5c029a5be865a2ce9fe0949de6972ee (patch)
treece4ed3aeee7d6f89299ae8a7d547f934a5bfb390
parent2cca5b73a7364c47337345e0c02dabce394735c5 (diff)
improve parsing
-rw-r--r--webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
index 01054e8..66523f3 100644
--- a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
+++ b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
@@ -178,7 +178,6 @@ void CreatePhishingUrlDataBaseJob::parseResult(const QByteArray &value)
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) {
@@ -188,21 +187,33 @@ void CreatePhishingUrlDataBaseJob::parseResult(const QByteArray &value)
mapIt.next();
const QString mapKey = mapIt.key();
if (mapKey == QLatin1String("additions")) {
-
+ qDebug() << " addition" << mapIt.value().typeName();
+ const QVariantList lst = mapIt.value().toList();
+ } else if (mapKey == QLatin1String("removals")) {
+ qDebug() << " removals items ";
+ const QVariantList lst = mapIt.value().toList();
} else if (mapKey == QLatin1String("checksum")) {
-
- } else if (mapKey == QLatin1String("newClientState")) {
-
+ QMapIterator<QString, QVariant> mapCheckSum(mapIt.value().toMap());
+ while (mapCheckSum.hasNext()) {
+ mapCheckSum.next();
+ if (mapCheckSum.key() == QLatin1String("sha256")) {
+ qDebug() << " sha256 value " << mapCheckSum.value().toString();
+ } else {
+ qDebug() << "Invalid checksum key" << mapCheckSum.key();
+ }
+ }
} else if (mapKey == QLatin1String("newClientState")) {
+ qDebug() << " newClientState " << mapIt.value().toString();
} else if (mapKey == QLatin1String("platformType")) {
+ qDebug() << " platformType " << mapIt.value().toString();
} else if (mapKey == QLatin1String("responseType")) {
-
+ qDebug() << " responseType " << mapIt.value().toString();
} else if (mapKey == QLatin1String("threatEntryType")) {
-
+ qDebug() << " threatEntryType " << mapIt.value().toString();
} else if (mapKey == QLatin1String("threatType")) {
-
+ qDebug() << " threatType " << mapIt.value().toString();
} else {
qDebug() << " unknow key " << mapKey;
}
@@ -211,8 +222,7 @@ void CreatePhishingUrlDataBaseJob::parseResult(const QByteArray &value)
}
}
} else if (i.key() == QLatin1String("minimumWaitDuration")) {
-
- //qDebug() << " i.key()" << i.key();
+ qDebug() << " minimumWaitDuration " << i.value().toString();
} else {
qDebug() <<" map key unknown " << i.key();
}