Commit 7d6a1576 authored by Michal Malý's avatar Michal Malý Committed by Elvis Angelaccio

Add reportWarning() method

Summary: Restore the warning dialog when a non-existent file is encountered in the listDir loop.

Reviewers: elvisangelaccio

Reviewed By: elvisangelaccio

Differential Revision: https://phabricator.kde.org/D6662
parent 498104db
......@@ -212,6 +212,7 @@ protected:
QUrl checkURL(const QUrl& kurl) const;
void reportError(const SMBUrl &kurl, const int &errNum);
void reportWarning(const SMBUrl& url, const int errNum);
public:
......
......@@ -297,6 +297,11 @@ void SMBSlave::reportError(const SMBUrl &url, const int &errNum)
}
}
void SMBSlave::reportWarning(const SMBUrl& url, const int errNum)
{
warning(i18n("Error %1 while browsing: %2", errNum, url.url()));
}
//===========================================================================
void SMBSlave::listDir( const QUrl& kurl )
{
......@@ -376,7 +381,11 @@ void SMBSlave::listDir( const QUrl& kurl )
{
// Set stat information
m_current_url.addPath(dirpName);
browse_stat_path(m_current_url, udsentry);
const int statErr = browse_stat_path(m_current_url, udsentry);
if (statErr == ENOENT || statErr == ENOTDIR)
{
reportWarning(m_current_url, statErr);
}
m_current_url.cd("..");
// Call base class to list entry
......@@ -447,7 +456,11 @@ void SMBSlave::listDir( const QUrl& kurl )
else
{
udsentry.insert(KIO::UDSEntry::UDS_NAME, ".");
browse_stat_path(m_current_url, udsentry);
const int statErr = browse_stat_path(m_current_url, udsentry);
if (statErr == ENOENT || statErr == ENOTDIR)
{
reportWarning(m_current_url, statErr);
}
}
listEntry(udsentry);
udsentry.clear();
......
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