From 889eab6f38e74ba9cc72ba97f28d01c886aec6ec Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Wed, 8 Jul 2015 12:10:53 +0200 Subject: [PATCH] try to recconect pushover frontend --- src/plugins/frontends/pushover/pushover_frontend.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/frontends/pushover/pushover_frontend.cpp b/src/plugins/frontends/pushover/pushover_frontend.cpp index 4cc77e5..daffd9d 100644 --- a/src/plugins/frontends/pushover/pushover_frontend.cpp +++ b/src/plugins/frontends/pushover/pushover_frontend.cpp @@ -144,6 +144,7 @@ void PushoverFrontend::connectToService() snoreDebug(SNORE_WARNING) << "not logged in"; return; } + snoreDebug(SNORE_DEBUG) << "Connecting ton service"; m_socket = new QWebSocket(QString(), QWebSocketProtocol::VersionLatest, this); connect(m_socket, &QWebSocket::binaryMessageReceived, [&](const QByteArray & msg) { @@ -172,8 +173,9 @@ void PushoverFrontend::connectToService() snoreDebug(SNORE_WARNING) << "unknown message recieved" << msg; } }); - connect(m_socket, &QWebSocket::disconnected, []() { - snoreDebug(SNORE_DEBUG) << "disconnected"; + connect(m_socket, &QWebSocket::disconnected, [this]() { + snoreDebug(SNORE_WARNING) << "disconnected"; + QTimer::singleShot(500, this, &PushoverFrontend::connectToService); }); connect(m_socket, static_cast(&QWebSocket::error), [&](QAbstractSocket::SocketError error) { snoreDebug(SNORE_WARNING) << error << m_socket->errorString();