diff options
-rw-r--r-- | common/resourceaccess.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 1dba571..52cd61a 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -255,6 +255,14 @@ void ResourceAccess::disconnected() | |||
255 | 255 | ||
256 | void ResourceAccess::connectionError(QLocalSocket::LocalSocketError error) | 256 | void ResourceAccess::connectionError(QLocalSocket::LocalSocketError error) |
257 | { | 257 | { |
258 | //We tried to connect to the server, but the socket is not yet available. | ||
259 | //We're trying to connect but failed, start the resource and retry. | ||
260 | //Don't automatically restart on later disconnects. | ||
261 | if (d->openingConnection && error == QLocalSocket::LocalSocketError::ServerNotFoundError) { | ||
262 | startResourceAndConnect(); | ||
263 | return; | ||
264 | } | ||
265 | //Retry to connect to the server while starting the process | ||
258 | if (d->startingProcess) { | 266 | if (d->startingProcess) { |
259 | if (!d->tryOpenTimer->isActive()) { | 267 | if (!d->tryOpenTimer->isActive()) { |
260 | d->tryOpenTimer->start(); | 268 | d->tryOpenTimer->start(); |
@@ -273,12 +281,6 @@ void ResourceAccess::connectionError(QLocalSocket::LocalSocketError error) | |||
273 | handler(1, "The resource closed unexpectedly"); | 281 | handler(1, "The resource closed unexpectedly"); |
274 | } | 282 | } |
275 | d->resultHandler.clear(); | 283 | d->resultHandler.clear(); |
276 | |||
277 | //We're trying to connect but failed, start the resource and retry. | ||
278 | //Don't automatically restart on later disconnects. | ||
279 | if (d->openingConnection) { | ||
280 | startResourceAndConnect(); | ||
281 | } | ||
282 | } | 284 | } |
283 | 285 | ||
284 | void ResourceAccess::startResourceAndConnect() | 286 | void ResourceAccess::startResourceAndConnect() |