summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-16 07:15:35 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-16 07:15:35 (GMT)
commita82c604ebcafd4941cfdd6e6f19332a0bce1c152 (patch)
tree3ba18e9f5b4d3148066cab315a76b7a9ac91e99b
parent1b465059b1d843b5df92db0cca117e73be390d16 (diff)
Add more enum value
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp4
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h10
-rw-r--r--webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp2
-rw-r--r--webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h3
4 files changed, 14 insertions, 5 deletions
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
index eec7fd4..d48e754 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.cpp
@@ -40,10 +40,10 @@ void CheckPhishingUrlFromLocalDataBaseJob::setCheckPhisingUrl(const QUrl &url)
void CheckPhishingUrlFromLocalDataBaseJob::start()
{
if (mUrl.isValid()) {
- //TODO
+ Q_EMIT finished(InvalidUrl);
deleteLater();
} else {
- //TODO
+ //TODO check in local database
}
}
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h
index f814a2c..060102a 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h
+++ b/webengineviewer/src/checkphishingurl/checkphishingurlfromlocaldatabasejob.h
@@ -30,6 +30,14 @@ class WEBENGINEVIEWER_EXPORT CheckPhishingUrlFromLocalDataBaseJob : public QObje
{
Q_OBJECT
public:
+ enum UrlStatus {
+ Ok = 0,
+ MalWare,
+ BrokenNetwork,
+ InvalidUrl,
+ Unknown
+ };
+
explicit CheckPhishingUrlFromLocalDataBaseJob(QObject *parent = Q_NULLPTR);
~CheckPhishingUrlFromLocalDataBaseJob();
void setCheckPhisingUrl(const QUrl &url);
@@ -40,7 +48,7 @@ public:
QString createHash();
Q_SIGNALS:
- void finished();
+ void finished(WebEngineViewer::CheckPhishingUrlFromLocalDataBaseJob::UrlStatus status);
private:
QUrl mUrl;
diff --git a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
index 6a09f17..10a272b 100644
--- a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
+++ b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
@@ -56,7 +56,7 @@ void CreatePhishingUrlDataBaseJob::slotSslErrors(QNetworkReply *reply, const QLi
void CreatePhishingUrlDataBaseJob::start()
{
if (!PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline()) {
- Q_EMIT finished(UnknownError);
+ Q_EMIT finished(BrokenNetwork);
deleteLater();
} else {
QUrl safeUrl = QUrl(QStringLiteral("https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch"));
diff --git a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h
index 71bdeee..038d4ee 100644
--- a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h
+++ b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h
@@ -53,7 +53,8 @@ public:
enum DataBaseDownloadResult {
InvalidData = 0,
ValidData = 1,
- UnknownError = 2
+ UnknownError = 2,
+ BrokenNetwork = 3
};
explicit CreatePhishingUrlDataBaseJob(QObject *parent = Q_NULLPTR);