summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-18 14:15:22 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-18 14:15:22 (GMT)
commit41a2bb46c39ef2c415697dd9852a94fa43c9796f (patch)
treed265140481d1ca09823f634345797d8edd0626b0
parent05dfc61523176fb124e9912d6f28d30f67852fcd (diff)
Move method to localdatabasemanager directly
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp8
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h2
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.cpp5
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.h2
4 files changed, 8 insertions, 9 deletions
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
index 09c1628..3ebb488 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
@@ -45,9 +45,8 @@ void CheckPhishingUrlFromLocalDataBaseJob::start()
Q_EMIT finished(mUrl, InvalidUrl);
deleteLater();
} else {
- QByteArray hash = createHash();
connect(LocalDataBaseManager::self(), &LocalDataBaseManager::checkUrlFinished, this, &CheckPhishingUrlFromLocalDataBaseJob::slotCheckUrlFinished);
- //LocalDataBaseManager::self()->checkUrl(/*TODO*/);
+ LocalDataBaseManager::self()->checkUrl(mUrl);
}
}
@@ -74,8 +73,3 @@ bool CheckPhishingUrlFromLocalDataBaseJob::canStart() const
{
return mUrl.isValid();
}
-
-QByteArray CheckPhishingUrlFromLocalDataBaseJob::createHash()
-{
- return QCryptographicHash::hash(QByteArray() /*TODO use url*/, QCryptographicHash::Sha256);
-}
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h
index 54f0aa0..0fa1485 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h
@@ -45,8 +45,6 @@ public:
void start();
bool canStart() const;
- QByteArray createHash();
-
Q_SIGNALS:
void finished(const QUrl &url, WebEngineViewer::CheckPhishingUrlFromLocalDataBaseJob::UrlStatus status);
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
index 55d5b4d..2e1e29b 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
@@ -31,6 +31,7 @@
#include <QDebug>
#include <QDir>
#include <QTimer>
+#include <QCryptographicHash>
using namespace WebEngineViewer;
@@ -275,3 +276,7 @@ void LocalDataBaseManager::checkUrl(const QUrl &url)
//TODO
}
+QByteArray LocalDataBaseManager::createHash()
+{
+ return QCryptographicHash::hash(QByteArray() /*TODO use url*/, QCryptographicHash::Sha256);
+}
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.h b/webengineviewer/src/checkphishingurl/localdatabasemanager.h
index b36eb96..fada198 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.h
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.h
@@ -70,7 +70,9 @@ private:
void slotCheckDataBase();
bool initializeDataBase();
+ QByteArray createHash();
bool createTable();
+
QSqlDatabase mDataBase;
QString mNewClientState;
QTimer *mRegularCheckDataBaseTimer;