From 8ace3ccc8cec02dc38adb31f7fdb7fd481e845f0 Mon Sep 17 00:00:00 2001 From: Craig Drummond Date: Wed, 16 Aug 2017 16:55:03 +0100 Subject: [PATCH] Emit correct state Dont log error if "stop" fails due to not connected Issue #1037 --- mpd-interface/mpdconnection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mpd-interface/mpdconnection.cpp b/mpd-interface/mpdconnection.cpp index 69a6866fb..4f7021cdc 100644 --- a/mpd-interface/mpdconnection.cpp +++ b/mpd-interface/mpdconnection.cpp @@ -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); }