Commit d257cf10 authored by David Edmundson's avatar David Edmundson

Merge branch 'Applications/17.08'

parents 76375dcd 859ed4f1
...@@ -175,18 +175,22 @@ QUrl SMBSlave::checkURL(const QUrl& kurl) const ...@@ -175,18 +175,22 @@ QUrl SMBSlave::checkURL(const QUrl& kurl) const
{ {
qCDebug(KIO_SMB) << "checkURL " << kurl; qCDebug(KIO_SMB) << "checkURL " << kurl;
QString surl = kurl.url(); QString surl = kurl.url();
//transform any links in the form smb:/ into smb://
if (surl.startsWith(QLatin1String("smb:/"))) { if (surl.startsWith(QLatin1String("smb:/"))) {
if (surl.length() == 5) // just the above if (surl.length() == 5) {
return kurl; // unchanged return QUrl("smb://");
}
if (surl.at(5) != '/') { if (surl.at(5) != '/') {
surl = "smb://" + surl.mid(5); surl = "smb://" + surl.mid(5);
qCDebug(KIO_SMB) << "checkURL return1 " << surl << " " << QUrl(surl); qCDebug(KIO_SMB) << "checkURL return1 " << surl << " " << QUrl(surl);
return QUrl(surl); return QUrl(surl);
} }
} }
if (surl == QLatin1String("smb://")) {
return kurl; //unchanged
}
// smb:/ normaly have no userinfo // smb:// normally have no userinfo
// we must redirect ourself to remove the username and password // we must redirect ourself to remove the username and password
if (surl.contains('@') && !surl.contains("smb://")) { if (surl.contains('@') && !surl.contains("smb://")) {
QUrl url(kurl); QUrl url(kurl);
...@@ -202,7 +206,7 @@ QUrl SMBSlave::checkURL(const QUrl& kurl) const ...@@ -202,7 +206,7 @@ QUrl SMBSlave::checkURL(const QUrl& kurl) const
return url; return url;
} }
// no emtpy path //if there's a valid host, don't have an empty path
QUrl url(kurl); QUrl url(kurl);
if (url.path().isEmpty()) if (url.path().isEmpty())
...@@ -396,7 +400,7 @@ void SMBSlave::listDir( const QUrl& kurl ) ...@@ -396,7 +400,7 @@ void SMBSlave::listDir( const QUrl& kurl )
udsentry.insert(KIO::UDSEntry::UDS_ACCESS, (S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)); udsentry.insert(KIO::UDSEntry::UDS_ACCESS, (S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH));
// QString workgroup = m_current_url.host().toUpper(); // QString workgroup = m_current_url.host().toUpper();
QUrl u("smb:/"); QUrl u("smb://");
u.setHost(dirpName); u.setHost(dirpName);
// when libsmbclient knows // when libsmbclient knows
...@@ -423,7 +427,7 @@ void SMBSlave::listDir( const QUrl& kurl ) ...@@ -423,7 +427,7 @@ void SMBSlave::listDir( const QUrl& kurl )
udsentry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("application/x-smb-workgroup")); udsentry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("application/x-smb-workgroup"));
// QString workgroup = m_current_url.host().toUpper(); // QString workgroup = m_current_url.host().toUpper();
QUrl u("smb:/"); QUrl u("smb://");
u.setHost(dirpName); u.setHost(dirpName);
udsentry.insert(KIO::UDSEntry::UDS_URL, u.url()); udsentry.insert(KIO::UDSEntry::UDS_URL, u.url());
......
...@@ -121,7 +121,7 @@ SMBUrlType SMBUrl::getType() const ...@@ -121,7 +121,7 @@ SMBUrlType SMBUrl::getType() const
return m_type; return m_type;
} }
if (path(QUrl::FullyDecoded) == "/") if (path().isEmpty() || path(QUrl::FullyDecoded) == "/")
{ {
if (host().isEmpty()) if (host().isEmpty())
m_type = SMBURLTYPE_ENTIRE_NETWORK; m_type = SMBURLTYPE_ENTIRE_NETWORK;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment