--- a/kioworker/dnssd.cpp +++ b/kioworker/dnssd.cpp @@ -28,7 +28,7 @@ // Qt #include #include // S_IFDIR - +#include class KIOPluginForMetaData : public QObject { @@ -49,8 +49,26 @@ void ProtocolData::feedUrl( QUrl* url, c if (!pathEntry.isNull()) url->setPath( QString::fromUtf8(serviceTextData[pathEntry]) ); + bool autonfs = false; + if( protocol == QStringLiteral("nfs") ) + { + QString nfspath = QLatin1String("/mnt/net/") + remoteService->serviceName(); + QFileInfo nfsinfo( nfspath ); + if( nfsinfo.exists() ) + { + autonfs = true; + url->setScheme( QStringLiteral("") ); + url->setHost( QStringLiteral("") ); + url->setPort( -1 ); + url->setPath( nfspath ); + } + } + + if( !autonfs ) + { url->setHost( remoteService->hostName() ); url->setPort( remoteService->port() ); + } }