summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2017-09-29 11:14:40 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-09-29 12:43:45 -0700
commit73c242b6ebe786ee221ce0dfd878dba2a33cb2cd (patch)
tree96c23f5f0c8ae274f15b0e64fcee848341693fec /desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
parent8ce4692b5c8f1792bd4d3feae08698ab4583328b (diff)
downloadsubsurface-73c242b6ebe786ee221ce0dfd878dba2a33cb2cd.tar.gz
[Facebook] Use unblocking call for QNetworkRequest
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/plugins/facebook/facebookconnectwidget.cpp')
-rw-r--r--desktop-widgets/plugins/facebook/facebookconnectwidget.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
index e7b84d1cb..6ade8218f 100644
--- a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
+++ b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp
@@ -205,10 +205,12 @@ void FacebookManager::sendDive()
request.setRawHeader(QByteArray("Content-Length"), QString::number(data.length()).toLocal8Bit());
QNetworkReply *reply = am->post(request,data);
- QEventLoop loop;
- connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
- loop.exec();
+ connect(reply, &QNetworkReply::finished, this, &FacebookManager::uploadFinished);
+}
+void FacebookManager::uploadFinished()
+{
+ auto reply = qobject_cast<QNetworkReply*>(sender());
QByteArray response = reply->readAll();
QJsonDocument jsonDoc = QJsonDocument::fromJson(response);
QJsonObject obj = jsonDoc.object();