Fix error message reporting

This commit is contained in:
craig.p.drummond
2014-01-03 19:00:33 +00:00
committed by craig.p.drummond
parent acb4a532e3
commit 261ebc9b03

View File

@@ -517,9 +517,9 @@ MPDConnection::Response MPDConnection::sendCommand(const QByteArray &command, bo
}
if (emitErrors) {
if ((command.startsWith("add ") || command.startsWith("command_list_begin\nadd ")) && -1!=command.indexOf("\"file:///")) {
if (details.isLocal() && response.data=="Permission denied") {
if (details.isLocal() && -1!=response.data.indexOf("Permission denied")) {
emit error(i18n("Failed to load. Please check user \"mpd\" has read permission."));
} else if (!details.isLocal() && response.data=="Access denied") {
} else if (!details.isLocal() && -1!=response.data.indexOf("Access denied")) {
emit error(i18n("Failed to load. MPD can only play local files if connected via a local socket."));
} else if (!response.getError(command).isEmpty()) {
emit error(i18n("MPD reported the following error: %1", response.getError(command)));