Verified Commit 7a08867d authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Embed JSON metadata in KIOSlaves

Task: https://phabricator.kde.org/T14518
parent 2846838f
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -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"
......@@ -17,8 +17,7 @@
"Access",
"Owner",
"Group",
"Link",
""
"Link"
],
"makedir": false,
"maxInstances": 2,
......
......@@ -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"
......@@ -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"
Markdown is supported
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