summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/plugins')
-rw-r--r--desktop-widgets/plugins/facebook/facebookconnectwidget.cpp8
-rw-r--r--desktop-widgets/plugins/facebook/facebookconnectwidget.h4
2 files changed, 8 insertions, 4 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();
diff --git a/desktop-widgets/plugins/facebook/facebookconnectwidget.h b/desktop-widgets/plugins/facebook/facebookconnectwidget.h
index d7714945e..1c6e40e07 100644
--- a/desktop-widgets/plugins/facebook/facebookconnectwidget.h
+++ b/desktop-widgets/plugins/facebook/facebookconnectwidget.h
@@ -8,6 +8,8 @@ class QWebEngineView;
#else
class QWebView;
#endif
+class QNetworkReply;
+
namespace Ui {
class FacebookConnectWidget;
class SocialnetworksDialog;
@@ -31,7 +33,7 @@ public slots:
void logout();
void setDesiredAlbumName(const QString& albumName);
void sendDive();
-
+ void uploadFinished();
private:
explicit FacebookManager(QObject *parent = 0);
QString albumName;