diff options
Diffstat (limited to 'desktop-widgets/plugins/facebook/facebookconnectwidget.cpp')
-rw-r--r-- | desktop-widgets/plugins/facebook/facebookconnectwidget.cpp | 8 |
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(); |