Emit correct state

Dont log error if "stop" fails due to not connected
Issue #1037
This commit is contained in:
Craig Drummond
2017-08-16 16:55:03 +01:00
committed by Craig Drummond
parent 8a2d7288ce
commit 8ace3ccc8c

View File

@@ -603,7 +603,7 @@ void MPDConnection::setDetails(const MPDConnectionDetails &d)
emit stateChanged(true);
break;
default:
emit stateChanged(true);
emit stateChanged(false);
emit error(errorString(status), true);
}
} else if (diffName) {
@@ -634,7 +634,9 @@ MPDConnection::Response MPDConnection::sendCommand(const QByteArray &command, bo
DBUG << (void *)(&sock) << "sendCommand:" << log(command) << emitErrors << retry;
if (!isConnected()) {
emit error(tr("Failed to send command to %1 - not connected").arg(details.description()), true);
if ("stop"!=command) {
emit error(tr("Failed to send command to %1 - not connected").arg(details.description()), true);
}
return Response(false);
}