Commit c9d5c0a1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve localdatabasefile

parent c97f4b28
......@@ -21,8 +21,8 @@
using namespace WebEngineViewer;
LocalDataBaseFile::LocalDataBaseFile(QObject *parent)
: QObject(parent)
LocalDataBaseFile::LocalDataBaseFile(const QString &filename)
: mFileName(filename)
{
}
......@@ -31,3 +31,8 @@ LocalDataBaseFile::~LocalDataBaseFile()
{
}
void LocalDataBaseFile::initialize()
{
//TODO
}
......@@ -19,16 +19,19 @@
#ifndef LOCALDATABASEFILE_H
#define LOCALDATABASEFILE_H
#include <QObject>
#include <QString>
namespace WebEngineViewer
{
class LocalDataBaseFile : public QObject
class LocalDataBaseFile
{
Q_OBJECT
public:
explicit LocalDataBaseFile(QObject *parent = Q_NULLPTR);
LocalDataBaseFile(const QString &filename);
~LocalDataBaseFile();
private:
void initialize();
QString mFileName;
};
}
......
......@@ -97,14 +97,17 @@ void SearchFullHashJob::parse(const QByteArray &replyStr)
return;
} else {
const QVariantList info = answer.value(QStringLiteral("matches")).toList();
//Implement multi match ?
if (info.count() == 1) {
const QVariantMap map = info.at(0).toMap();
const QString threatTypeStr = map[QStringLiteral("threatType")].toString();
if (threatTypeStr == QStringLiteral("MALWARE")) {
const QVariantMap urlMap = map[QStringLiteral("threat")].toMap();
if (urlMap.count() == 1) {
const QString hashStr = urlMap[QStringLiteral("hash")].toString();
//TODO
/*
if (urlMap[QStringLiteral("url")].toString() == mHash.toString()) {
if (urlMap[QStringLiteral("hash")].toString() == mHash.toString()) {
Q_EMIT result(WebEngineViewer::SearchFullHashJob::MalWare, mHash);
return;
}
......@@ -162,7 +165,7 @@ QByteArray SearchFullHashJob::jsonRequest() const
clientMap.insert(QStringLiteral("clientVersion"), QStringLiteral("5.4.0")); //FIXME
map.insert(QStringLiteral("client"), clientMap);
//clientStates
//clientStates We can support multi database.
const QVariantList clientStatesList = { mDatabaseHash };
map.insert(QStringLiteral("clientStates"), clientStatesList);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment