diff --git a/kioslave/network/ioslave/CMakeLists.txt b/kioslave/network/ioslave/CMakeLists.txt index 76b9430d..1c898433 100644 --- a/kioslave/network/ioslave/CMakeLists.txt +++ b/kioslave/network/ioslave/CMakeLists.txt @@ -1,8 +1,7 @@ project(kio_network) set(kio_network_SRCS - networkslave.cpp - main.cpp + networkslave.cpp ) add_executable(kio_network ${kio_network_SRCS}) diff --git a/kioslave/network/ioslave/main.cpp b/kioslave/network/ioslave/main.cpp deleted file mode 100644 index 0273b338..00000000 --- a/kioslave/network/ioslave/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - This file is part of the network kioslave, part of the KDE project. - - Copyright 2009 Friedrich W. H. Kossebau - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -*/ - -#include "networkslave.h" - - - - diff --git a/kioslave/network/ioslave/networkslave.cpp b/kioslave/network/ioslave/networkslave.cpp index bd9730b0..6f802d89 100644 --- a/kioslave/network/ioslave/networkslave.cpp +++ b/kioslave/network/ioslave/networkslave.cpp @@ -141,6 +141,12 @@ void NetworkSlave::listDir(const KUrl &url) error(KIO::ERR_UNSUPPORTED_ACTION, url.prettyUrl()); return; } + // this slave has only one directory - the root directory + const QString urlpath = url.path(); + if (!urlpath.isEmpty() && urlpath != QLatin1String("/")) { + error(KIO::ERR_DOES_NOT_EXIST, url.prettyUrl()); + return; + } if (!m_kdnssd) { m_kdnssd = new KDNSSD(); } diff --git a/kioslave/remote/kio_remote.cpp b/kioslave/remote/kio_remote.cpp index af1f9930..d2aa944c 100644 --- a/kioslave/remote/kio_remote.cpp +++ b/kioslave/remote/kio_remote.cpp @@ -84,7 +84,7 @@ void RemoteProtocol::listDir(const KUrl &url) return; } - error(KIO::ERR_MALFORMED_URL, url.prettyUrl()); + error(KIO::ERR_DOES_NOT_EXIST, url.prettyUrl()); } void RemoteProtocol::listRoot() @@ -175,7 +175,7 @@ void RemoteProtocol::stat(const KUrl &url) } } - error(KIO::ERR_MALFORMED_URL, url.prettyUrl()); + error(KIO::ERR_DOES_NOT_EXIST, url.prettyUrl()); } void RemoteProtocol::del(const KUrl &url, bool /*isFile*/) @@ -209,7 +209,7 @@ void RemoteProtocol::get(const KUrl &url) return; } - error(KIO::ERR_MALFORMED_URL, url.prettyUrl()); + error(KIO::ERR_DOES_NOT_EXIST, url.prettyUrl()); } void RemoteProtocol::rename(const KUrl &src, const KUrl &dest, diff --git a/kioslave/trash/kio_trash.cpp b/kioslave/trash/kio_trash.cpp index 943ccb57..75f2db83 100644 --- a/kioslave/trash/kio_trash.cpp +++ b/kioslave/trash/kio_trash.cpp @@ -256,12 +256,10 @@ void TrashProtocol::stat(const KUrl& url) bool ok = TrashImpl::parseURL( url, trashId, fileId, relativePath ); if ( !ok ) { - // ######## do we still need this? kDebug() << url << " looks fishy, returning does-not-exist"; // A URL like trash:/file simply means that CopyJob is trying to see if // the destination exists already (it made up the URL by itself). error( KIO::ERR_DOES_NOT_EXIST, url.prettyUrl() ); - //error( KIO::ERR_SLAVE_DEFINED, i18n( "Malformed URL %1" ).arg( url.prettyUrl() ) ); return; }