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

port mtp to workerbase

parent befb9170
Pipeline #213887 passed with stage
in 3 minutes and 22 seconds
......@@ -18,8 +18,8 @@ target_link_libraries(kio_mtp kmtp Qt::Core KF5::KIOCore KF5::I18n KF5::DBusAddo
ecm_qt_declare_logging_category(kio_mtp
HEADER kio_mtp_debug.h
IDENTIFIER LOG_KIO_MTP
CATEGORY_NAME kf.kio.slaves.mtp
OLD_CATEGORY_NAMES kde.kio-mtp
CATEGORY_NAME kf.kio.workers.mtp
OLD_CATEGORY_NAMES kde.kio-mtp kf.kio.slaves.mtp
DESCRIPTION "KIO mtp"
EXPORT KIO_EXTRAS
)
......
kio-mtp: KIO slave to access MTP devices
kio-mtp: KIO worker to access MTP devices
========================================
This KIO slave enables KDE applications to access
This KIO worker enables KDE applications to access
files stored on devices that provide access to them
via the MTP protocol.
......
This diff is collapsed.
......@@ -7,11 +7,10 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KIO_MTP_H
#define KIO_MTP_H
#pragma once
#include <KIO/Global>
#include <KIO/SlaveBase>
#include <KIO/WorkerBase>
#include <KLocalizedString>
#include <stdlib.h>
......@@ -34,7 +33,7 @@ class KMTPFile;
using namespace KIO;
class MTPSlave : public QObject, public KIO::SlaveBase
class MTPWorker : public QObject, public KIO::WorkerBase
{
Q_OBJECT
......@@ -49,36 +48,28 @@ public:
/*
* Overwritten KIO-functions, see "kio_mtp.cpp"
*/
MTPSlave(const QByteArray &pool, const QByteArray &app);
~MTPSlave() override;
void listDir(const QUrl &url) override;
void stat(const QUrl &url) override;
void mimetype(const QUrl &url) override;
void get(const QUrl &url) override;
void put(const QUrl &url, int, JobFlags flags) override;
void copy(const QUrl &src, const QUrl &dest, int, JobFlags flags) override;
void mkdir(const QUrl &url, int) override;
void del(const QUrl &url, bool) override;
void rename(const QUrl &src, const QUrl &dest, JobFlags flags) override;
// private Q_SLOTS:
//
// void test();
protected:
void virtual_hook(int id, void *data) override;
MTPWorker(const QByteArray &pool, const QByteArray &app);
~MTPWorker() override;
WorkerResult listDir(const QUrl &url) override;
WorkerResult stat(const QUrl &url) override;
WorkerResult mimetype(const QUrl &url) override;
WorkerResult get(const QUrl &url) override;
WorkerResult put(const QUrl &url, int, JobFlags flags) override;
WorkerResult copy(const QUrl &src, const QUrl &dest, int, JobFlags flags) override;
WorkerResult mkdir(const QUrl &url, int) override;
WorkerResult del(const QUrl &url, bool) override;
WorkerResult rename(const QUrl &src, const QUrl &dest, JobFlags flags) override;
WorkerResult fileSystemFreeSpace(const QUrl &url) override;
private:
/**
* Check if it is a valid url or an udi.
*
* @param url The url to checkUrl
* @return enum MTPSlave::Url
* @return enum MTPWorker::Url
*/
enum MTPSlave::Url checkUrl(const QUrl &url);
void fileSystemFreeSpace(const QUrl &url);
enum MTPWorker::Url checkUrl(const QUrl &url);
/**
* @brief Waits for a pending copy operation to finish while updating its progress.
......@@ -89,5 +80,3 @@ private:
KMTPDInterface m_kmtpDaemon;
};
#endif // KIO_MTP_H
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