summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-18 12:47:15 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-18 12:47:15 (GMT)
commit688c94c21492202df14d400ac0829a1b7ae96ef3 (patch)
tree06843fb0179a3bf06548672528e55fac47bc429e
parent4d3029e1c96ad806d6534423bb5623013654d4f1 (diff)
Save new database state
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp2
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.cpp7
2 files changed, 8 insertions, 1 deletions
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
index d7e7433..45a5e39 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
@@ -43,6 +43,8 @@ void CheckPhishingUrlFromLocalDataBaseJob::start()
Q_EMIT finished(mUrl, InvalidUrl);
deleteLater();
} else {
+ QByteArray hash = createHash();
+ //TODO
//TODO check in local database
}
}
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
index 36ab645..55d5b4d 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
@@ -85,7 +85,8 @@ void LocalDataBaseManager::readConfig()
void LocalDataBaseManager::saveConfig()
{
KConfig phishingurlKConfig(QStringLiteral("phishingurlrc"));
- //TODO
+ KConfigGroup grp = phishingurlKConfig.group(QStringLiteral("General"));
+ grp.writeEntry(QStringLiteral("DataBaseState"), mNewClientState);
}
void LocalDataBaseManager::downloadPartialDataBase()
@@ -223,12 +224,16 @@ void LocalDataBaseManager::fullUpdateDataBase(const WebEngineViewer::UpdateDataB
{
//Clear DataBase
addElementToDataBase(infoDataBase.additionList);
+ mNewClientState = infoDataBase.newClientState;
+ saveConfig();
}
void LocalDataBaseManager::partialUpdateDataBase(const WebEngineViewer::UpdateDataBaseInfo &infoDataBase)
{
removeElementFromDataBase(infoDataBase.removalList);
addElementToDataBase(infoDataBase.additionList);
+ mNewClientState = infoDataBase.newClientState;
+ saveConfig();
}
LocalDataBaseManager *LocalDataBaseManager::self()