If we loose MPD connection, then show error widget.

This commit is contained in:
craig.p.drummond
2012-08-09 20:52:03 +00:00
parent 279eae51a0
commit dcf85a1cef
2 changed files with 4 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
7. Fix issue with certain styles not drawing selection background in icon view.
8. If we show an error, or info, message whilst using compact interface - then
adjust size to take message widget into account.
9. If we loose MPD connection, then show error widget.
0.8.2
-----

View File

@@ -426,6 +426,7 @@ MPDConnection::Response MPDConnection::sendCommand(const QByteArray &command, bo
// Failed to connect, so close *both* sockets!
disconnectFromMPD();
emit stateChanged(false);
emit error(i18n("Connection to %1 failed").arg(details.description()), true);
return Response(false);
}
}
@@ -918,6 +919,7 @@ void MPDConnection::onSocketStateChanged(QAbstractSocket::SocketState socketStat
// Failed to connect idle socket - so close *both*
disconnectFromMPD();
emit stateChanged(false);
emit error(i18n("Connection to %1 failed").arg(details.description()), true);
}
if (QAbstractSocket::ConnectedState==idleSocket.state()) {
connect(&idleSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(onSocketStateChanged(QAbstractSocket::SocketState)));
@@ -944,6 +946,7 @@ void MPDConnection::parseIdleReturn(const QByteArray &data)
// Failed to connect idle socket - so close *both*
disconnectFromMPD();
emit stateChanged(false);
emit error(i18n("Connection to %1 failed").arg(details.description()), true);
}
return;
}