Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KIO Extras
Commits
557c3718
Commit
557c3718
authored
Aug 06, 2022
by
Harald Sitter
🏳️🌈
Browse files
port mtp to workerbase
parent
befb9170
Pipeline
#213887
passed with stage
in 3 minutes and 22 seconds
Changes
4
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
mtp/CMakeLists.txt
View file @
557c3718
...
...
@@ -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.
slave
s.mtp
OLD_CATEGORY_NAMES kde.kio-mtp
CATEGORY_NAME kf.kio.
worker
s.mtp
OLD_CATEGORY_NAMES kde.kio-mtp
kf.kio.slaves.mtp
DESCRIPTION
"KIO mtp"
EXPORT KIO_EXTRAS
)
...
...
mtp/README
View file @
557c3718
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.
...
...
mtp/kio_mtp.cpp
View file @
557c3718
This diff is collapsed.
Click to expand it.
mtp/kio_mtp.h
View file @
557c3718
...
...
@@ -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/
Slave
Base>
#include
<KIO/
Worker
Base>
#include
<KLocalizedString>
#include
<stdlib.h>
...
...
@@ -34,7 +33,7 @@ class KMTPFile;
using
namespace
KIO
;
class
MTP
Slave
:
public
QObject
,
public
KIO
::
Slave
Base
class
MTP
Worker
:
public
QObject
,
public
KIO
::
Worker
Base
{
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 MTP
Slave
::Url
* @return enum MTP
Worker
::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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment