Use QUrl with server details to build HTTP address used to compare MPD http file paths against.
This commit is contained in:
committed by
craig.p.drummond
parent
1681e5db32
commit
16777a3954
@@ -258,8 +258,9 @@ HttpSocket::HttpSocket(const QString &iface, quint16 port)
|
||||
if (isListening() && ifaceAddress.isEmpty()) {
|
||||
ifaceAddress=QLatin1String("127.0.0.1");
|
||||
}
|
||||
setUrlAddress();
|
||||
|
||||
DBUG << isListening() << ifaceAddress << serverPort();
|
||||
DBUG << isListening() << urlAddr;
|
||||
|
||||
connect(MPDConnection::self(), SIGNAL(socketAddress(QString)), this, SLOT(mpdAddress(QString)));
|
||||
connect(MPDConnection::self(), SIGNAL(cantataStreams(QList<Song>,bool)), this, SLOT(cantataStreams(QList<Song>,bool)));
|
||||
@@ -565,3 +566,16 @@ bool HttpSocket::write(QTcpSocket *socket, char *buffer, qint32 bytesRead, bool
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void HttpSocket::setUrlAddress()
|
||||
{
|
||||
if (ifaceAddress.isEmpty()) {
|
||||
ifaceAddress=QString();
|
||||
} else {
|
||||
QUrl url;
|
||||
url.setScheme("http");
|
||||
url.setHost(ifaceAddress);
|
||||
url.setPort(serverPort());
|
||||
urlAddr=url.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user