From c1264fd30fc355df1b8da89b0e7cafe1e2cea8ef Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 29 May 2024 03:39:04 +0300 Subject: [PATCH] kioslave: match the service name to the URL filename in NetworkSlave::stat() fixes MIME type determination of service entries Signed-off-by: Ivailo Monev --- kioslave/network/ioslave/networkslave.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kioslave/network/ioslave/networkslave.cpp b/kioslave/network/ioslave/networkslave.cpp index ce3da333..454387f4 100644 --- a/kioslave/network/ioslave/networkslave.cpp +++ b/kioslave/network/ioslave/networkslave.cpp @@ -116,9 +116,9 @@ void NetworkSlave::stat(const KUrl &url) error(KIO::ERR_SLAVE_DEFINED, m_kdnssd->errorString()); return; } + const QString urlfilename = url.fileName(); foreach (const KDNSSDService &kdnssdservice, m_kdnssd->services()) { - // qDebug() << Q_FUNC_INFO << kdnssdservice.url << url.prettyUrl(); - if (kdnssdservice.url == url.prettyUrl()) { + if (kdnssdservice.name == urlfilename) { const QString servicemimetype = mimeForService(kdnssdservice); KIO::UDSEntry kioudsentry; kioudsentry.insert(KIO::UDSEntry::UDS_NAME, kdnssdservice.name);