Skip to content
GitLab
Menu
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
7a08867d
Verified
Commit
7a08867d
authored
May 28, 2021
by
Alexander Lohnau
💬
Browse files
Embed JSON metadata in KIOSlaves
Task:
https://phabricator.kde.org/T14518
parent
2846838f
Changes
16
Hide whitespace changes
Inline
Side-by-side
about/kio_about.cpp
View file @
7a08867d
...
...
@@ -12,6 +12,13 @@
using
namespace
KIO
;
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.about"
FILE
"about.json"
)
};
AboutProtocol
::
AboutProtocol
(
const
QByteArray
&
pool_socket
,
const
QByteArray
&
app_socket
)
:
SlaveBase
(
"about"
,
pool_socket
,
app_socket
)
{
...
...
@@ -60,3 +67,4 @@ extern "C" Q_DECL_EXPORT int kdemain( int argc, char **argv )
return
0
;
}
#include "kio_about.moc"
activities/KioActivities.cpp
View file @
7a08867d
...
...
@@ -32,6 +32,13 @@
#include <QProcess>
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.activities"
FILE
"activities.json"
)
};
class
ActivitiesProtocol
::
Private
{
public:
Private
()
...
...
@@ -348,4 +355,4 @@ void ActivitiesProtocol::del(const QUrl& url, bool isfile)
Q_UNUSED
(
isfile
);
}
#include "KioActivities.moc"
bookmarks/kio_bookmarks.cpp
View file @
7a08867d
...
...
@@ -31,6 +31,13 @@
using
namespace
KIO
;
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.bookmarks"
FILE
"bookmarks.json"
)
};
BookmarksProtocol
::
BookmarksProtocol
(
const
QByteArray
&
pool
,
const
QByteArray
&
app
)
:
SlaveBase
(
"bookmarks"
,
pool
,
app
)
{
...
...
@@ -215,3 +222,5 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char **argv)
return
0
;
}
#include "kio_bookmarks.moc"
filenamesearch/kio_filenamesearch.cpp
View file @
7a08867d
...
...
@@ -19,6 +19,13 @@
#include <QDBusInterface>
#include <KLocalizedString>
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.filenamesearch"
FILE
"filenamesearch.json"
)
};
FileNameSearchProtocol
::
FileNameSearchProtocol
(
const
QByteArray
&
pool
,
const
QByteArray
&
app
)
:
SlaveBase
(
"search"
,
pool
,
app
)
{
...
...
@@ -189,3 +196,5 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char **argv)
return
0
;
}
#include "kio_filenamesearch.moc"
filter/filter.cc
View file @
7a08867d
...
...
@@ -23,6 +23,13 @@ SPDX-License-Identifier: MIT
#include "loggingcategory.h"
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.filter"
FILE
"filter.json"
)
};
extern
"C"
{
Q_DECL_EXPORT
int
kdemain
(
int
argc
,
char
**
argv
);
}
...
...
@@ -164,3 +171,5 @@ void FilterProtocol::get(const QUrl& url)
}
subURL
=
QUrl
();
// Clear subURL
}
#include "filter.moc"
fish/fish.cpp
View file @
7a08867d
...
...
@@ -102,6 +102,13 @@ static KProcess *childPid = 0;
#define E(x) ((const char*)remoteEncoding()->encode(x).data())
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.fish"
FILE
"fish.json"
)
};
using
namespace
KIO
;
extern
"C"
{
...
...
@@ -1703,3 +1710,5 @@ void fishProtocol::slave_status() {
else
slaveStatus
(
QString
(),
false
);
}
#include "fish.moc"
info/info.cc
View file @
7a08867d
...
...
@@ -24,6 +24,12 @@
using
namespace
KIO
;
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.info"
FILE
"info.json"
)
};
InfoProtocol
::
InfoProtocol
(
const
QByteArray
&
pool
,
const
QByteArray
&
app
)
:
SlaveBase
(
"info"
,
pool
,
app
)
...
...
@@ -258,3 +264,5 @@ int kdemain( int argc, char **argv )
return
0
;
}
#include "info.moc"
man/kio_man.cpp
View file @
7a08867d
...
...
@@ -33,6 +33,13 @@
using
namespace
KIO
;
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.man"
FILE
"man.json"
)
};
MANProtocol
*
MANProtocol
::
_self
=
nullptr
;
#define SGML2ROFF_DIRS "/usr/lib/sgml"
...
...
@@ -1404,3 +1411,5 @@ void MANProtocol::getProgramPath()
error
(
KIO
::
ERR_SLAVE_DEFINED
,
QString
());
exit
();
}
#include "kio_man.moc"
mtp/kio_mtp.cpp
View file @
7a08867d
...
...
@@ -23,6 +23,13 @@
#include "kmtpdeviceinterface.h"
#include "kmtpstorageinterface.h"
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.mtp"
FILE
"mtp.json"
)
};
static
UDSEntry
getEntry
(
const
KMTPDeviceInterface
*
device
)
{
UDSEntry
entry
;
...
...
@@ -864,4 +871,4 @@ int MTPSlave::waitForCopyOperation(const KMTPStorageInterface *storage)
return
loop
.
exec
();
}
#include "kio_mtp.moc"
network/ioslave/main.cpp
View file @
7a08867d
...
...
@@ -11,6 +11,12 @@
// Qt
#include <QCoreApplication>
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.network"
FILE
"network.json"
)
};
extern
"C"
{
...
...
@@ -27,3 +33,5 @@ extern "C"
}
}
#include "main.moc"
nfs/kio_nfs.cpp
View file @
7a08867d
...
...
@@ -35,6 +35,13 @@
using
namespace
KIO
;
using
namespace
std
;
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.nfs"
FILE
"nfs.json"
)
};
extern
"C"
int
Q_DECL_EXPORT
kdemain
(
int
argc
,
char
**
argv
);
int
kdemain
(
int
argc
,
char
**
argv
)
...
...
@@ -1109,3 +1116,5 @@ void NFSProtocol::createVirtualDirEntry(UDSEntry& entry)
entry
.
fastInsert
(
KIO
::
UDSEntry
::
UDS_USER
,
QString
::
fromLatin1
(
"root"
));
entry
.
fastInsert
(
KIO
::
UDSEntry
::
UDS_GROUP
,
QString
::
fromLatin1
(
"root"
));
}
#include "kio_nfs.moc"
recentdocuments/recentdocuments.cpp
View file @
7a08867d
...
...
@@ -19,6 +19,13 @@
#include <sys/stat.h>
#endif
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.recentdocuments"
FILE
"recentdocuments.json"
)
};
extern
"C"
int
Q_DECL_EXPORT
kdemain
(
int
argc
,
char
**
argv
)
{
// necessary to use other kio slaves
...
...
@@ -193,3 +200,5 @@ void RecentDocuments::del(const QUrl& url, bool isFile)
{
ForwardingSlaveBase
::
del
(
url
,
isFile
);
}
#include "recentdocuments.moc"
settings/kio_settings.cpp
View file @
7a08867d
...
...
@@ -15,6 +15,13 @@
#include <time.h>
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.settings"
FILE
"settings.json"
)
};
class
SettingsProtocol
:
public
KIO
::
SlaveBase
{
public:
...
...
@@ -200,3 +207,5 @@ void SettingsProtocol::get( const QUrl & url )
error
(
KIO
::
ERR_IS_DIRECTORY
,
url
.
toDisplayString
()
);
}
}
#include "kio_settings.moc"
settings/settings.json
View file @
7a08867d
...
...
@@ -17,8 +17,7 @@
"Access"
,
"Owner"
,
"Group"
,
"Link"
,
""
"Link"
],
"makedir"
:
false
,
"maxInstances"
:
2
,
...
...
sftp/kio_sftp.cpp
View file @
7a08867d
...
...
@@ -73,6 +73,13 @@ struct ScopedPointerCustomDeleter
};
typedef
QScopedPointer
<
sftp_attributes_struct
,
ScopedPointerCustomDeleter
>
SFTPAttributesPtr
;
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.sftp"
FILE
"sftp.json"
)
};
using
namespace
KIO
;
extern
"C"
{
...
...
@@ -2794,3 +2801,5 @@ void SFTPSlave::special(const QByteArray &data)
{
maybeError
(
d
->
special
(
data
));
}
#include "kio_sftp.moc"
thumbnail/thumbnail.cpp
View file @
7a08867d
...
...
@@ -84,6 +84,13 @@
using
namespace
KIO
;
// Pseudo plugin class to embed meta data
class
KIOPluginForMetaData
:
public
QObject
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.kio.slave.thumbnail"
FILE
"thumbnail.json"
)
};
extern
"C"
Q_DECL_EXPORT
int
kdemain
(
int
argc
,
char
**
argv
)
{
#ifdef HAVE_NICE
...
...
@@ -727,3 +734,5 @@ void ThumbnailProtocol::drawSubThumbnail(QPainter& p, QImage subThumbnail, int w
const
int
rotationAngle
=
m_randomGenerator
.
bounded
(
-
8
,
9
);
// Random rotation ±8°
drawPictureFrame
(
&
p
,
centerPos
,
subThumbnail
,
frameWidth
,
targetSize
,
rotationAngle
);
}
#include "thumbnail.moc"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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