summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-04-19 12:28:23 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-04-19 12:28:23 +0200
commit3d7522b83f2c3f87116244bd064a751306a5411d (patch)
tree037b7299e350d91dd5ba5e1db4a619c39581f41c
parent8f08814b58f820a38c1de0c530cab55ea47ad960 (diff)
downloadsink-3d7522b83f2c3f87116244bd064a751306a5411d.tar.gz
sink-3d7522b83f2c3f87116244bd064a751306a5411d.zip
Avoid error message when initially starting resource.
-rw-r--r--common/resourceaccess.cpp14
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
256void ResourceAccess::connectionError(QLocalSocket::LocalSocketError error) 256void 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
284void ResourceAccess::startResourceAndConnect() 286void ResourceAccess::startResourceAndConnect()