Commit bfb13d4b authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

some more transitioning to worker naming in sftp

parent bdfe821b
Pipeline #196930 passed with stage
in 5 minutes and 10 seconds
......@@ -13,8 +13,8 @@ target_sources(kio_sftp PRIVATE kio_sftp.cpp)
ecm_qt_declare_logging_category(kio_sftp
HEADER kio_sftp_debug.h
IDENTIFIER KIO_SFTP_LOG
CATEGORY_NAME kf.kio.slaves.sftp
OLD_CATEGORY_NAMES log_kio_sftp
CATEGORY_NAME kf.kio.workers.sftp
OLD_CATEGORY_NAMES log_kio_sftp kf.kio.slaves.sftp
DESCRIPTION "KIO sftp"
EXPORT KIO_EXTRAS
)
......@@ -22,8 +22,8 @@ ecm_qt_declare_logging_category(kio_sftp
ecm_qt_declare_logging_category(kio_sftp
HEADER kio_sftp_trace_debug.h
IDENTIFIER KIO_SFTP_TRACE_LOG
CATEGORY_NAME kf.kio.slaves.sftp.trace
OLD_CATEGORY_NAMES log_kio_sftp.trace
CATEGORY_NAME kf.kio.workers.sftp.trace
OLD_CATEGORY_NAMES log_kio_sftp.trace kf.kio.slaves.sftp.trace
DESCRIPTION "KIO sftp (trace)"
EXPORT KIO_EXTRAS
)
......
/*
* SPDX-FileCopyrightText: 2001 Lucas Fisher <ljfisher@purdue.edu>
* SPDX-FileCopyrightText: 2009 Andreas Schneider <mail@cynapses.org>
* SPDX-FileCopyrightText: 2020-2021 Harald Sitter <sitter@kde.org>
* SPDX-FileCopyrightText: 2020-2022 Harald Sitter <sitter@kde.org>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -70,7 +70,7 @@ using namespace std::filesystem;
class KIOPluginForMetaData : public QObject
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.kde.kio.slave.sftp" FILE "sftp.json")
Q_PLUGIN_METADATA(IID "org.kde.kio.worker.sftp" FILE "sftp.json")
};
using namespace KIO;
......@@ -1056,7 +1056,7 @@ Result SFTPWorker::open(const QUrl &url, QIODevice::OpenMode mode) {
}
// Determine the mimetype of the file to be retrieved, and emit it.
// This is mandatory in all slaves (for KRun/BrowserRun to work).
// This is mandatory in all workers (for KRun/BrowserRun to work).
// If we're not opening the file ReadOnly or ReadWrite, don't attempt to
// read the file and send the mimetype.
if (mode & QIODevice::ReadOnly) {
......
/*
* SPDX-FileCopyrightText: 2001 Lucas Fisher <ljfisher@purdue.edu>
* SPDX-FileCopyrightText: 2009 Andreas Schneider <mail@cynapses.org>
* SPDX-FileCopyrightText: 2020-2021 Harald Sitter <sitter@kde.org>
* SPDX-FileCopyrightText: 2020-2022 Harald Sitter <sitter@kde.org>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -34,8 +34,6 @@ struct ScopedPointerCustomDeleter
};
typedef QScopedPointer<sftp_attributes_struct, ScopedPointerCustomDeleter> SFTPAttributesPtr;
class SFTPSlave;
class SFTPWorker : public KIO::WorkerBase
{
public:
......@@ -83,7 +81,7 @@ public:
Q_REQUIRED_RESULT Result fileSystemFreeSpace(const QUrl &url) override; // KF6 TODO: Once a virtual fileSystemFreeSpace method in SlaveBase exists, override it
private: // Private variables
/** True if ioslave is connected to sftp server. */
/** True if worker is connected to sftp server. */
bool mConnected = false;
/** Host we are connected to. */
......@@ -203,39 +201,4 @@ private: // private methods
Q_REQUIRED_RESULT Result openConnectionWithoutCloseOnError();
};
class SFTPSlave : public KIO::SlaveBase
{
public:
SFTPSlave(const QByteArray &pool_socket, const QByteArray &app_socket);
~SFTPSlave() override = default;
void setHost(const QString &host, quint16 port, const QString &user, const QString &pass) override;
void get(const QUrl &url) override;
void listDir(const QUrl &url) override ;
void mimetype(const QUrl &url) override;
void stat(const QUrl &url) override;
void copy(const QUrl &src, const QUrl &dest, int permissions, KIO::JobFlags flags) override;
void put(const QUrl &url, int permissions, KIO::JobFlags flags) override;
void slave_status() override;
void del(const QUrl &url, bool isfile) override;
void chmod(const QUrl &url, int permissions) override;
void symlink(const QString &target, const QUrl &dest, KIO::JobFlags flags) override;
void rename(const QUrl &src, const QUrl &dest, KIO::JobFlags flags) override;
void mkdir(const QUrl &url, int permissions) override;
void openConnection() override;
void closeConnection() override;
// KIO::FileJob interface
void open(const QUrl &url, QIODevice::OpenMode mode) override;
void read(KIO::filesize_t size) override;
void write(const QByteArray &data) override;
void seek(KIO::filesize_t offset) override;
void truncate(KIO::filesize_t length);
void close() override;
void special(const QByteArray &data) override;
void virtual_hook(int id, void *data) override;
};
#endif
Supports Markdown
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