kioslave: match the service name to the URL filename in NetworkSlave::stat()

fixes MIME type determination of service entries

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-29 03:39:04 +03:00
parent e1729bdbb5
commit c1264fd30f

View file

@ -116,9 +116,9 @@ void NetworkSlave::stat(const KUrl &url)
error(KIO::ERR_SLAVE_DEFINED, m_kdnssd->errorString()); error(KIO::ERR_SLAVE_DEFINED, m_kdnssd->errorString());
return; return;
} }
const QString urlfilename = url.fileName();
foreach (const KDNSSDService &kdnssdservice, m_kdnssd->services()) { foreach (const KDNSSDService &kdnssdservice, m_kdnssd->services()) {
// qDebug() << Q_FUNC_INFO << kdnssdservice.url << url.prettyUrl(); if (kdnssdservice.name == urlfilename) {
if (kdnssdservice.url == url.prettyUrl()) {
const QString servicemimetype = mimeForService(kdnssdservice); const QString servicemimetype = mimeForService(kdnssdservice);
KIO::UDSEntry kioudsentry; KIO::UDSEntry kioudsentry;
kioudsentry.insert(KIO::UDSEntry::UDS_NAME, kdnssdservice.name); kioudsentry.insert(KIO::UDSEntry::UDS_NAME, kdnssdservice.name);