diff --git a/smb/kio_smb.h b/smb/kio_smb.h --- a/smb/kio_smb.h +++ b/smb/kio_smb.h @@ -157,9 +157,10 @@ * pack it in UDSEntry. UDSEntry will not be cleared * Parameter : SMBUrl the url to stat * ignore_errors do not call error(), but warning() + * error_reported inform the caller that error() has been signalled to KIO * Return : false if any error occurred (errno), else true */ - bool browse_stat_path(const SMBUrl& url, UDSEntry& udsentry, bool ignore_errors); + bool browse_stat_path(const SMBUrl& url, UDSEntry& udsentry, bool ignore_errors, bool* error_reported = nullptr); /** * Description : call smbc_stat and return stats of the url diff --git a/smb/kio_smb_browse.cpp b/smb/kio_smb_browse.cpp --- a/smb/kio_smb_browse.cpp +++ b/smb/kio_smb_browse.cpp @@ -55,7 +55,7 @@ } //--------------------------------------------------------------------------- -bool SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry, bool ignore_errors) +bool SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry, bool ignore_errors, bool* error_reported) // Returns: true on success, false on failure { SMBUrl url = _url; @@ -102,10 +102,14 @@ if (cacheStatErr == EPERM || cacheStatErr == EACCES) if (checkPassword(url)) { redirection( url ); + if (error_reported) + *error_reported = false; return false; } reportError(url, cacheStatErr); + if (error_reported) + *error_reported = true; } else if (cacheStatErr == ENOENT || cacheStatErr == ENOTDIR) { warning(i18n("File does not exist: %1", url.url())); } @@ -122,6 +126,7 @@ qCDebug(KIO_SMB) << kurl; // make a valid URL QUrl url = checkURL(kurl); + bool error_reported; // if URL is not valid we have to redirect to correct URL if (url != kurl) @@ -150,11 +155,12 @@ break; case SMBURLTYPE_SHARE_OR_PATH: - if (browse_stat_path(m_current_url, udsentry, false)) + if (browse_stat_path(m_current_url, udsentry, false, &error_reported)) break; else { qCDebug(KIO_SMB) << "ERROR!!"; - finished(); + if (!error_reported) + finished(); return; } default: