summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-18 05:49:37 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-18 05:49:37 (GMT)
commit2b5b01085939739f0e35fc40c01709fa803fe503 (patch)
tree77bfd33dc6f59083feb7dbe6c4b3c013c025107d
parent8c449d6a07a5da76080da9222e09c222eeac40ad (diff)
Add clear method
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.cpp10
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.h4
-rw-r--r--webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.cpp12
-rw-r--r--webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.h1
4 files changed, 23 insertions, 4 deletions
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
index b75e8ac..fded10f 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
@@ -68,6 +68,16 @@ void LocalDataBaseManager::closeDataBaseAndDeleteIt()
}
}
+void LocalDataBaseManager::readConfig()
+{
+ //TODO
+}
+
+void LocalDataBaseManager::saveConfig()
+{
+ //TODO
+}
+
void LocalDataBaseManager::start()
{
if (!mDataBaseOk) {
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.h b/webengineviewer/src/checkphishingurl/localdatabasemanager.h
index 045254c..e20a5ee 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.h
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.h
@@ -52,6 +52,10 @@ public:
Q_SIGNALS:
void checkUrlFinished(const QUrl &url, WebEngineViewer::LocalDataBaseManager::UrlStatus status);
private:
+
+ void readConfig();
+ void saveConfig();
+
void slotDownloadFullDataBaseFinished(const WebEngineViewer::UpdateDataBaseInfo &infoDataBase, WebEngineViewer::CreatePhishingUrlDataBaseJob::DataBaseDownloadResult status);
QSqlError initDb();
bool initializeDataBase();
diff --git a/webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.cpp b/webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.cpp
index ded39b2..3f96567 100644
--- a/webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.cpp
+++ b/webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.cpp
@@ -60,12 +60,17 @@ CreatePhisingUrlDataBaseGui::~CreatePhisingUrlDataBaseGui()
}
+void CreatePhisingUrlDataBaseGui::clear()
+{
+ mJson->clear();
+ mResult->clear();
+}
+
void CreatePhisingUrlDataBaseGui::slotDownloadPartialDatabase()
{
const QString newValue = QInputDialog::getText(this, QStringLiteral("Define database newClientState"), QStringLiteral("newClientState:"));
if (!newValue.isEmpty()) {
- mJson->clear();
- mResult->clear();
+ clear();
WebEngineViewer::CreatePhishingUrlDataBaseJob *job = new WebEngineViewer::CreatePhishingUrlDataBaseJob(this);
job->setUseCompactJson(false);
job->setDataBaseDownloadNeeded(WebEngineViewer::CreatePhishingUrlDataBaseJob::UpdateDataBase);
@@ -78,8 +83,7 @@ void CreatePhisingUrlDataBaseGui::slotDownloadPartialDatabase()
void CreatePhisingUrlDataBaseGui::slotDownloadFullDatabase()
{
- mJson->clear();
- mResult->clear();
+ clear();
WebEngineViewer::CreatePhishingUrlDataBaseJob *job = new WebEngineViewer::CreatePhishingUrlDataBaseJob(this);
job->setUseCompactJson(false);
connect(job, &WebEngineViewer::CreatePhishingUrlDataBaseJob::debugJsonResult, this, &CreatePhisingUrlDataBaseGui::slotResult);
diff --git a/webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.h b/webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.h
index 3d3d7f0..3de1fff 100644
--- a/webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.h
+++ b/webengineviewer/src/checkphishingurl/tests/createphishingurldatabasegui.h
@@ -34,6 +34,7 @@ private Q_SLOTS:
void slotDebugJSon(const QByteArray &data);
void slotDownloadPartialDatabase();
private:
+ void clear();
QTextEdit *mResult;
QTextEdit *mJson;
};