Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit aecc18b9 authored by Laurent Montel's avatar Laurent Montel 😁

Don't try to resolv url when network is not connected

parent 5543d57c
......@@ -23,6 +23,7 @@
#include <QStringList>
#include <QDebug>
#include <QPixmap>
#include <solid/networking.h>
using namespace PimCommon;
......@@ -43,6 +44,9 @@ GravatarResolvUrlJob::~GravatarResolvUrlJob()
bool GravatarResolvUrlJob::canStart() const
{
if ( Solid::Networking::status() == Solid::Networking::Unconnected ) {
return false;
}
return !mEmail.trimmed().isEmpty() && (mEmail.contains(QLatin1Char('@')));
}
......@@ -62,6 +66,11 @@ void GravatarResolvUrlJob::start()
mCalculatedHash.clear();
const KUrl url = createUrl();
Q_EMIT resolvUrl(url);
if ( Solid::Networking::status() == Solid::Networking::Unconnected ) {
qDebug() <<" network is not connected";
deleteLater();
return;
}
if (!mNetworkAccessManager) {
mNetworkAccessManager = new QNetworkAccessManager(this);
connect(mNetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(slotFinishLoadPixmap(QNetworkReply*)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment