Move the plugins into a different top-ĺevel directory

Reviewed by Albert Vaca
This commit is contained in:
Aleix Pol 2014-06-14 16:34:00 +02:00
parent 232c43838c
commit 741abafaf7
81 changed files with 70 additions and 66 deletions

View file

@ -2,6 +2,8 @@ project(kdeconnect)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
@ -22,6 +24,7 @@ add_subdirectory(icon)
add_subdirectory(interfaces)
add_subdirectory(kded)
add_subdirectory(plugins)
add_subdirectory(plasmoid)
add_subdirectory(cli)

View file

@ -3,12 +3,10 @@ project(KDEConnectCore)
include_directories(
${KDE4_KIO_LIBS}
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QCA2_INCLUDE_DIR}
)
add_subdirectory(plugins)
add_subdirectory(backends/lan)
add_subdirectory(backends/loopback)
@ -18,8 +16,8 @@ set(kded_kdeconnect_SRCS
backends/linkprovider.cpp
backends/devicelink.cpp
plugins/kdeconnectplugin.cpp
plugins/pluginloader.cpp
kdeconnectplugin.cpp
pluginloader.cpp
networkpackage.cpp
filetransferjob.cpp
@ -39,9 +37,10 @@ PRIVATE
${QT_QTNETWORK_LIBRARY}
${QCA2_LIBRARIES}
)
target_include_directories(kdeconnectcore PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
generate_export_header(kdeconnectcore EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectcore_export.h BASE_NAME KDEConnectCore)
include(../macros.cmake)
include(macros)
generate_and_install_dbus_interface(
kdeconnectcore

View file

@ -36,8 +36,8 @@
#include <KIcon>
#include "kdebugnamespace.h"
#include "plugins/kdeconnectplugin.h"
#include "plugins/pluginloader.h"
#include "kdeconnectplugin.h"
#include "pluginloader.h"
#include "backends/devicelink.h"
#include "backends/linkprovider.h"
#include "networkpackage.h"
@ -483,4 +483,4 @@ QString Device::type2str(Device::DeviceType deviceType) {
if (deviceType == Phone) return "phone";
if (deviceType == Tablet) return "tablet";
return "unknown";
}
}

View file

@ -20,12 +20,20 @@
#include "kdeconnectplugin.h"
#include "../device.h"
struct KdeConnectPluginPrivate
{
Device* mDevice;
// The Initializer object sets things up, and also does cleanup when it goes out of scope
// Since the plugins use their own memory, they need their own initializer in order to send encrypted packages
QCA::Initializer init;
};
KdeConnectPlugin::KdeConnectPlugin(QObject* parent, const QVariantList& args)
: QObject(parent)
, d(new KdeConnectPluginPrivate)
{
mDevice = qvariant_cast< Device* >(args.first());
d->mDevice = qvariant_cast< Device* >(args.first());
}
KdeConnectPlugin::~KdeConnectPlugin()
@ -34,10 +42,10 @@ KdeConnectPlugin::~KdeConnectPlugin()
Device* KdeConnectPlugin::device()
{
return mDevice;
return d->mDevice;
}
Device const* KdeConnectPlugin::device() const
{
return mDevice;
return d->mDevice;
}

View file

@ -24,14 +24,16 @@
#include <QObject>
#include <QVariantList>
#include <kdemacros.h>
#include <KPluginFactory>
#include <KPluginLoader>
#include "../networkpackage.h"
#include "../device.h"
#include "kdeconnectcore_export.h"
#include "networkpackage.h"
#include "device.h"
class KDE_EXPORT KdeConnectPlugin
struct KdeConnectPluginPrivate;
class KDECONNECTCORE_EXPORT KdeConnectPlugin
: public QObject
{
Q_OBJECT
@ -57,11 +59,7 @@ public Q_SLOTS:
virtual void connected() = 0;
private:
Device* mDevice;
// The Initializer object sets things up, and also does cleanup when it goes out of scope
// Since the plugins use their own memory, they need their own initializer in order to send encrypted packages
QCA::Initializer init;
QScopedPointer<KdeConnectPluginPrivate> d;
};

View file

@ -22,8 +22,8 @@
#include <KServiceTypeTrader>
#include "../kdebugnamespace.h"
#include "../device.h"
#include "kdebugnamespace.h"
#include "device.h"
#include "kdeconnectplugin.h"
PluginLoader* PluginLoader::instance()

View file

@ -1,4 +1,4 @@
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/core ${QCA2_INCLUDE_DIR})
install(FILES kdeconnect_plugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
add_subdirectory(ping)

View file

@ -10,7 +10,7 @@ target_link_libraries(kdeconnect_battery kdeconnectcore ${KDE4_KDEUI_LIBS})
install(TARGETS kdeconnect_battery DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_battery.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
include(../../../macros.cmake)
include(macros)
generate_and_install_dbus_interface(
kdeconnect_battery

View file

@ -20,7 +20,7 @@
#include "batterydbusinterface.h"
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
BatteryDbusInterface::BatteryDbusInterface(QObject *parent)
: QDBusAbstractAdaptor(parent)

View file

@ -24,7 +24,7 @@
#include <KIcon>
#include <KLocalizedString>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include "batterydbusinterface.h"
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< BatteryPlugin >(); )

View file

@ -21,7 +21,7 @@
#ifndef BATTERYPLUGIN_H
#define BATTERYPLUGIN_H
#include "../kdeconnectplugin.h"
#include <core/kdeconnectplugin.h>
#define PACKAGE_TYPE_BATTERY QLatin1String("kdeconnect.battery")

View file

@ -24,9 +24,7 @@
#include <QObject>
#include <QClipboard>
#include "../kdeconnectplugin.h"
#include "../../networkpackage.h"
#include "../../device.h"
#include <core/kdeconnectplugin.h>
#define PACKAGE_TYPE_CLIPBOARD QLatin1String("kdeconnect.clipboard")

View file

@ -28,7 +28,8 @@
#include <QDBusReply>
#include <QDBusMessage>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include <core/device.h>
#include "mprisdbusinterface.h"
#include "propertiesdbusinterface.h"

View file

@ -24,7 +24,7 @@
#include <QString>
#include <QHash>
#include "../kdeconnectplugin.h"
#include <core/kdeconnectplugin.h>
#define PACKAGE_TYPE_MPRIS QLatin1String("kdeconnect.mpris")

View file

@ -11,7 +11,7 @@ target_link_libraries(kdeconnect_notifications kdeconnectcore ${KDE4_KDEUI_LIBS}
install(TARGETS kdeconnect_notifications DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_notifications.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
include(../../../macros.cmake)
include(macros)
generate_and_install_dbus_interface(
kdeconnect_notifications
notificationsdbusinterface.h

View file

@ -22,7 +22,7 @@
#include <QDBusConnection>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
Notification::Notification(const NetworkPackage& np, const QString& iconPath, QObject* parent)
: QObject(parent)

View file

@ -24,7 +24,7 @@
#include <QObject>
#include <QString>
#include "../../networkpackage.h"
#include <core/networkpackage.h>
class Notification
: public QObject

View file

@ -26,8 +26,8 @@
#include <KIcon>
#include <KMD5>
#include "../../kdebugnamespace.h"
#include "../../filetransferjob.h"
#include <core/kdebugnamespace.h>
#include <core/filetransferjob.h>
#include "notificationsplugin.h"
NotificationsDbusInterface::NotificationsDbusInterface(Device* device, QObject *parent)

View file

@ -27,7 +27,7 @@
#include <QStringList>
#include <QDir>
#include "../../device.h"
#include <core/device.h>
#include "notification.h"
class NotificationsDbusInterface

View file

@ -22,7 +22,7 @@
#include <KIcon>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include "notificationsdbusinterface.h"
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< NotificationsPlugin >(); )

View file

@ -23,7 +23,7 @@
#include <knotification.h>
#include "../kdeconnectplugin.h"
#include <core/kdeconnectplugin.h>
#define PACKAGE_TYPE_NOTIFICATION QLatin1String("kdeconnect.notification")
/*

View file

@ -1,17 +1,11 @@
set(kdeconnect_pausemusic_SRCS
pausemusicplugin.cpp
../kdeconnectplugin.cpp
../../kdebugnamespace.cpp
)
kde4_add_plugin(kdeconnect_pausemusic ${kdeconnect_pausemusic_SRCS})
target_link_libraries(kdeconnect_pausemusic
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
kdeconnectcore
)
install(TARGETS kdeconnect_pausemusic DESTINATION ${PLUGIN_INSTALL_DIR} )

View file

@ -24,7 +24,7 @@
#include <KSharedConfig>
#include <KConfigGroup>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include "ui_pausemusic_config.h"

View file

@ -29,7 +29,8 @@
#include <KSharedConfig>
#include <KConfigGroup>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include <core/networkpackage.h>
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< PauseMusicPlugin >(); )
K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_pausemusic", "kdeconnect-kded") )

View file

@ -25,7 +25,7 @@
#include <QSet>
#include <QString>
#include "../kdeconnectplugin.h"
#include <core/kdeconnectplugin.h>
class PauseMusicPlugin
: public KdeConnectPlugin

View file

@ -24,7 +24,8 @@
#include <KIcon>
#include <KLocalizedString>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include <core/device.h>
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< PingPlugin >(); )
K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_ping", "kdeconnect-kded") )

View file

@ -23,7 +23,7 @@
#include <QObject>
#include "../kdeconnectplugin.h"
#include <core/kdeconnectplugin.h>
class KDE_EXPORT PingPlugin
: public KdeConnectPlugin

View file

@ -11,7 +11,7 @@ target_link_libraries(kdeconnect_sftp kdeconnectcore ${KDE4_KFILE_LIBS})
install(TARGETS kdeconnect_sftp DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_sftp.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
include(../../../macros.cmake)
include(macros)
generate_and_install_dbus_interface(
kdeconnect_sftp

View file

@ -24,7 +24,7 @@
#include <KLocalizedString>
#include <KStandardDirs>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include "mounter.h"

View file

@ -27,7 +27,7 @@
#include <KStandardDirs>
#include "sftpplugin.h"
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include "ui_sftp_config.h"

View file

@ -35,7 +35,7 @@
#include "sftp_config.h"
#include "mounter.h"
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< SftpPlugin >(); )
K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_sftp", "kdeconnect-kded") )

View file

@ -21,7 +21,8 @@
#ifndef SFTPPLUGIN_H
#define SFTPPLUGIN_H
#include "../kdeconnectplugin.h"
#include <core/kdeconnectplugin.h>
#include <core/device.h>
#define PACKAGE_TYPE_SFTP QLatin1String("kdeconnect.sftp")

View file

@ -23,7 +23,7 @@
#include <QFile>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
class AutoClosingQFile : public QFile
{

View file

@ -26,7 +26,7 @@
#include <KSharedConfig>
#include <KUrlRequester>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
#include "ui_share_config.h"

View file

@ -33,8 +33,8 @@
#include <QDesktopServices>
#include <QDBusConnection>
#include "../../kdebugnamespace.h"
#include "../../filetransferjob.h"
#include <core/kdebugnamespace.h>
#include <core/filetransferjob.h>
#include "autoclosingqfile.h"
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< SharePlugin >(); )

View file

@ -24,7 +24,7 @@
#include <KNotification>
#include <KIO/Job>
#include "../kdeconnectplugin.h"
#include <core/kdeconnectplugin.h>
#define PACKAGE_TYPE_SHARE QLatin1String("kdeconnect.share")

View file

@ -23,7 +23,7 @@
#include <KLocalizedString>
#include <KIcon>
#include "../../kdebugnamespace.h"
#include <core/kdebugnamespace.h>
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< TelephonyPlugin >(); )
K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_telephony", "kdeconnect-kded") )

View file

@ -23,7 +23,7 @@
#include <knotification.h>
#include "../kdeconnectplugin.h"
#include <core/kdeconnectplugin.h>
#include <KStatusNotifierItem>