Commit 060d23f0 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Port plugins loading to KPluginLoader

The ark plugins are now ported to the new KPluingLoader loading mechanism.
The main advantage is that we now save a call to the Syscoca service trader,
since the plugins are installed in a private 'kerfuffle' subdirectory of the
system plugins folder.

In order to be found by KPluginLoader, a plugin has to embed its metadata
defined in a .json file. We convert the existing .desktop files to .json at build time, when possible.
Otherwise we use directly .json metadata files (e.g. for clirar or cliunarchiver).

The libarchive plugin had to be split in two different plugins, one for the
read-only mimetypes and another one for the read-write ones. This is because
the old plugin was using two .desktop files, but the new plugins can only embed
a single .json file.

For more details, see task T923 on phabricator.
parent 0448eb9d
......@@ -2,6 +2,9 @@ set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/plugins/clirarplugin/)
file(COPY ${CMAKE_SOURCE_DIR}/plugins/clirarplugin/kerfuffle_clirar.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
ecm_add_test(
clirartest.cpp
${CMAKE_SOURCE_DIR}/plugins/clirarplugin/cliplugin.cpp
......
......@@ -2,6 +2,9 @@ set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/plugins/cliunarchiverplugin/)
file(COPY ${CMAKE_SOURCE_DIR}/plugins/cliunarchiverplugin/kerfuffle_cliunarchiver.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
ecm_add_test(
cliunarchivertest.cpp
${CMAKE_SOURCE_DIR}/plugins/cliunarchiverplugin/cliplugin.cpp
......
......@@ -38,15 +38,15 @@
#include <QMimeDatabase>
#include <QRegularExpression>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KMimeTypeTrader>
namespace Kerfuffle
{
bool Archive::comparePlugins(const KService::Ptr &p1, const KService::Ptr &p2)
bool Archive::comparePlugins(const KPluginMetaData &p1, const KPluginMetaData &p2)
{
return (p1->property(QStringLiteral( "X-KDE-Priority" )).toInt()) > (p2->property(QStringLiteral( "X-KDE-Priority" )).toInt());
return (p1.rawData()[QStringLiteral("X-KDE-Priority")].toVariant().toInt()) > (p2.rawData()[QStringLiteral("X-KDE-Priority")].toVariant().toInt());
}
QString Archive::determineMimeType(const QString& filename)
......@@ -106,22 +106,21 @@ QString Archive::determineMimeType(const QString& filename)
return mimeFromContent.name();
}
KService::List Archive::findPluginOffers(const QString& filename, const QString& fixedMimeType)
QVector<KPluginMetaData> Archive::findPluginOffers(const QString& filename, const QString& fixedMimeType)
{
KService::List offers;
qCDebug(ARK) << "Find plugin offers for" << filename << "with mime" << fixedMimeType;
const QString mimeType = fixedMimeType.isEmpty() ? determineMimeType(filename) : fixedMimeType;
qCDebug(ARK) << "Detected mime" << mimeType;
if (!mimeType.isEmpty()) {
offers = KMimeTypeTrader::self()->query(mimeType, QStringLiteral( "Kerfuffle/Plugin" ), QStringLiteral( "(exist Library)" ));
qSort(offers.begin(), offers.end(), comparePlugins);
}
QVector<KPluginMetaData> offers = KPluginLoader::findPlugins(QStringLiteral("kerfuffle"), [mimeType](const KPluginMetaData& metaData) {
return metaData.serviceTypes().contains(QStringLiteral("Kerfuffle/Plugin")) &&
metaData.mimeTypes().contains(mimeType);
});
qCDebug(ARK) << "Have" << offers.count() << "offers";
qSort(offers.begin(), offers.end(), comparePlugins);
qCDebug(ARK) << "Have" << offers.size() << "offers";
return offers;
}
......@@ -146,7 +145,7 @@ Archive *Archive::create(const QString &fileName, const QString &fixedMimeType,
QVariantList args;
args.append(QVariant(QFileInfo(fileName).absoluteFilePath()));
const KService::List offers = findPluginOffers(fileName, fixedMimeType);
const QVector<KPluginMetaData> offers = findPluginOffers(fileName, fixedMimeType);
if (offers.isEmpty()) {
qCCritical(ARK) << "Could not find a plugin to handle" << fileName;
return new Archive(NoPlugin, parent);
......@@ -155,34 +154,33 @@ Archive *Archive::create(const QString &fileName, const QString &fixedMimeType,
KPluginFactory *factory;
ReadOnlyArchiveInterface *iface;
foreach (KService::Ptr service, offers) {
foreach (const KPluginMetaData& pluginMetadata, offers) {
QString pluginName = service->library();
bool isReadOnly = !service->property(QStringLiteral("X-KDE-Kerfuffle-ReadWrite")).toBool();
qCDebug(ARK) << "Loading plugin" << pluginName;
bool isReadOnly = !pluginMetadata.rawData()[QStringLiteral("X-KDE-Kerfuffle-ReadWrite")].toVariant().toBool();
qCDebug(ARK) << "Loading plugin" << pluginMetadata.pluginId();
factory = KPluginLoader(pluginName).factory();
factory = KPluginLoader(pluginMetadata.fileName()).factory();
if (!factory) {
qCWarning(ARK) << "Invalid plugin factory for" << pluginName;
qCWarning(ARK) << "Invalid plugin factory for" << pluginMetadata.pluginId();
continue;
}
iface = factory->create<ReadOnlyArchiveInterface>(0, args);
if (!iface) {
qCWarning(ARK) << "Could not create plugin instance" << pluginName;
qCWarning(ARK) << "Could not create plugin instance" << pluginMetadata.pluginId();
continue;
}
if (iface->isCliBased()) {
qCDebug(ARK) << "Finding executables for plugin" << pluginName;
qCDebug(ARK) << "Finding executables for plugin" << pluginMetadata.pluginId();
if (iface->findExecutables(!isReadOnly)) {
return new Archive(iface, isReadOnly, parent);
} else if (!isReadOnly && iface->findExecutables(false)) {
qCWarning(ARK) << "Failed to find read-write executables: falling back to read-only mode for read-write plugin" << pluginName;
qCWarning(ARK) << "Failed to find read-write executables: falling back to read-only mode for read-write plugin" << pluginMetadata.pluginId();
return new Archive(iface, true, parent);
} else {
qCWarning(ARK) << "Failed to find needed executables for plugin" << pluginName;
qCWarning(ARK) << "Failed to find needed executables for plugin" << pluginMetadata.pluginId();
}
} else {
// Not CliBased plugin, don't search for executables.
......@@ -394,17 +392,14 @@ void Archive::enableHeaderEncryption(bool enable)
QSet<QString> supportedMimeTypes()
{
const QLatin1String basePartService("Kerfuffle/Plugin");
const KService::List offers = KServiceTypeTrader::self()->query(basePartService,
QStringLiteral("(exist Library)"));
const QVector<KPluginMetaData> offers = KPluginLoader::findPlugins(QStringLiteral("kerfuffle"), [](const KPluginMetaData& metaData) {
return metaData.serviceTypes().contains(QStringLiteral("Kerfuffle/Plugin"));
});
QSet<QString> supported;
foreach (const KService::Ptr& service, offers) {
foreach (const QString& mimeType, service->serviceTypes()) {
if (mimeType != basePartService) {
supported.insert(mimeType);
}
}
foreach (const KPluginMetaData& pluginMetadata, offers) {
supported += pluginMetadata.mimeTypes().toSet();
}
qCDebug(ARK) << "Returning supported mimetypes" << supported;
......@@ -414,17 +409,15 @@ QSet<QString> supportedMimeTypes()
QSet<QString> supportedWriteMimeTypes()
{
const QLatin1String basePartService("Kerfuffle/Plugin");
const KService::List offers = KServiceTypeTrader::self()->query(basePartService,
QStringLiteral("(exist Library) and ([X-KDE-Kerfuffle-ReadWrite] == true)"));
const QVector<KPluginMetaData> offers = KPluginLoader::findPlugins(QStringLiteral("kerfuffle"), [](const KPluginMetaData& metaData) {
return metaData.serviceTypes().contains(QStringLiteral("Kerfuffle/Plugin")) &&
metaData.rawData()[QStringLiteral("X-KDE-Kerfuffle-ReadWrite")].toVariant().toBool();
});
QSet<QString> supported;
foreach (const KService::Ptr& service, offers) {
foreach (const QString& mimeType, service->serviceTypes()) {
if (mimeType != basePartService) {
supported.insert(mimeType);
}
}
foreach (const KPluginMetaData& pluginMetadata, offers) {
supported += pluginMetadata.mimeTypes().toSet();
}
qCDebug(ARK) << "Returning supported write mimetypes" << supported;
......@@ -434,13 +427,15 @@ QSet<QString> supportedWriteMimeTypes()
QSet<QString> supportedEncryptEntriesMimeTypes()
{
const KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Kerfuffle/Plugin"),
QStringLiteral("(exist Library)"));
const QVector<KPluginMetaData> offers = KPluginLoader::findPlugins(QStringLiteral("kerfuffle"), [](const KPluginMetaData& metaData) {
return metaData.serviceTypes().contains(QStringLiteral("Kerfuffle/Plugin"));
});
QSet<QString> supported;
foreach (const KService::Ptr& service, offers) {
QStringList list(service->property(QStringLiteral("X-KDE-Kerfuffle-EncryptEntries")).toStringList());
foreach (const QString& mimeType, list) {
foreach (const KPluginMetaData& pluginMetadata, offers) {
const QStringList mimeTypes = pluginMetadata.rawData()[QStringLiteral("X-KDE-Kerfuffle-EncryptEntries")].toString().split(QLatin1Char(','));
foreach (const QString& mimeType, mimeTypes) {
supported.insert(mimeType);
}
}
......@@ -452,13 +447,15 @@ QSet<QString> supportedEncryptEntriesMimeTypes()
QSet<QString> supportedEncryptHeaderMimeTypes()
{
const KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Kerfuffle/Plugin"),
QStringLiteral("(exist Library)"));
const QVector<KPluginMetaData> offers = KPluginLoader::findPlugins(QStringLiteral("kerfuffle"), [](const KPluginMetaData& metaData) {
return metaData.serviceTypes().contains(QStringLiteral("Kerfuffle/Plugin"));
});
QSet<QString> supported;
foreach (const KService::Ptr& service, offers) {
QStringList list(service->property(QStringLiteral("X-KDE-Kerfuffle-EncryptHeader")).toStringList());
foreach (const QString& mimeType, list) {
foreach (const KPluginMetaData& pluginMetadata, offers) {
const QStringList mimeTypes = pluginMetadata.rawData()[QStringLiteral("X-KDE-Kerfuffle-EncryptHeader")].toString().split(QLatin1Char(','));
foreach (const QString& mimeType, mimeTypes) {
supported.insert(mimeType);
}
}
......
......@@ -36,7 +36,7 @@
#include <QVariant>
#include <QDebug>
#include <KServiceTypeTrader>
#include <KPluginMetaData>
class KJob;
......@@ -138,9 +138,9 @@ class KERFUFFLE_EXPORT Archive : public QObject
public:
static bool comparePlugins(const KService::Ptr &p1, const KService::Ptr &p2);
static bool comparePlugins(const KPluginMetaData &p1, const KPluginMetaData &p2);
static QString determineMimeType(const QString& filename);
static KService::List findPluginOffers(const QString& filename, const QString& fixedMimeType);
static QVector<KPluginMetaData> findPluginOffers(const QString& filename, const QString& fixedMimeType);
static Archive *create(const QString &fileName, QObject *parent = 0);
static Archive *create(const QString &fileName, const QString &fixedMimeType, QObject *parent = 0);
......
......@@ -20,9 +20,10 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cli7z.desktop
)
kcoreaddons_desktop_to_json(kerfuffle_cli7z ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cli7z.desktop)
########### install files ###############
install(TARGETS kerfuffle_cli7z DESTINATION ${PLUGIN_INSTALL_DIR} )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cli7z.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install(TARGETS kerfuffle_cli7z DESTINATION ${PLUGIN_INSTALL_DIR}/kerfuffle)
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_CLI7Z_MIMETYPES}" PARENT_SCOPE)
......@@ -33,7 +33,7 @@
using namespace Kerfuffle;
K_PLUGIN_FACTORY( CliPluginFactory, registerPlugin< CliPlugin >(); )
K_PLUGIN_FACTORY_WITH_JSON(CliPluginFactory, "kerfuffle_cli7z.json", registerPlugin<CliPlugin>();)
CliPlugin::CliPlugin(QObject *parent, const QVariantList & args)
: CliInterface(parent, args)
......
......@@ -4,7 +4,7 @@ X-KDE-ServiceTypes=Kerfuffle/Plugin
X-KDE-Library=kerfuffle_cli7z
X-KDE-PluginInfo-Author=Harald Hvaal
X-KDE-PluginInfo-Email=haraldhv@stud.ntnu.no
X-KDE-PluginInfo-Name=kerfuffle_7z
X-KDE-PluginInfo-Name=kerfuffle_cli7z
X-KDE-PluginInfo-Version=0.0.1
X-KDE-PluginInfo-Website=http://www.kde.org
X-KDE-PluginInfo-License=GPLv2+
......
......@@ -8,6 +8,7 @@ ecm_qt_declare_logging_category(kerfuffle_cli_SRCS
add_library(kerfuffle_cli ${kerfuffle_cli_SRCS})
target_link_libraries(kerfuffle_cli KF5::KIOCore kerfuffle)
install(TARGETS kerfuffle_cli DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES kerfuffle_cli.desktop DESTINATION ${SERVICES_INSTALL_DIR})
kcoreaddons_desktop_to_json(kerfuffle_cli ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clizip.desktop)
install(TARGETS kerfuffle_cli DESTINATION ${PLUGIN_INSTALL_DIR}/kerfuffle)
......@@ -29,7 +29,7 @@
#include <QDate>
#include <QTime>
K_PLUGIN_FACTORY( CliPluginFactory, registerPlugin< CliPlugin >(); )
K_PLUGIN_FACTORY_WITH_JSON(CliPluginFactory, "kerfuffle_cli.json", registerPlugin<CliPlugin >();)
CliPlugin::CliPlugin(QObject *parent, const QVariantList &args)
: CliInterface(parent, args),
......
########### next target ###############
set(SUPPORTED_CLIRAR_MIMETYPES "application/x-rar;")
set(ENCRYPT_ENTRIES_MIMETYPES "application/x-rar")
set(ENCRYPT_HEADER_MIMETYPES "application/x-rar")
set(kerfuffle_clirar_SRCS cliplugin.cpp)
......@@ -15,14 +13,6 @@ add_library(kerfuffle_clirar MODULE ${kerfuffle_clirar_SRCS})
target_link_libraries(kerfuffle_clirar kerfuffle)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_clirar.desktop.cmake
${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clirar.desktop
)
########### install files ###############
install(TARGETS kerfuffle_clirar DESTINATION ${PLUGIN_INSTALL_DIR} )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clirar.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install(TARGETS kerfuffle_clirar DESTINATION ${PLUGIN_INSTALL_DIR}/kerfuffle)
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_CLIRAR_MIMETYPES}" PARENT_SCOPE)
......@@ -31,7 +31,7 @@
using namespace Kerfuffle;
K_PLUGIN_FACTORY(CliPluginFactory, registerPlugin< CliPlugin >();)
K_PLUGIN_FACTORY_WITH_JSON(CliPluginFactory, "kerfuffle_clirar.json", registerPlugin<CliPlugin>();)
CliPlugin::CliPlugin(QObject *parent, const QVariantList& args)
: CliInterface(parent, args)
......
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=Kerfuffle/Plugin
X-KDE-Library=kerfuffle_clirar
X-KDE-PluginInfo-Author=Harald Hvaal
X-KDE-PluginInfo-Email=haraldhv@stud.ntnu.no
X-KDE-PluginInfo-Name=kerfuffle_clirar
X-KDE-PluginInfo-Version=0.0.1
X-KDE-PluginInfo-Website=http://www.kde.org
X-KDE-PluginInfo-License=GPLv2+
X-KDE-Priority=120
X-KDE-Kerfuffle-APIRevision=1
X-KDE-Kerfuffle-ReadWrite=true
X-KDE-Kerfuffle-EncryptEntries=@ENCRYPT_ENTRIES_MIMETYPES@
X-KDE-Kerfuffle-EncryptHeader=@ENCRYPT_HEADER_MIMETYPES@
Name=RAR archive plugin
Name[ar]=ملحق أرشيف RAR
Name[ast]=Complementu d'archivos RAR
Name[bg]=Приставка за архиви RAR
Name[bs]=Priključak RAR arhiva
Name[ca]=Connector per arxius RAR
Name[ca@valencia]=Connector per arxius RAR
Name[cs]=Modul pro archiv RAR
Name[da]=Plugin til RAR-arkiver
Name[de]=RAR-Archiv-Modul
Name[el]=πρόσθετο αρχειοθήκης RAR
Name[en_GB]=RAR archive plugin
Name[es]=Complemento de archivo comprimido RAR
Name[et]=RAR-arhiivi plugin
Name[eu]=RAR artxiboen plugina
Name[fi]=RAR-pakkaustuki
Name[fr]=Module externe d'archive « RAR »
Name[ga]=Breiseán cartlainne RAR
Name[gl]=Extensión de arquivo RAR
Name[hr]=Arhivni priključak RAR
Name[hu]=RAR modul
Name[ia]=plugin de archivar RAR
Name[id]=Pengaya arsip RAR
Name[it]=estensione per archivi RAR
Name[ja]=RAR アーカイブ用プラグイン
Name[kk]=RAR архив плагині
Name[km]=កម្មវិធី​ជំនួយ​ប័ណ្ណសារ RAR
Name[ko]=RAR 압축 플러그인
Name[lt]=RAR archyvo papildinys
Name[lv]=RAR arhīvu spraudnis
Name[mr]=RAR संग्रह प्लगइन
Name[nb]=Programtillegg for RAR-arkiv
Name[nds]=RAR-Archievmoduul
Name[nl]=RAR-archiefplug-in
Name[nn]=RAR-arkivtillegg
Name[pa]=RAR ਅਕਾਇਵ ਪਲੱਗਇਨ
Name[pl]=Wtyczka archiwów RAR
Name[pt]='Plugin' de pacotes RAR
Name[pt_BR]=Plugin de arquivos RAR
Name[ro]=Modul de arhivă RAR
Name[ru]=Поддержка архивов RAR
Name[sk]=Modul RAR archívu
Name[sl]=Vstavek za arhive RAR
Name[sq]=RAR arkiv plugin
Name[sr]=Прикључак РАР архива
Name[sr@ijekavian]=Прикључак РАР архива
Name[sr@ijekavianlatin]=Priključak RAR arhiva
Name[sr@latin]=Priključak RAR arhiva
Name[sv]=Insticksprogram för RAR-arkiv
Name[th]=ส่วนเสริมการจัดการแฟ้มจัดเก็บบีบอัดแบบ RAR
Name[tr]=RAR arşivi eklentisi
Name[uk]=Додаток для архівів RAR
Name[x-test]=xxRAR archive pluginxx
Name[zh_CN]=RAR 归档插件
Name[zh_TW]=RAR 壓縮檔外掛程式
MimeType=@SUPPORTED_CLIRAR_MIMETYPES@
{
"KPlugin": {
"Authors": [
{
"Email": "haraldhv@stud.ntnu.no",
"Name": "Harald Hvaal"
}
],
"Id": "kerfuffle_clirar",
"License": "GPLv2+",
"MimeTypes": [
"application/x-rar"
],
"Name": "RAR archive plugin",
"Name[ar]": "ملحق أرشيف RAR",
"Name[ast]": "Complementu d'archivos RAR",
"Name[bg]": "Приставка за архиви RAR",
"Name[bs]": "Priključak RAR arhiva",
"Name[ca@valencia]": "Connector per arxius RAR",
"Name[ca]": "Connector per arxius RAR",
"Name[cs]": "Modul pro archiv RAR",
"Name[da]": "Plugin til RAR-arkiver",
"Name[de]": "RAR-Archiv-Modul",
"Name[el]": "πρόσθετο αρχειοθήκης RAR",
"Name[en_GB]": "RAR archive plugin",
"Name[es]": "Complemento de archivo comprimido RAR",
"Name[et]": "RAR-arhiivi plugin",
"Name[eu]": "RAR artxiboen plugina",
"Name[fi]": "RAR-pakkaustuki",
"Name[fr]": "Module externe d'archive « RAR »",
"Name[ga]": "Breiseán cartlainne RAR",
"Name[gl]": "Extensión de arquivo RAR",
"Name[hr]": "Arhivni priključak RAR",
"Name[hu]": "RAR modul",
"Name[ia]": "plugin de archivar RAR",
"Name[id]": "Pengaya arsip RAR",
"Name[it]": "estensione per archivi RAR",
"Name[ja]": "RAR アーカイブ用プラグイン",
"Name[kk]": "RAR архив плагині",
"Name[km]": "កម្មវិធី​ជំនួយ​ប័ណ្ណសារ RAR",
"Name[ko]": "RAR 압축 플러그인",
"Name[lt]": "RAR archyvo papildinys",
"Name[lv]": "RAR arhīvu spraudnis",
"Name[mr]": "RAR संग्रह प्लगइन",
"Name[nb]": "Programtillegg for RAR-arkiv",
"Name[nds]": "RAR-Archievmoduul",
"Name[nl]": "RAR-archiefplug-in",
"Name[nn]": "RAR-arkivtillegg",
"Name[pa]": "RAR ਅਕਾਇਵ ਪਲੱਗਇਨ",
"Name[pl]": "Wtyczka archiwów RAR",
"Name[pt]": "'Plugin' de pacotes RAR",
"Name[pt_BR]": "Plugin de arquivos RAR",
"Name[ro]": "Modul de arhivă RAR",
"Name[ru]": "Поддержка архивов RAR",
"Name[sk]": "Modul RAR archívu",
"Name[sl]": "Vstavek za arhive RAR",
"Name[sq]": "RAR arkiv plugin",
"Name[sr@ijekavian]": "Прикључак РАР архива",
"Name[sr@ijekavianlatin]": "Priključak RAR arhiva",
"Name[sr@latin]": "Priključak RAR arhiva",
"Name[sr]": "Прикључак РАР архива",
"Name[sv]": "Insticksprogram för RAR-arkiv",
"Name[th]": "ส่วนเสริมการจัดการแฟ้มจัดเก็บบีบอัดแบบ RAR",
"Name[tr]": "RAR arşivi eklentisi",
"Name[uk]": "Додаток для архівів RAR",
"Name[x-test]": "xxRAR archive pluginxx",
"Name[zh_CN]": "RAR 归档插件",
"Name[zh_TW]": "RAR 壓縮檔外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
],
"Version": "0.0.1",
"Website": "http://www.kde.org"
},
"MimeType": "application/x-rar;",
"X-KDE-Kerfuffle-APIRevision": "1",
"X-KDE-Kerfuffle-EncryptEntries": "application/x-rar",
"X-KDE-Kerfuffle-EncryptHeader": "application/x-rar",
"X-KDE-Kerfuffle-ReadWrite": "true",
"X-KDE-Priority": "120"
}
......@@ -13,15 +13,7 @@ add_library(kerfuffle_cliunarchiver MODULE ${kerfuffle_cliunarchiver_SRCS})
target_link_libraries(kerfuffle_cliunarchiver kerfuffle)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_cliunarchiver.desktop.cmake
${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cliunarchiver.desktop
)
########### install files ###############
install(TARGETS kerfuffle_cliunarchiver DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cliunarchiver.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(TARGETS kerfuffle_cliunarchiver DESTINATION ${PLUGIN_INSTALL_DIR}/kerfuffle)
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_CLIUNARCHIVER_MIMETYPES}"
PARENT_SCOPE)
......@@ -32,7 +32,7 @@
using namespace Kerfuffle;
K_PLUGIN_FACTORY(CliPluginFactory, registerPlugin<CliPlugin>();)
K_PLUGIN_FACTORY_WITH_JSON(CliPluginFactory, "kerfuffle_cliunarchiver.json", registerPlugin<CliPlugin>();)
CliPlugin::CliPlugin(QObject *parent, const QVariantList &args)
: CliInterface(parent, args)
......
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=Kerfuffle/Plugin
X-KDE-Library=kerfuffle_cliunarchiver
X-KDE-PluginInfo-Author=Luke Shumaker
X-KDE-PluginInfo-Email=lukeshu@sbcglobal.net
X-KDE-PluginInfo-Name=kerfuffle_cliunarchiver
X-KDE-PluginInfo-Version=0.0.1
X-KDE-PluginInfo-Website=http://www.kde.org
X-KDE-PluginInfo-License=GPLv2+
X-KDE-Priority=100
X-KDE-Kerfuffle-APIRevision=1
X-KDE-Kerfuffle-ReadWrite=false
Name=The Unarchiver plugin
Name[ast]=El complementu desarchivador
Name[ca]=Connector del Unarchiver
Name[ca@valencia]=Connector del Unarchiver
Name[de]=Unarchiver-Modul
Name[en_GB]=The Unarchiver plugin
Name[nl]=De plug-in voor uit archief halen
Name[pl]=Wtyczka wypakowywacza
Name[pt]=O 'plugin' do Unarchiver
Name[pt_BR]=Plugin Unarchiver
Name[sr]=Прикључак Унархивера
Name[sr@ijekavian]=Прикључак Унархивера
Name[sr@ijekavianlatin]=Priključak Unarchivera
Name[sr@latin]=Priključak Unarchivera
Name[sv]=Insticksprogram för Unarchiver
Name[uk]=Додаток Unarchiver
Name[x-test]=xxThe Unarchiver pluginxx
MimeType=@SUPPORTED_CLIUNARCHIVER_MIMETYPES@
{
"KPlugin": {
"Authors": [
{
"Email": "elvis.angelaccio@kdemail.net",
"Name": "Elvis Angelaccio"
}
],
"Id": "kerfuffle_cliunarchiver",
"License": "GPLv2+",
"MimeTypes": [
"application/x-rar"
],
"Name": "The Unarchiver plugin",
"Name[ast]": "El complementu desarchivador",
"Name[ca]": "Connector del Unarchiver",
"Name[de]": "Unarchiver-Modul",
"Name[nl]": "De plug-in voor uit archief halen",
"Name[pt]": "O 'plugin' do Unarchiver",
"Name[pt_BR]": "Plugin Unarchiver",
"Name[sv]": "Insticksprogram för Unarchiver",
"Name[uk]": "Додаток Unarchiver",
"Name[x-test]": "xxThe Unarchiver pluginxx",
"ServiceTypes": [
"Kerfuffle/Plugin"
],
"Version": "0.0.1",
"Website": "http://www.kde.org"
},
"MimeType": "application/x-rar;",
"X-KDE-Kerfuffle-APIRevision": "1",
"X-KDE-Kerfuffle-ReadWrite": "false",
"X-KDE-Priority": "100"
}
......@@ -19,9 +19,10 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clizip.desktop
)
kcoreaddons_desktop_to_json(kerfuffle_clizip ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clizip.desktop)
########### install files ###############
install(TARGETS kerfuffle_clizip DESTINATION ${PLUGIN_INSTALL_DIR} )