summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-18 15:10:50 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-18 15:10:50 (GMT)
commit135da872ec67ada1aa4fda327c67f5cbf9421d35 (patch)
treec77d26bcfaf21805691057c69be4e07ecf8fbce8
parent41a2bb46c39ef2c415697dd9852a94fa43c9796f (diff)
Improve localmanager
-rw-r--r--webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.cpp6
-rw-r--r--webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.h4
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp2
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.cpp7
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.h1
5 files changed, 15 insertions, 5 deletions
diff --git a/webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.cpp b/webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.cpp
index e02b7c1..876b66e 100644
--- a/webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.cpp
+++ b/webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.cpp
@@ -31,10 +31,16 @@ public:
}
+ void setDownloadInfoSendByServer(const QString &data) {
+ mDownloadInfoSendByServer = data;
+ }
+
// LocalDataBaseManager interface
protected:
void downloadFullDataBase() Q_DECL_OVERRIDE;
void downloadPartialDataBase() Q_DECL_OVERRIDE;
+private:
+ QString mDownloadInfoSendByServer;
};
void TestLocalDataBaseManager::downloadFullDataBase()
diff --git a/webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.h b/webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.h
index b7493a5..d13a3e0 100644
--- a/webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.h
+++ b/webengineviewer/src/checkphishingurl/autotests/localdatabasemanagertest.h
@@ -28,10 +28,6 @@ class LocalDataBaseManagerTest : public QObject
public:
explicit LocalDataBaseManagerTest(QObject *parent = Q_NULLPTR);
~LocalDataBaseManagerTest();
-
-signals:
-
-public slots:
};
#endif // LOCALDATABASEMANAGERTEST_H
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
index 3ebb488..f8a5294 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
@@ -64,7 +64,7 @@ void CheckPhishingUrlFromLocalDataBaseJob::slotCheckUrlFinished(const QUrl &url,
break;
}
- Q_EMIT finished(url, currentStatus);
+ Q_EMIT finished(url, currentStatus);
deleteLater();
}
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
index 2e1e29b..8e0503f 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
@@ -191,6 +191,7 @@ void LocalDataBaseManager::slotDownloadDataBaseFinished(const WebEngineViewer::U
}
}
}
+ checkDataBase();
mDownloadProgress = false;
//We finish to download restart timer if necessary
if (mRegularCheckDataBaseTimer && !mRegularCheckDataBaseTimer->isActive()) {
@@ -198,6 +199,12 @@ void LocalDataBaseManager::slotDownloadDataBaseFinished(const WebEngineViewer::U
}
}
+void LocalDataBaseManager::checkDataBase()
+{
+ //TODO get all hash and use sha256
+ //TODO
+}
+
void LocalDataBaseManager::removeElementFromDataBase(const QVector<Removal> &removalList)
{
Q_FOREACH(const Removal &removeItem, removalList) {
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.h b/webengineviewer/src/checkphishingurl/localdatabasemanager.h
index fada198..266f92a 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.h
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.h
@@ -71,6 +71,7 @@ private:
bool initializeDataBase();
QByteArray createHash();
+ void checkDataBase();
bool createTable();
QSqlDatabase mDataBase;