summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-02 20:29:44 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-02 20:29:44 (GMT)
commit0e07b10191e454706d63ff17b704e666bd192738 (patch)
tree76990d6763cf7e51a4c00355f2d233b7a8963495
parenta2db3dd1c93260977d46b3780a5cb340425d7711 (diff)
Use unique network manager
-rw-r--r--CMakeLists.txt2
-rw-r--r--messageviewer/src/scamdetection/scamexpandurljob.cpp9
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurljob.cpp5
-rw-r--r--webengineviewer/src/checkphishingurl/checkphishingurljob.h2
4 files changed, 6 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a83080..aa781d8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,7 @@ set(KMIME_LIB_VERSION "5.3.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.3.43")
set(LIBKDEPIM_LIB_VERSION "5.3.42")
set(LIBKLEO_LIB_VERSION "5.3.46")
-set(PIMCOMMON_LIB_VERSION "5.3.54")
+set(PIMCOMMON_LIB_VERSION "5.3.61")
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Network PrintSupport WebEngine WebEngineWidgets WebKitWidgets)
diff --git a/messageviewer/src/scamdetection/scamexpandurljob.cpp b/messageviewer/src/scamdetection/scamexpandurljob.cpp
index 47fb908..d0b7216 100644
--- a/messageviewer/src/scamdetection/scamexpandurljob.cpp
+++ b/messageviewer/src/scamdetection/scamexpandurljob.cpp
@@ -22,6 +22,7 @@
#include "messageviewer_debug.h"
#include <Libkdepim/BroadcastStatus>
+#include <PimCommon/NetworkManager>
#include <KLocalizedString>
@@ -35,18 +36,15 @@ class MessageViewer::ScamExpandUrlJobPrivate
{
public:
ScamExpandUrlJobPrivate()
- : mNetworkAccessManager(Q_NULLPTR),
- mNetworkConfigurationManager(Q_NULLPTR)
+ : mNetworkAccessManager(Q_NULLPTR)
{
}
~ScamExpandUrlJobPrivate()
{
- delete mNetworkConfigurationManager;
}
QNetworkAccessManager *mNetworkAccessManager;
- QNetworkConfigurationManager *mNetworkConfigurationManager;
};
ScamExpandUrlJob::ScamExpandUrlJob(QObject *parent)
@@ -56,7 +54,6 @@ ScamExpandUrlJob::ScamExpandUrlJob(QObject *parent)
d->mNetworkAccessManager = new QNetworkAccessManager(this);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, &ScamExpandUrlJob::slotExpandFinished);
- d->mNetworkConfigurationManager = new QNetworkConfigurationManager();
}
ScamExpandUrlJob::~ScamExpandUrlJob()
@@ -66,7 +63,7 @@ ScamExpandUrlJob::~ScamExpandUrlJob()
void ScamExpandUrlJob::expandedUrl(const QUrl &url)
{
- if (!d->mNetworkConfigurationManager->isOnline()) {
+ if (!PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline()) {
KPIM::BroadcastStatus::instance()->setStatusMsg(i18n("No network connection detected, we cannot expand url."));
deleteLater();
return;
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurljob.cpp b/webengineviewer/src/checkphishingurl/checkphishingurljob.cpp
index a8b829b..e50fe87 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurljob.cpp
+++ b/webengineviewer/src/checkphishingurl/checkphishingurljob.cpp
@@ -21,6 +21,7 @@
#include <QNetworkAccessManager>
#include <QNetworkConfigurationManager>
#include <QNetworkReply>
+#include <PimCommon/NetworkManager>
using namespace WebEngineViewer;
@@ -29,12 +30,10 @@ CheckPhishingUrlJob::CheckPhishingUrlJob(QObject *parent)
{
mNetworkAccessManager = new QNetworkAccessManager(this);
connect(mNetworkAccessManager, &QNetworkAccessManager::finished, this, &CheckPhishingUrlJob::slotCheckUrlFinished);
- mNetworkConfigurationManager = new QNetworkConfigurationManager();
}
CheckPhishingUrlJob::~CheckPhishingUrlJob()
{
- delete mNetworkConfigurationManager;
}
void CheckPhishingUrlJob::slotCheckUrlFinished(QNetworkReply *reply)
@@ -83,7 +82,7 @@ void CheckPhishingUrlJob::slotError(QNetworkReply::NetworkError error)
bool CheckPhishingUrlJob::canStart() const
{
- if (!mNetworkConfigurationManager->isOnline()) {
+ if (!PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline()) {
//TODO it's not online !
return false;
}
diff --git a/webengineviewer/src/checkphishingurl/checkphishingurljob.h b/webengineviewer/src/checkphishingurl/checkphishingurljob.h
index 14ab273..9e70c94 100644
--- a/webengineviewer/src/checkphishingurl/checkphishingurljob.h
+++ b/webengineviewer/src/checkphishingurl/checkphishingurljob.h
@@ -25,7 +25,6 @@
#include <QNetworkReply>
#include "webengineviewer_export.h"
class QNetworkAccessManager;
-class QNetworkConfigurationManager;
namespace WebEngineViewer
{
/* https://developers.google.com/safe-browsing/v4/lookup-api */
@@ -56,7 +55,6 @@ private:
void slotCheckUrlFinished(QNetworkReply *reply);
QUrl mUrl;
QNetworkAccessManager *mNetworkAccessManager;
- QNetworkConfigurationManager *mNetworkConfigurationManager;
};
}