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 30801f95 authored by Laurent Montel's avatar Laurent Montel 😁

Return pixmap

parent 4e592bd9
......@@ -69,7 +69,7 @@ void GravatarResolvUrlJob::start()
QNetworkReply *reply = mNetworkAccessManager->get(QNetworkRequest(url));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(slotError(QNetworkReply::NetworkError)));
} else {
//TODO return message Error.
qDebug() << "Gravatar can not start";
deleteLater();
}
}
......@@ -119,7 +119,6 @@ void GravatarResolvUrlJob::setUseDefaultPixmap(bool useDefaultPixmap)
mUseDefaultPixmap = useDefaultPixmap;
}
int GravatarResolvUrlJob::size() const
{
return mSize;
......@@ -145,7 +144,6 @@ QString GravatarResolvUrlJob::calculatedHash() const
return mCalculatedHash;
}
KUrl GravatarResolvUrlJob::createUrl()
{
mCalculatedHash.clear();
......
......@@ -56,14 +56,21 @@ GravatarDownloadPixmapWidget::~GravatarDownloadPixmapWidget()
}
QPixmap GravatarDownloadPixmapWidget::gravatarPixmap() const
{
return mGravatarPixmap;
}
void GravatarDownloadPixmapWidget::slotResolvUrlFinish(PimCommon::GravatarResolvUrlJob *job)
{
if (job) {
qDebug() << job->hasGravatar();
if (job->hasGravatar()) {
mResultLabel->setPixmap(job->pixmap());
mGravatarPixmap = job->pixmap();
mResultLabel->setPixmap(mGravatarPixmap);
} else {
//KF5 add i18n
mGravatarPixmap = QPixmap();
mResultLabel->setText(QLatin1String("No gravatar found."));
}
}
......
......@@ -32,12 +32,15 @@ public:
explicit GravatarDownloadPixmapWidget(QWidget *parent = 0);
~GravatarDownloadPixmapWidget();
QPixmap gravatarPixmap() const;
private Q_SLOTS:
void slotSearchButton();
void slotTextChanged(const QString &text);
void slotResolvUrlFinish(PimCommon::GravatarResolvUrlJob *job);
private:
QPixmap mGravatarPixmap;
QLabel *mResultLabel;
QLineEdit *mLineEdit;
QPushButton *mGetPixmapButton;
......
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