If we loose MPD connection, then show error widget.
This commit is contained in:
@@ -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
|
||||
-----
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user