diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt --- a/kio/CMakeLists.txt +++ b/kio/CMakeLists.txt @@ -17,5 +17,6 @@ ) ########### install files ############### -install(TARGETS kio_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES kdeconnect.protocol DESTINATION ${SERVICES_INSTALL_DIR}) +set_target_properties(kio_kdeconnect PROPERTIES OUTPUT_NAME "kdeconnect") +set_target_properties(kio_kdeconnect PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/kf5/kio") +install(TARGETS kio_kdeconnect DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio) diff --git a/kio/kdeconnect.json b/kio/kdeconnect.json new file mode 100644 --- /dev/null +++ b/kio/kdeconnect.json @@ -0,0 +1,26 @@ +{ + "KDE-KIO-Protocols": { + "kdeconnect": { + "Class": ":internet", + "Icon": "kdeconnect", + "copyFromFile": false, + "copyToFile": false, + "deleting": false, + "exec": "kdeconnect", + "input": "none", + "listing": [ + "Name", + "Type", + "Access", + "" + ], + "makedir": false, + "maxInstances": 2, + "moving": false, + "output": "filesystem", + "protocol": "kdeconnect", + "reading": true, + "writing": false + } + } +} diff --git a/kio/kdeconnect.protocol b/kio/kdeconnect.protocol deleted file mode 100644 --- a/kio/kdeconnect.protocol +++ /dev/null @@ -1,16 +0,0 @@ -[Protocol] -exec=kio_kdeconnect -protocol=kdeconnect -input=none -output=filesystem -copyToFile=false -copyFromFile=false -listing=Name,Type,Access -reading=true -writing=false -makedir=false -deleting=false -moving=false -Icon=kdeconnect -maxInstances=2 - diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -27,11 +27,21 @@ #include #include +#include Q_LOGGING_CATEGORY(KDECONNECT_KIO, "kdeconnect.kio") +class KIOPluginForMetaData : public QObject +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.kde.kio.slave.kdeconnect" FILE "kdeconnect.json") +}; + extern "C" int Q_DECL_EXPORT kdemain(int argc, char** argv) { + QCoreApplication app(argc, argv); + app.setApplicationName(QStringLiteral("kio_kdeconnect")); + if (argc != 4) { fprintf(stderr, "Usage: kio_kdeconnect protocol pool app\n"); exit(-1); @@ -232,3 +242,5 @@ } +//needed for JSON file embedding +#include "kiokdeconnect.moc"