summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-02 20:28:53 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-02 20:28:53 (GMT)
commit81bc266939033144ad736acfc7a73bb7dadd4366 (patch)
tree055c29e0fc72d14da7732a2ae01c12d842b43091
parent3c90410f5fde3f1e9acfda60fcae66e25316c177 (diff)
Use unique network configure manager
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/job/gravatarresolvurljob.cpp10
2 files changed, 4 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63bf659..c13fa05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ set(PIM_VERSION "5.3.40")
set(QT_REQUIRED_VERSION "5.6.0")
set(LIBGRAVATAR_LIB_VERSION ${PIM_VERSION})
-set(PIMCOMMON_LIB_VERSION "5.3.40")
+set(PIMCOMMON_LIB_VERSION "5.3.61")
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Network)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
diff --git a/src/job/gravatarresolvurljob.cpp b/src/job/gravatarresolvurljob.cpp
index fc21526..1d038c7 100644
--- a/src/job/gravatarresolvurljob.cpp
+++ b/src/job/gravatarresolvurljob.cpp
@@ -20,6 +20,7 @@
#include "gravatarresolvurljob.h"
#include "misc/gravatarcache.h"
#include "gravatar_debug.h"
+#include <PimCommon/NetworkManager>
#include <QCoreApplication>
#include <QCryptographicHash>
@@ -29,8 +30,6 @@
using namespace Gravatar;
-static QNetworkConfigurationManager *s_networkConfigMgr = 0;
-
class Gravatar::GravatarResolvUrlJobPrivate
{
public:
@@ -66,9 +65,6 @@ GravatarResolvUrlJob::GravatarResolvUrlJob(QObject *parent)
: QObject(parent),
d(new Gravatar::GravatarResolvUrlJobPrivate)
{
- if (!s_networkConfigMgr) {
- s_networkConfigMgr = new QNetworkConfigurationManager(QCoreApplication::instance());
- }
}
GravatarResolvUrlJob::~GravatarResolvUrlJob()
@@ -78,7 +74,7 @@ GravatarResolvUrlJob::~GravatarResolvUrlJob()
bool GravatarResolvUrlJob::canStart() const
{
- if (s_networkConfigMgr->isOnline()) {
+ if (PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline()) {
return !d->mEmail.trimmed().isEmpty() && (d->mEmail.contains(QLatin1Char('@')));
} else {
return false;
@@ -97,7 +93,7 @@ bool GravatarResolvUrlJob::hasGravatar() const
void GravatarResolvUrlJob::startNetworkManager(const QUrl &url)
{
- if (s_networkConfigMgr->isOnline()) {
+ if (PimCommon::NetworkManager::self()->networkConfigureManager()->isOnline()) {
if (!d->mNetworkAccessManager) {
d->mNetworkAccessManager = new QNetworkAccessManager(this);
connect(d->mNetworkAccessManager, &QNetworkAccessManager::finished, this, &GravatarResolvUrlJob::slotFinishLoadPixmap);