[kdeconnect-kde/frameworks] /: First approach to a KF5 port of KDE Connect

Aleix Pol aleixpol at kde.org
Mon Jun 16 18:04:45 UTC 2014


Git commit a1a560c4695a67ef7bca94c46a54aadb7289f081 by Aleix Pol.
Committed on 16/06/2014 at 18:02.
Pushed by apol into branch 'frameworks'.

First approach to a KF5 port of KDE Connect

Ported using KDELibs4Support, for a smaller delta, so we can keep
developing on master until we decide not to.

At the moment, it builds and installs but tests don't pass because
of a QCA2 initialization problem I didn't manage to debug yet.

CCMAIL: kdeconnect at kde.org

M  +13   -9    CMakeLists.txt
M  +1    -1    cli/CMakeLists.txt
M  +3    -2    cli/kdeconnect-cli.cpp
A  +48   -0    cmake/FindQCA2.cmake
M  +8    -10   cmake/macros.cmake
M  +5    -5    core/CMakeLists.txt
M  +1    -1    core/daemon.cpp
M  +0    -1    core/daemon.h
M  +4    -2    core/device.cpp
M  +7    -7    core/filetransferjob.cpp
M  +1    -1    core/filetransferjob.h
M  +1    -0    core/kdebugnamespace.h
M  +2    -2    fileitemactionplugin/CMakeLists.txt
M  +3    -0    fileitemactionplugin/sendfileitemaction.cpp
M  +1    -1    icon/CMakeLists.txt
M  +14   -12   interfaces/CMakeLists.txt
M  +5    -5    kcm/CMakeLists.txt
M  +12   -7    kcm/kcm.cpp
M  +4    -4    kded/CMakeLists.txt
M  +3    -3    kded/kdeconnectd.cpp
M  +2    -0    kded/kded.cpp
M  +5    -6    kio/CMakeLists.txt
M  +6    -5    kio/kiokdeconnect.cpp
M  +3    -3    kio/kiokdeconnect.h
M  +4    -7    plasmoid/declarativeplugin/CMakeLists.txt
M  +5    -7    plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
M  +7    -3    plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h
M  +0    -2    plasmoid/declarativeplugin/responsewaiter.h
M  +1    -1    plugins/battery/CMakeLists.txt
M  +2    -1    plugins/battery/batteryplugin.cpp
M  +2    -2    plugins/clipboard/CMakeLists.txt
M  +2    -0    plugins/clipboard/clipboardplugin.cpp
M  +3    -3    plugins/mpriscontrol/CMakeLists.txt
M  +2    -0    plugins/mpriscontrol/mpriscontrolplugin.cpp
M  +7    -4    plugins/mpriscontrol/propertiesInterface.xml
M  +1    -1    plugins/notifications/CMakeLists.txt
M  +3    -1    plugins/notifications/notificationsdbusinterface.cpp
M  +1    -1    plugins/notifications/notificationsplugin.cpp
M  +4    -4    plugins/pausemusic/CMakeLists.txt
M  +3    -1    plugins/pausemusic/pausemusic_config.cpp
M  +2    -0    plugins/pausemusic/pausemusicplugin.cpp
M  +1    -1    plugins/ping/CMakeLists.txt
M  +3    -1    plugins/ping/pingplugin.cpp
M  +5    -5    plugins/sftp/CMakeLists.txt
M  +4    -2    plugins/sftp/sftp_config.cpp
M  +2    -1    plugins/sftp/sftpplugin.cpp
M  +6    -6    plugins/share/CMakeLists.txt
M  +3    -1    plugins/share/share_config.cpp
M  +3    -1    plugins/share/shareplugin.cpp
M  +1    -1    plugins/telephony/CMakeLists.txt
M  +3    -1    plugins/telephony/telephonyplugin.cpp
M  +5    -12   tests/CMakeLists.txt

http://commits.kde.org/kdeconnect-kde/a1a560c4695a67ef7bca94c46a54aadb7289f081

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b916d9..3aa3c9f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,20 +1,24 @@
 project(kdeconnect)
 
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.12)
 
-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+find_package(ECM 0.0.9 REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
 
-find_package(KDE4 REQUIRED)
-find_package(QJSON REQUIRED)
+find_package(Qt5 5.2 REQUIRED COMPONENTS Qml Quick Xml Svg OpenGL PrintSupport Test)
+find_package(KF5 REQUIRED COMPONENTS I18n KIO Notifications ConfigWidgets DBusAddons KCMUtils KDELibs4Support)
 find_package(QCA2 REQUIRED)
+find_package(QJSON REQUIRED)
 
-#if(CMAKE_COMPILER_IS_GNUCXX)
-#    add_definitions(-std=gnu++0x)
-#endif()
+include(KDEInstallDirs)
+include(KDECompilerSettings)
+include(KDECMakeSettings)
+include(ECMAddTests)
+include(ECMSetupVersion)
+include(ECMInstallIcons)
+include(FeatureSummary)
 
 include(GenerateExportHeader)
-include(KDE4Defaults)
-include_directories(${KDE4_INCLUDES})
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 add_subdirectory(core)
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
index 0eb8402..1c368a1 100644
--- a/cli/CMakeLists.txt
+++ b/cli/CMakeLists.txt
@@ -2,6 +2,6 @@ include_directories(${CMAKE_SOURCE_DIR})
 
 add_executable(kdeconnect-cli kdeconnect-cli.cpp)
 
-target_link_libraries(kdeconnect-cli kdeconnectinterfaces ${QT_QTGUI_LIBRARY} ${KDE4_KDEUI_LIBS})
+target_link_libraries(kdeconnect-cli kdeconnectinterfaces Qt5::Gui ${KDE4_KDEUI_LIBS})
 
 install(TARGETS kdeconnect-cli ${INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/cli/kdeconnect-cli.cpp b/cli/kdeconnect-cli.cpp
index 3366e7d..dcb7b82 100644
--- a/cli/kdeconnect-cli.cpp
+++ b/cli/kdeconnect-cli.cpp
@@ -21,6 +21,7 @@
 #include <KApplication>
 #include <KUrl>
 #include <kcmdlineargs.h>
+#include <k4aboutdata.h>
 #include <kaboutdata.h>
 #include <interfaces/devicesmodel.h>
 #include <iostream>
@@ -29,8 +30,8 @@
 
 int main(int argc, char** argv)
 {
-    KAboutData about("kctool", 0, ki18n(("kctool")), "1.0", ki18n("KDE Connect CLI tool"),
-                     KAboutData::License_GPL, ki18n("(C) 2013 Aleix Pol Gonzalez"));
+    K4AboutData about("kctool", 0, ki18n(("kctool")), "1.0", ki18n("KDE Connect CLI tool"),
+                     K4AboutData::License_GPL, ki18n("(C) 2013 Aleix Pol Gonzalez"));
     about.addAuthor( ki18n("Aleix Pol Gonzalez"), KLocalizedString(), "aleixpol at kde.org" );
     KCmdLineArgs::init(argc, argv, &about);
     KCmdLineOptions options;
diff --git a/cmake/FindQCA2.cmake b/cmake/FindQCA2.cmake
new file mode 100644
index 0000000..e2d8f2a
--- /dev/null
+++ b/cmake/FindQCA2.cmake
@@ -0,0 +1,48 @@
+# - Try to find QCA2 (Qt Cryptography Architecture 2)
+# Once done this will define
+#
+#  QCA2_FOUND - system has QCA2
+#  QCA2_INCLUDE_DIR - the QCA2 include directory
+#  QCA2_LIBRARIES - the libraries needed to use QCA2
+#  QCA2_DEFINITIONS - Compiler switches required for using QCA2
+#
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+
+# Copyright (c) 2006, Michael Larouche, <michael.larouche at kdemail.net>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(FindLibraryWithDebug)
+
+if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+
+  # in cache already
+  set(QCA2_FOUND TRUE)
+
+else (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+
+
+  if (NOT WIN32)
+    find_package(PkgConfig)
+    pkg_check_modules(PC_QCA2 QUIET qca2)
+    set(QCA2_DEFINITIONS ${PC_QCA2_CFLAGS_OTHER})
+  endif (NOT WIN32)
+
+  find_library_with_debug(QCA2_LIBRARIES
+                  WIN32_DEBUG_POSTFIX d
+                  NAMES qca
+                  HINTS ${PC_QCA2_LIBDIR} ${PC_QCA2_LIBRARY_DIRS}
+                  )
+
+  find_path(QCA2_INCLUDE_DIR QtCrypto
+            HINTS ${PC_QCA2_INCLUDEDIR} ${PC_QCA2_INCLUDE_DIRS}
+            PATH_SUFFIXES QtCrypto)
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(QCA2  DEFAULT_MSG  QCA2_LIBRARIES QCA2_INCLUDE_DIR)
+
+  mark_as_advanced(QCA2_INCLUDE_DIR QCA2_LIBRARIES)
+
+endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
diff --git a/cmake/macros.cmake b/cmake/macros.cmake
index 9d4810d..85a1a75 100644
--- a/cmake/macros.cmake
+++ b/cmake/macros.cmake
@@ -1,15 +1,13 @@
-
-include(KDE4Defaults)
 macro (generate_and_install_dbus_interface main_project_target header_file output_xml_file) #OPTIONS qdbus_options
-    QT4_EXTRACT_OPTIONS(
-        extra_files_ignore
-        qdbus_options
-        ${ARGN}
-    )
-    qt4_generate_dbus_interface(
+#     qt5_extract_options(
+#         extra_files_ignore
+#         qdbus_options
+#         ${ARGN}
+#     )
+    qt5_generate_dbus_interface(
         ${header_file}
         ${output_xml_file}
-        OPTIONS ${qdbus_options}
+#         OPTIONS ${qdbus_options}
     )
     add_custom_target(
         ${output_xml_file}
@@ -23,4 +21,4 @@ macro (generate_and_install_dbus_interface main_project_target header_file outpu
         ${main_project_target}
         ${output_xml_file}
     )
-endmacro (generate_and_install_dbus_interface)
+endmacro ()
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index e722eba..da0fb0c 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -1,7 +1,6 @@
 project(KDEConnectCore)
 
 include_directories(
-    ${KDE4_KIO_LIBS}
     ${QJSON_INCLUDE_DIR}
     ${CMAKE_CURRENT_BINARY_DIR}
     ${QCA2_INCLUDE_DIR}
@@ -26,15 +25,16 @@ set(kded_kdeconnect_SRCS
     kdebugnamespace.cpp
 )
 
-kde4_add_library(kdeconnectcore SHARED ${kded_kdeconnect_SRCS})
+add_library(kdeconnectcore SHARED ${kded_kdeconnect_SRCS})
 target_link_libraries(kdeconnectcore
 PUBLIC
-    ${KDE4_KDECORE_LIBS}
+    KF5::KDELibs4Support
 
 PRIVATE
-    ${KDE4_KIO_LIBS}
+    KF5::KIOWidgets
+    KF5::KCMUtils
+    Qt5::Network
     ${QJSON_LIBRARIES}
-    ${QT_QTNETWORK_LIBRARY}
     ${QCA2_LIBRARIES}
 )
 target_include_directories(kdeconnectcore PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/core/daemon.cpp b/core/daemon.cpp
index 4243ea9..9b46733 100644
--- a/core/daemon.cpp
+++ b/core/daemon.cpp
@@ -80,7 +80,7 @@ Daemon::Daemon(QObject *parent)
     const QFile::Permissions strict = QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::WriteUser;
     if (!config->group("myself").hasKey("privateKeyPath"))
     {
-        const QString privateKeyPath = KStandardDirs::locateLocal("appdata", "key.pem", true, KComponentData("kdeconnect", "kdeconnect"));
+        const QString privateKeyPath = KStandardDirs::locateLocal("appdata", "key.pem", true);
         
         QFile privKey(privateKeyPath);
         
diff --git a/core/daemon.h b/core/daemon.h
index 5f2ae26..35efa33 100644
--- a/core/daemon.h
+++ b/core/daemon.h
@@ -25,7 +25,6 @@
 #include <QSet>
 #include <QMap>
 
-#include <KDEDModule>
 #include <KPluginFactory>
 #include "kdeconnectcore_export.h"
 
diff --git a/core/device.cpp b/core/device.cpp
index 29982e7..049705b 100644
--- a/core/device.cpp
+++ b/core/device.cpp
@@ -34,6 +34,8 @@
 #include <KServiceTypeTrader>
 #include <KNotification>
 #include <KIcon>
+#include <KGlobal>
+#include <KComponentData>
 
 #include "kdebugnamespace.h"
 #include "kdeconnectplugin.h"
@@ -82,7 +84,7 @@ Device::Device(QObject* parent, const NetworkPackage& identityPackage, DeviceLin
 void Device::initPrivateKey()
 {
     //TODO: It is redundant to have our own private key in every instance of Device, move this to a singleton somewhere (Daemon?)
-    const QString privateKeyPath = KStandardDirs::locateLocal("appdata", "key.pem", true, KComponentData("kdeconnect", "kdeconnect"));
+    const QString privateKeyPath = KStandardDirs::locateLocal("appdata", "key.pem", true);
     QFile privKey(privateKeyPath);
     privKey.open(QIODevice::ReadOnly);
     m_privateKey = QCA::PrivateKey::fromPEM(privKey.readAll());
@@ -353,7 +355,7 @@ void Device::privateReceivedPackage(const NetworkPackage& np)
 
                 KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
                 notification->setPixmap(KIcon("dialog-information").pixmap(48, 48));
-                notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
+                notification->setComponentName("kdeconnect");
                 notification->setTitle("KDE Connect");
                 notification->setText(i18n("Pairing request from %1", m_deviceName));
                 notification->setActions(QStringList() << i18n("Accept") << i18n("Reject"));
diff --git a/core/filetransferjob.cpp b/core/filetransferjob.cpp
index f98e95a..14d1751 100644
--- a/core/filetransferjob.cpp
+++ b/core/filetransferjob.cpp
@@ -64,17 +64,17 @@ void FileTransferJob::doStart()
     KUrl destCheck = mDestination;
     if (QFile::exists(destCheck.path())) {
         QFileInfo destInfo(destCheck.path());
-        KIO::RenameDialog *dialog = new KIO::RenameDialog(0,
+        KIO::RenameDialog *dialog = new KIO::RenameDialog(Q_NULLPTR,
             i18n("Incoming file exists"),
-            KUrl(mDeviceName + ":/" + destCheck.fileName()),
+            QUrl(mDeviceName + ":/" + destCheck.fileName()),
             destCheck,
-            KIO::M_OVERWRITE,
+            KIO::RenameDialog_Overwrite,
             mSize,
             destInfo.size(),
-            -1,
-            destInfo.created().toTime_t(),
-            -1,
-            destInfo.lastModified().toTime_t()
+            QDateTime(),
+            destInfo.created(),
+            QDateTime(),
+            destInfo.lastModified()
         );
         connect(this, SIGNAL(finished(KJob*)), dialog, SLOT(deleteLater()));
         connect(dialog, SIGNAL(finished(int)), SLOT(renameDone(int)));
diff --git a/core/filetransferjob.h b/core/filetransferjob.h
index 0969dce..a3d197f 100644
--- a/core/filetransferjob.h
+++ b/core/filetransferjob.h
@@ -58,7 +58,7 @@ private:
     QSharedPointer<QIODevice> mOrigin;
     KIO::FileJob* mDestinationJob;
     QString mDeviceName;
-    KUrl mDestination;
+    QUrl mDestination;
     QTime m_time;
     qulonglong m_speedBytes;
     int mSize;
diff --git a/core/kdebugnamespace.h b/core/kdebugnamespace.h
index 60c733d..037852d 100644
--- a/core/kdebugnamespace.h
+++ b/core/kdebugnamespace.h
@@ -22,6 +22,7 @@
 #define KDEBUG_KDECONNECT_KDED_H
 
 #include <KDebug>
+#include <kdemacros.h>
 
 KDE_EXPORT int kdeconnect_kded();
 
diff --git a/fileitemactionplugin/CMakeLists.txt b/fileitemactionplugin/CMakeLists.txt
index 3043f69..e25a722 100644
--- a/fileitemactionplugin/CMakeLists.txt
+++ b/fileitemactionplugin/CMakeLists.txt
@@ -1,6 +1,6 @@
 include_directories(${CMAKE_SOURCE_DIR})
 
-kde4_add_plugin(kdeconnectfiletiemaction sendfileitemaction.cpp)
-target_link_libraries(kdeconnectfiletiemaction ${KDE4_KIO_LIBS} kdeconnectinterfaces)
+add_library(kdeconnectfiletiemaction MODULE sendfileitemaction.cpp)
+target_link_libraries(kdeconnectfiletiemaction KF5::KIOWidgets kdeconnectinterfaces)
 install(TARGETS kdeconnectfiletiemaction DESTINATION ${PLUGIN_INSTALL_DIR})
 install(FILES kdeconnectsendfile.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/fileitemactionplugin/sendfileitemaction.cpp b/fileitemactionplugin/sendfileitemaction.cpp
index 9d04dfd..36325c9 100644
--- a/fileitemactionplugin/sendfileitemaction.cpp
+++ b/fileitemactionplugin/sendfileitemaction.cpp
@@ -36,6 +36,7 @@
 #include <KDebug>
 #include <KProcess>
 #include <KLocalizedString>
+#include <KUrl>
 
 K_PLUGIN_FACTORY(SendFileItemActionFactory, registerPlugin<SendFileItemAction>();)
 K_EXPORT_PLUGIN(SendFileItemActionFactory("SendFileItemAction", "kdeconnectfiletiemaction"))
@@ -86,3 +87,5 @@ void SendFileItemAction::sendFile()
         QDBusConnection::sessionBus().call(msg);
     }
 }
+
+#include "sendfileitemaction.moc"
diff --git a/icon/CMakeLists.txt b/icon/CMakeLists.txt
index ffc1183..095e6f4 100644
--- a/icon/CMakeLists.txt
+++ b/icon/CMakeLists.txt
@@ -1,2 +1,2 @@
 
-kde4_install_icons(${ICON_INSTALL_DIR})
\ No newline at end of file
+ecm_install_icons(${ICON_INSTALL_DIR})
\ No newline at end of file
diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt
index a708ba1..cc5f06c 100644
--- a/interfaces/CMakeLists.txt
+++ b/interfaces/CMakeLists.txt
@@ -45,14 +45,14 @@ set_source_files_properties(
     ${CMAKE_BINARY_DIR}/plugins/notifications/org.kde.kdeconnect.device.notifications.notification.xml
     PROPERTIES NO_NAMESPACE true
 )
-qt4_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/core/org.kde.kdeconnect.daemon.xml daemoninterface)
-qt4_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/core/org.kde.kdeconnect.device.xml deviceinterface)
-qt4_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/plugins/battery/org.kde.kdeconnect.device.battery.xml devicebatteryinterface )
-qt4_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/plugins/sftp/org.kde.kdeconnect.device.sftp.xml devicesftpinterface )
-qt4_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/plugins/notifications/org.kde.kdeconnect.device.notifications.xml devicenotificationsinterface )
-qt4_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/plugins/notifications/org.kde.kdeconnect.device.notifications.notification.xml notificationinterface  )
+qt5_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/core/org.kde.kdeconnect.daemon.xml daemoninterface)
+qt5_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/core/org.kde.kdeconnect.device.xml deviceinterface)
+qt5_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/plugins/battery/org.kde.kdeconnect.device.battery.xml devicebatteryinterface )
+qt5_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/plugins/sftp/org.kde.kdeconnect.device.sftp.xml devicesftpinterface )
+qt5_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/plugins/notifications/org.kde.kdeconnect.device.notifications.xml devicenotificationsinterface )
+qt5_add_dbus_interface(libkdeconnect_SRC ${CMAKE_BINARY_DIR}/plugins/notifications/org.kde.kdeconnect.device.notifications.notification.xml notificationinterface  )
 
-kde4_add_library(kdeconnectinterfaces SHARED ${libkdeconnect_SRC})
+add_library(kdeconnectinterfaces SHARED ${libkdeconnect_SRC})
 set_target_properties(kdeconnectinterfaces PROPERTIES
     VERSION ${KDECONNECT_VERSION}
     SOVERSION ${KDECONNECT_VERSION_MAJOR}
@@ -71,16 +71,18 @@ add_dependencies(kdeconnectinterfaces
 
 target_link_libraries(kdeconnectinterfaces
     ${KDE4_KDEUI_LIBS}
-    ${QT_QTCORE_LIBRARY}
-    ${QT_QTDBUS_LIBRARY}
-    ${KDE4_KDECORE_LIBS}
+    Qt5::Core
+    Qt5::DBus
+    
     ${QJSON_LIBRARIES}
 )
 
 configure_file(KDEConnectConfig.cmake.in ${CMAKE_BINARY_DIR}/interfaces/KDEConnectConfig.cmake @ONLY)
 
-macro_write_basic_cmake_version_file(${CMAKE_BINARY_DIR}/interfaces/KDEConnectConfigVersion.cmake
-        ${KDECONNECT_VERSION_MAJOR} ${KDECONNECT_VERSION_MINOR} ${KDECONNECT_VERSION_PATCH})
+ecm_setup_version( "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}" VARIABLE_PREFIX KDECONNECTINTERFACES
+                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterfaces_version.h"
+                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KDEConnectConfigVersion.cmake"
+                        SOVERSION ${KDECONNECT_VERSION_MAJOR})
         
 install(TARGETS kdeconnectinterfaces EXPORT kdeconnectLibraryTargets  ${INSTALL_TARGETS_DEFAULT_ARGS})
 
diff --git a/kcm/CMakeLists.txt b/kcm/CMakeLists.txt
index a1c1db4..92f04be 100644
--- a/kcm/CMakeLists.txt
+++ b/kcm/CMakeLists.txt
@@ -10,15 +10,15 @@ set(kcm_SRCS
     kdebugnamespace.cpp
 )
 
-kde4_add_ui_files(kcm_SRCS kcm.ui)
+qt5_wrap_ui(kcm_SRCS kcm.ui)
 
-kde4_add_plugin(kcm_kdeconnect ${kcm_SRCS})
+add_library(kcm_kdeconnect MODULE ${kcm_SRCS})
 
 target_link_libraries(kcm_kdeconnect
-    ${QT_QTCORE_LIBRARY}
-    ${QT_QTGUI_LIBRARY}
+    Qt5::Core
+    Qt5::Gui
     ${KDE4_KDEUI_LIBRARY}
-    ${KDE4_KCMUTILS_LIBS}
+    KF5::KCMUtils
     kdeconnectinterfaces
 )
 
diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp
index 78a39cf..fd5fbea 100644
--- a/kcm/kcm.cpp
+++ b/kcm/kcm.cpp
@@ -20,19 +20,21 @@
 
 #include "kcm.h"
 
-#include <QtGui/QLabel>
-#include <QtGui/QMenu>
-#include <QtGui/QMenuBar>
-#include <QtGui/QAction>
-#include <QtGui/QStackedLayout>
-#include <QtGui/QListView>
+#include <QLabel>
+#include <QMenu>
+#include <QMenuBar>
+#include <QAction>
+#include <QStackedLayout>
+#include <QListView>
 #include <QDBusConnection>
 #include <QDBusInterface>
 
 #include <KServiceTypeTrader>
 #include <KPluginInfo>
 #include <KPluginFactory>
+#include <KAboutData>
 #include <KStandardDirs>
+#include <KLocalizedString>
 
 #include "ui_kcm.h"
 #include "interfaces/dbusinterfaces.h"
@@ -44,7 +46,7 @@ K_PLUGIN_FACTORY(KdeConnectKcmFactory, registerPlugin<KdeConnectKcm>();)
 K_EXPORT_PLUGIN(KdeConnectKcmFactory("kdeconnect-kcm", "kdeconnect-kcm"))
 
 KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&)
-    : KCModule(KdeConnectKcmFactory::componentData(), parent)
+    : KCModule(KAboutData::pluginData("kdeconnect-kcm"), parent)
     , kcmUi(new Ui::KdeConnectKcmUi())
     , devicesModel(new DevicesModel(this))
     , currentDevice(0)
@@ -252,3 +254,6 @@ void KdeConnectKcm::sendPing()
     if (!currentDevice) return;
     currentDevice->sendPing();
 }
+
+#include "kcm.moc"
+#include "moc_kcm.cpp"
diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt
index 2304222..9ccd83d 100644
--- a/kded/CMakeLists.txt
+++ b/kded/CMakeLists.txt
@@ -1,11 +1,11 @@
 include_directories(${CMAKE_SOURCE_DIR})
 
-kde4_add_executable(kdeconnectd kdeconnectd.cpp)
-target_link_libraries(kdeconnectd kdeconnectcore ${KDE4_KDEUI_LIBS})
+add_executable(kdeconnectd kdeconnectd.cpp)
+target_link_libraries(kdeconnectd kdeconnectcore KF5::ConfigWidgets)
 
-kde4_add_plugin(kded_kdeconnect kded.cpp)
+add_library(kded_kdeconnect MODULE kded.cpp)
 
-target_link_libraries(kded_kdeconnect ${KDE4_KDECORE_LIBS})
+target_link_libraries(kded_kdeconnect KF5::DBusAddons KF5::KDELibs4Support)
 
 install(TARGETS kdeconnectd DESTINATION ${LIBEXEC_INSTALL_DIR})
 install(TARGETS kded_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/kded/kdeconnectd.cpp b/kded/kdeconnectd.cpp
index 65606a8..46f9e5b 100644
--- a/kded/kdeconnectd.cpp
+++ b/kded/kdeconnectd.cpp
@@ -25,7 +25,7 @@
 
 #include <QSocketNotifier>
 #include <KUniqueApplication>
-#include <KAboutData>
+#include <k4aboutdata.h>
 #include <KCmdLineArgs>
 
 #include "core/daemon.h"
@@ -59,11 +59,11 @@ void initializeTermHandlers(QCoreApplication* app, Daemon* daemon)
 
 int main(int argc, char* argv[])
 {
-    KAboutData aboutData("kdeconnect", "kdeconnect-kded",
+    K4AboutData aboutData("kdeconnect", "kdeconnect-kded",
                          ki18n("kdeconnect"),
                          "0.1",
                          ki18n("Connect your devices and KDE"),
-                         KAboutData::License_GPL,
+                         K4AboutData::License_GPL,
                          KLocalizedString(),
                          KLocalizedString(),
                          "http://albertvaka.wordpress.com");
diff --git a/kded/kded.cpp b/kded/kded.cpp
index 8159124..a08e91b 100644
--- a/kded/kded.cpp
+++ b/kded/kded.cpp
@@ -118,3 +118,5 @@ void Kded::checkIfDaemonTerminated()
     m_daemon->kill();
     kWarning(theArea) << "Daemon  killed";
 }
+
+#include "kded.moc"
diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt
index f5a202a..96a95a2 100644
--- a/kio/CMakeLists.txt
+++ b/kio/CMakeLists.txt
@@ -4,14 +4,13 @@ set(kio_kdeconnect_PART_SRCS
    kiokdeconnect.cpp
    kdebugnamespace.cpp)
 
-kde4_add_plugin(kio_kdeconnect ${kio_kdeconnect_PART_SRCS})
+add_library(kio_kdeconnect MODULE ${kio_kdeconnect_PART_SRCS})
 
 target_link_libraries(kio_kdeconnect
-    ${KDE4_KDECORE_LIBS}
-    ${KDE4_KIO_LIBRARY}
-    ${KDE4_KDEUI_LIBRARY}
-    ${QT_QTCORE_LIBRARY}
-    ${QT_QTGUI_LIBRARY}
+    KF5::KIOCore
+    KF5::KDELibs4Support
+    Qt5::Core
+    Qt5::Gui
     kdeconnectinterfaces
 )
 
diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp
index 6627126..64ba6ff 100644
--- a/kio/kiokdeconnect.cpp
+++ b/kio/kiokdeconnect.cpp
@@ -27,16 +27,17 @@
 #include <KDebug>
 #include <KComponentData>
 #include <KCmdLineArgs>
-#include <KAboutData>
 #include <KProcess>
 #include <KApplication>
 #include <KLocale>
+#include <k4aboutdata.h>
+#include <kdemacros.h>
 
 #include "kdebugnamespace.h"
 
 extern "C" int KDE_EXPORT kdemain(int argc, char **argv)
 {
-    KAboutData about("kiokdeconnect", "kdeconnect-kio", ki18n("kiokdeconnect"), "1.0");
+    K4AboutData about("kiokdeconnect", "kdeconnect-kio", ki18n("kiokdeconnect"), "1.0");
     KCmdLineArgs::init(&about);
 
     KApplication app;
@@ -182,7 +183,7 @@ void KioKdeconnect::listDevice()
 
 
 
-void KioKdeconnect::listDir(const KUrl &url)
+void KioKdeconnect::listDir(const QUrl &url)
 {
     kDebug(kdeconnect_kio()) << "Listing..." << url;
 
@@ -204,7 +205,7 @@ void KioKdeconnect::listDir(const KUrl &url)
     }
 }
 
-void KioKdeconnect::stat(const KUrl &url)
+void KioKdeconnect::stat(const QUrl &url)
 {
     kDebug(kdeconnect_kio()) << "Stat: " << url;
 
@@ -215,7 +216,7 @@ void KioKdeconnect::stat(const KUrl &url)
     finished();
 }
 
-void KioKdeconnect::get(const KUrl &url)
+void KioKdeconnect::get(const QUrl &url)
 {
     kDebug(kdeconnect_kio()) << "Get: " << url;
     mimeType("");
diff --git a/kio/kiokdeconnect.h b/kio/kiokdeconnect.h
index ae63c1f..48c7c7a 100644
--- a/kio/kiokdeconnect.h
+++ b/kio/kiokdeconnect.h
@@ -34,9 +34,9 @@ class KioKdeconnect : public QObject, public KIO::SlaveBase
 public:
     KioKdeconnect(const QByteArray &pool, const QByteArray &app);
 
-    void get(const KUrl &url);
-    void listDir(const KUrl &url);
-    void stat(const KUrl &url);
+    void get(const QUrl &url);
+    void listDir(const QUrl &url);
+    void stat(const QUrl &url);
 
     void setHost(const QString &constHostname, quint16 port, const QString &user, const QString &pass);
 
diff --git a/plasmoid/declarativeplugin/CMakeLists.txt b/plasmoid/declarativeplugin/CMakeLists.txt
index 615ee53..54c6bf0 100644
--- a/plasmoid/declarativeplugin/CMakeLists.txt
+++ b/plasmoid/declarativeplugin/CMakeLists.txt
@@ -12,15 +12,12 @@ set(kdeconnectdeclarativeplugin_MOC
   objectfactory.h
 )
 
-qt4_wrap_cpp(kdeconnectdeclarativeplugin_SRC ${kdeconnectdeclarativeplugin_MOC})    
+qt5_wrap_cpp(kdeconnectdeclarativeplugin_SRC ${kdeconnectdeclarativeplugin_MOC})    
 
-kde4_add_library(kdeconnectdeclarativeplugin SHARED ${kdeconnectdeclarativeplugin_SRC})
+add_library(kdeconnectdeclarativeplugin SHARED ${kdeconnectdeclarativeplugin_SRC})
 target_link_libraries(kdeconnectdeclarativeplugin
-    ${KDE4_KDEUI_LIBS}
-    ${KDE4_KDECORE_LIBS}
-    ${QT_QTCORE_LIBRARY}
-    ${QT_QTGUI_LIBRARY}
-    ${QT_QTDECLARATIVE_LIBRARY}
+    Qt5::Qml
+    Qt5::Gui
     kdeconnectinterfaces
 )
 install(TARGETS kdeconnectdeclarativeplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/kdeconnect)
diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
index 0fa00b7..9ea7f16 100644
--- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
+++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp
@@ -20,11 +20,11 @@
 
 #include "kdeconnectdeclarativeplugin.h"
 
-#include <QtDeclarative/QDeclarativeItem>
-#include <QtDeclarative/QDeclarativeEngine>
-#include <QtDeclarative/QDeclarativeContext>
+#include <QQmlEngine>
+#include <QQmlContext>
 #include <QDBusPendingCall>
 #include <QDBusPendingReply>
+#include <QtQml>
 
 #include "objectfactory.h"
 #include "responsewaiter.h"
@@ -32,8 +32,6 @@
 #include "interfaces/devicesmodel.h"
 #include "interfaces/notificationsmodel.h"
 
-Q_EXPORT_PLUGIN2(kdeconnectdeclarativeplugin, KdeConnectDeclarativePlugin)
-
 QObject* createDeviceDbusInterface(QVariant deviceId)
 {
     return new DeviceDbusInterface(deviceId.toString());
@@ -63,9 +61,9 @@ void KdeConnectDeclarativePlugin::registerTypes(const char* uri)
     qmlRegisterType<DBusAsyncResponse>("org.kde.kdeconnect", 1, 0, "DBusAsyncResponse");
 }
 
-void KdeConnectDeclarativePlugin::initializeEngine(QDeclarativeEngine* engine, const char* uri)
+void KdeConnectDeclarativePlugin::initializeEngine(QQmlEngine* engine, const char* uri)
 {
-    QDeclarativeExtensionPlugin::initializeEngine(engine, uri);
+    QQmlExtensionPlugin::initializeEngine(engine, uri);
  
     engine->rootContext()->setContextProperty("DeviceDbusInterfaceFactory"
       , new ObjectFactory(engine, createDeviceDbusInterface));
diff --git a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h
index 6324b7a..8c9ecd2 100644
--- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h
+++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h
@@ -21,12 +21,16 @@
 #ifndef ANALITZADECLARATIVEPLUGIN_H
 #define ANALITZADECLARATIVEPLUGIN_H
 
-#include <QDeclarativeExtensionPlugin>
+#include <QQmlExtensionPlugin>
 
-class KdeConnectDeclarativePlugin : public QDeclarativeExtensionPlugin
+class KdeConnectDeclarativePlugin : public QQmlExtensionPlugin
 {
+    Q_OBJECT
+
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
+
     virtual void registerTypes(const char* uri);
-    virtual void initializeEngine(QDeclarativeEngine *engine, const char *uri);
+    virtual void initializeEngine(QQmlEngine *engine, const char *uri);
 };
 
 
diff --git a/plasmoid/declarativeplugin/responsewaiter.h b/plasmoid/declarativeplugin/responsewaiter.h
index 3d2a63d..a2aec19 100644
--- a/plasmoid/declarativeplugin/responsewaiter.h
+++ b/plasmoid/declarativeplugin/responsewaiter.h
@@ -6,8 +6,6 @@
 #include <QVariant>
 #include <QTimer>
 
-#include <QDeclarativeEngine>
-
 class QDBusPendingCall;
 class QDBusPendingCallWatcher;
 
diff --git a/plugins/battery/CMakeLists.txt b/plugins/battery/CMakeLists.txt
index b6da5cb..2448463 100644
--- a/plugins/battery/CMakeLists.txt
+++ b/plugins/battery/CMakeLists.txt
@@ -3,7 +3,7 @@ set(kdeconnect_battery_SRCS
     batterydbusinterface.cpp
 )
 
-kde4_add_plugin(kdeconnect_battery ${kdeconnect_battery_SRCS})
+add_library(kdeconnect_battery MODULE ${kdeconnect_battery_SRCS})
 
 target_link_libraries(kdeconnect_battery kdeconnectcore ${KDE4_KDEUI_LIBS})
 
diff --git a/plugins/battery/batteryplugin.cpp b/plugins/battery/batteryplugin.cpp
index af3e47a..ec62c00 100644
--- a/plugins/battery/batteryplugin.cpp
+++ b/plugins/battery/batteryplugin.cpp
@@ -73,7 +73,7 @@ bool BatteryPlugin::receivePackage(const NetworkPackage& np)
     if ( thresholdEvent == ThresholdBatteryLow && !isCharging ) {
         KNotification* notification = new KNotification("batteryLow");
         notification->setPixmap(KIcon("battery-040").pixmap(48, 48));
-        notification->setComponentData(KComponentData("kdeconnect", "kdeconnect-kded"));
+        notification->setComponentName("kdeconnect");
         notification->setTitle(i18nc("device name: low battery", "%1: low battery", device()->name()));
         notification->setText(i18n("Battery at %1%", currentCharge));
         notification->sendEvent();
@@ -83,3 +83,4 @@ bool BatteryPlugin::receivePackage(const NetworkPackage& np)
 
 }
 
+#include "batteryplugin.moc"
diff --git a/plugins/clipboard/CMakeLists.txt b/plugins/clipboard/CMakeLists.txt
index b6624a0..cf7bfa4 100644
--- a/plugins/clipboard/CMakeLists.txt
+++ b/plugins/clipboard/CMakeLists.txt
@@ -2,9 +2,9 @@ set(kdeconnect_clipboard_SRCS
     clipboardplugin.cpp
 )
 
-kde4_add_plugin(kdeconnect_clipboard ${kdeconnect_clipboard_SRCS})
+add_library(kdeconnect_clipboard MODULE ${kdeconnect_clipboard_SRCS})
 
-target_link_libraries(kdeconnect_clipboard kdeconnectcore ${QT_QTGUI_LIBRARY})
+target_link_libraries(kdeconnect_clipboard kdeconnectcore Qt5::Gui)
 
 install(TARGETS kdeconnect_clipboard DESTINATION ${PLUGIN_INSTALL_DIR} )
 install(FILES kdeconnect_clipboard.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/plugins/clipboard/clipboardplugin.cpp b/plugins/clipboard/clipboardplugin.cpp
index bb31bb5..eba3421 100644
--- a/plugins/clipboard/clipboardplugin.cpp
+++ b/plugins/clipboard/clipboardplugin.cpp
@@ -54,3 +54,5 @@ bool ClipboardPlugin::receivePackage(const NetworkPackage& np)
     clipboard->setText(np.get<QString>("content"));
     return true;
 }
+
+#include "clipboardplugin.moc"
diff --git a/plugins/mpriscontrol/CMakeLists.txt b/plugins/mpriscontrol/CMakeLists.txt
index d5332fa..e7a7b25 100644
--- a/plugins/mpriscontrol/CMakeLists.txt
+++ b/plugins/mpriscontrol/CMakeLists.txt
@@ -2,19 +2,19 @@ set(kdeconnect_mpriscontrol_SRCS
     mpriscontrolplugin.cpp
 )
 
-qt4_add_dbus_interface(
+qt5_add_dbus_interface(
    kdeconnect_mpriscontrol_SRCS
    mprisdbusinterface.xml
    mprisdbusinterface
 )
 
-qt4_add_dbus_interface(
+qt5_add_dbus_interface(
    kdeconnect_mpriscontrol_SRCS
    propertiesInterface.xml
    propertiesdbusinterface
 )
 
-kde4_add_plugin(kdeconnect_mpriscontrol ${kdeconnect_mpriscontrol_SRCS})
+add_library(kdeconnect_mpriscontrol MODULE ${kdeconnect_mpriscontrol_SRCS})
 
 target_link_libraries(kdeconnect_mpriscontrol kdeconnectcore)
 
diff --git a/plugins/mpriscontrol/mpriscontrolplugin.cpp b/plugins/mpriscontrol/mpriscontrolplugin.cpp
index 30a78c6..ff7c286 100644
--- a/plugins/mpriscontrol/mpriscontrolplugin.cpp
+++ b/plugins/mpriscontrol/mpriscontrolplugin.cpp
@@ -215,3 +215,5 @@ void MprisControlPlugin::sendPlayerList()
     np.set("playerList",playerList.keys());
     sendPackage(np);
 }
+
+#include "mpriscontrolplugin.moc"
diff --git a/plugins/mpriscontrol/propertiesInterface.xml b/plugins/mpriscontrol/propertiesInterface.xml
index 5118061..516177f 100644
--- a/plugins/mpriscontrol/propertiesInterface.xml
+++ b/plugins/mpriscontrol/propertiesInterface.xml
@@ -8,6 +8,11 @@
       <arg type="s" name="property_name" direction="in"/>
       <arg type="v" name="value" direction="out"/>
     </method>
+    <method name="GetAll">
+      <arg type="s" name="interface_name" direction="in"/>
+      <arg type="a{sv}" name="properties" direction="out"/>
+      <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
+    </method>
     <method name="Set">
       <arg type="s" name="interface_name" direction="in"/>
       <arg type="s" name="property_name" direction="in"/>
@@ -15,11 +20,9 @@
     </method>
     <signal name="PropertiesChanged">
       <arg type="s" name="interface_name"/>
-      <arg type="a{sv}" name="changed_properties">
-          <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="QVariantMap" />
-          <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap" />
-      </arg>
+      <arg type="a{sv}" name="changed_properties"/>
       <arg type="as" name="invalidated_properties"/>
+      <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
     </signal>
   </interface>
 </node>
diff --git a/plugins/notifications/CMakeLists.txt b/plugins/notifications/CMakeLists.txt
index cc6dd97..9553648 100644
--- a/plugins/notifications/CMakeLists.txt
+++ b/plugins/notifications/CMakeLists.txt
@@ -4,7 +4,7 @@ set(kdeconnect_notifications_SRCS
     notificationsdbusinterface.cpp
 )
 
-kde4_add_plugin(kdeconnect_notifications ${kdeconnect_notifications_SRCS})
+add_library(kdeconnect_notifications MODULE ${kdeconnect_notifications_SRCS})
 
 target_link_libraries(kdeconnect_notifications kdeconnectcore ${KDE4_KDEUI_LIBS})
 
diff --git a/plugins/notifications/notificationsdbusinterface.cpp b/plugins/notifications/notificationsdbusinterface.cpp
index 75172b2..b0a3dce 100644
--- a/plugins/notifications/notificationsdbusinterface.cpp
+++ b/plugins/notifications/notificationsdbusinterface.cpp
@@ -74,7 +74,7 @@ void NotificationsDbusInterface::processPackage(const NetworkPackage& np)
         if (!mInternalIdToPublicId.contains(noti->internalId()) && !np.get<bool>("requestAnswer", false)) {
             KNotification* notification = new KNotification("notification", KNotification::CloseOnTimeout, this);
             notification->setPixmap(KIcon("preferences-desktop-notification").pixmap(48, 48));
-            notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
+            notification->setComponentName("kdeconnect");
             notification->setTitle(mDevice->name());
             notification->setText(noti->appName() + ": " + noti->ticker());
             notification->sendEvent();
@@ -149,3 +149,5 @@ QString NotificationsDbusInterface::newId()
     return QString::number(++mLastId);
 }
 
+
+#include "notificationsdbusinterface.moc"
diff --git a/plugins/notifications/notificationsplugin.cpp b/plugins/notifications/notificationsplugin.cpp
index 67fa825..2b7247b 100644
--- a/plugins/notifications/notificationsplugin.cpp
+++ b/plugins/notifications/notificationsplugin.cpp
@@ -62,4 +62,4 @@ bool NotificationsPlugin::receivePackage(const NetworkPackage& np)
     return true;
 }
 
-   
+#include "notificationsplugin.moc"
diff --git a/plugins/pausemusic/CMakeLists.txt b/plugins/pausemusic/CMakeLists.txt
index 337e952..4bdb6ba 100644
--- a/plugins/pausemusic/CMakeLists.txt
+++ b/plugins/pausemusic/CMakeLists.txt
@@ -2,7 +2,7 @@ set(kdeconnect_pausemusic_SRCS
     pausemusicplugin.cpp
 )
 
-kde4_add_plugin(kdeconnect_pausemusic ${kdeconnect_pausemusic_SRCS})
+add_library(kdeconnect_pausemusic MODULE ${kdeconnect_pausemusic_SRCS})
 
 target_link_libraries(kdeconnect_pausemusic
     kdeconnectcore
@@ -16,11 +16,11 @@ install(FILES kdeconnect_pausemusic.desktop DESTINATION ${SERVICES_INSTALL_DIR}
 # Config
 
 set( kdeconnect_pausemusic_config_SRCS pausemusic_config.cpp )
-kde4_add_ui_files( kdeconnect_pausemusic_config_SRCS pausemusic_config.ui )
+qt5_wrap_ui( kdeconnect_pausemusic_config_SRCS pausemusic_config.ui )
 
-kde4_add_plugin( kdeconnect_pausemusic_config ${kdeconnect_pausemusic_config_SRCS} )
+add_library(kdeconnect_pausemusic_config MODULE ${kdeconnect_pausemusic_config_SRCS} )
 target_link_libraries( kdeconnect_pausemusic_config
-    ${KDE4_KDECORE_LIBS}
+    
     ${KDE4_KDEUI_LIBS}
 )
 
diff --git a/plugins/pausemusic/pausemusic_config.cpp b/plugins/pausemusic/pausemusic_config.cpp
index 7833c21..aed6b46 100644
--- a/plugins/pausemusic/pausemusic_config.cpp
+++ b/plugins/pausemusic/pausemusic_config.cpp
@@ -23,6 +23,7 @@
 #include <KPluginFactory>
 #include <KSharedConfig>
 #include <KConfigGroup>
+#include <KAboutData>
 
 #include <core/kdebugnamespace.h>
 
@@ -32,7 +33,7 @@ K_PLUGIN_FACTORY(PauseMusicConfigFactory, registerPlugin<PauseMusicConfig>();)
 K_EXPORT_PLUGIN(PauseMusicConfigFactory("kdeconnect_pausemusic_config", "kdeconnect-kded"))
 
 PauseMusicConfig::PauseMusicConfig(QWidget *parent, const QVariantList& )
-    : KCModule(PauseMusicConfigFactory::componentData(), parent)
+    : KCModule(KAboutData::pluginData("kdeconnect_pausemusic_config"), parent)
     , m_ui(new Ui::PauseMusicConfigUi())
     , m_cfg(KSharedConfig::openConfig("kdeconnect/plugins/pausemusic"))
 {
@@ -79,3 +80,4 @@ void PauseMusicConfig::save()
     Q_EMIT changed(false);
 }
 
+#include "pausemusic_config.moc"
diff --git a/plugins/pausemusic/pausemusicplugin.cpp b/plugins/pausemusic/pausemusicplugin.cpp
index a89bd6f..46a1627 100644
--- a/plugins/pausemusic/pausemusicplugin.cpp
+++ b/plugins/pausemusic/pausemusicplugin.cpp
@@ -134,3 +134,5 @@ bool PauseMusicPlugin::receivePackage(const NetworkPackage& np)
     return true;
 
 }
+
+#include "pausemusicplugin.moc"
diff --git a/plugins/ping/CMakeLists.txt b/plugins/ping/CMakeLists.txt
index 0f6f0ac..506e587 100644
--- a/plugins/ping/CMakeLists.txt
+++ b/plugins/ping/CMakeLists.txt
@@ -2,7 +2,7 @@ set(kdeconnect_ping_SRCS
     pingplugin.cpp
 )
 
-kde4_add_plugin(kdeconnect_ping ${kdeconnect_ping_SRCS})
+add_library(kdeconnect_ping MODULE ${kdeconnect_ping_SRCS})
 
 target_link_libraries(kdeconnect_ping kdeconnectcore ${KDE4_KDEUI_LIBS})
 
diff --git a/plugins/ping/pingplugin.cpp b/plugins/ping/pingplugin.cpp
index 11826e2..f2de9f5 100644
--- a/plugins/ping/pingplugin.cpp
+++ b/plugins/ping/pingplugin.cpp
@@ -45,7 +45,7 @@ bool PingPlugin::receivePackage(const NetworkPackage& np)
 {
     KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
     notification->setPixmap(KIcon("dialog-ok").pixmap(48, 48));
-    notification->setComponentData(KComponentData("kdeconnect", "kdeconnect-kded"));
+    notification->setComponentName("kdeconnect");
     notification->setTitle(device()->name());
     notification->setText(np.get<QString>("message",i18n("Ping!"))); //This can be a source of spam
     notification->sendEvent();
@@ -53,3 +53,5 @@ bool PingPlugin::receivePackage(const NetworkPackage& np)
     return true;
 
 }
+
+#include "pingplugin.moc"
diff --git a/plugins/sftp/CMakeLists.txt b/plugins/sftp/CMakeLists.txt
index 500067e..7f6588a 100644
--- a/plugins/sftp/CMakeLists.txt
+++ b/plugins/sftp/CMakeLists.txt
@@ -4,7 +4,7 @@ set(kdeconnect_sftp_SRCS
     sftpplugin.cpp
 )
 
-kde4_add_plugin(kdeconnect_sftp ${kdeconnect_sftp_SRCS})
+add_library(kdeconnect_sftp MODULE ${kdeconnect_sftp_SRCS})
 
 target_link_libraries(kdeconnect_sftp kdeconnectcore ${KDE4_KFILE_LIBS})
 
@@ -24,13 +24,13 @@ generate_and_install_dbus_interface(
 # Config
 
 set( kdeconnect_sftp_config_SRCS sftp_config.cpp )
-kde4_add_ui_files( kdeconnect_sftp_config_SRCS sftp_config.ui )
+qt5_wrap_ui( kdeconnect_sftp_config_SRCS sftp_config.ui )
 
-kde4_add_plugin( kdeconnect_sftp_config ${kdeconnect_sftp_config_SRCS} )
+add_library(kdeconnect_sftp_config MODULE ${kdeconnect_sftp_config_SRCS} )
 target_link_libraries( kdeconnect_sftp_config
-    ${KDE4_KDECORE_LIBS}
+    
     ${KDE4_KDEUI_LIBS}
-    ${KDE4_KIO_LIBS}
+    KF5::KIOWidgets
 )
 
 install(TARGETS kdeconnect_sftp_config DESTINATION ${PLUGIN_INSTALL_DIR} )
diff --git a/plugins/sftp/sftp_config.cpp b/plugins/sftp/sftp_config.cpp
index 119fe5b..3eaea2e 100644
--- a/plugins/sftp/sftp_config.cpp
+++ b/plugins/sftp/sftp_config.cpp
@@ -25,6 +25,8 @@
 #include <KPluginFactory>
 #include <KSharedConfig>
 #include <KStandardDirs>
+#include <KAboutData>
+#include <KIconLoader>
 
 #include "sftpplugin.h"
 #include <core/kdebugnamespace.h>
@@ -35,7 +37,7 @@ K_PLUGIN_FACTORY(SftpConfigFactory, registerPlugin<SftpConfig>();)
 K_EXPORT_PLUGIN(SftpConfigFactory("kdeconnect_sftp_config", "kdeconnect-kded"))
 
 SftpConfig::SftpConfig(QWidget *parent, const QVariantList& )
-    : KCModule(SftpConfigFactory::componentData(), parent)
+    : KCModule(KAboutData::pluginData("kdeconnect_sftp_config"), parent)
     , m_ui(new Ui::SftpConfigUi())
     , m_cfg(SftpConfig::config())
 {
@@ -93,4 +95,4 @@ void SftpConfig::save()
     Q_EMIT changed(false);
 }
 
-
+#include "sftp_config.moc"
diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp
index 716b525..db3eebe 100644
--- a/plugins/sftp/sftpplugin.cpp
+++ b/plugins/sftp/sftpplugin.cpp
@@ -154,7 +154,7 @@ bool SftpPlugin::receivePackage(const NetworkPackage& np)
 
 QString SftpPlugin::mountPoint()
 {
-    const QString mountDir = KStandardDirs::locateLocal("appdata", "", true, KComponentData("kdeconnect", "kdeconnect"));
+    const QString mountDir = KStandardDirs::locateLocal("appdata", "", true);
     return QDir(mountDir).absoluteFilePath(device()->id());
 }
 
@@ -197,3 +197,4 @@ void SftpPlugin::knotify(int type, const QString& text, const QPixmap& icon) con
       , KNotification::CloseOnTimeout);
 }
 
+#include "sftpplugin.moc"
diff --git a/plugins/share/CMakeLists.txt b/plugins/share/CMakeLists.txt
index ab91134..b919433 100644
--- a/plugins/share/CMakeLists.txt
+++ b/plugins/share/CMakeLists.txt
@@ -3,9 +3,9 @@ set(kdeconnect_share_SRCS
     autoclosingqfile.cpp
 )
 
-kde4_add_plugin(kdeconnect_share ${kdeconnect_share_SRCS})
+add_library(kdeconnect_share MODULE ${kdeconnect_share_SRCS})
 
-target_link_libraries(kdeconnect_share kdeconnectcore ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS})
+target_link_libraries(kdeconnect_share kdeconnectcore ${KDE4_KFILE_LIBS} KF5::KIOWidgets)
 
 install(TARGETS kdeconnect_share DESTINATION ${PLUGIN_INSTALL_DIR} )
 install(FILES kdeconnect_share.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
@@ -15,13 +15,13 @@ install(FILES kdeconnect_share.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
 # Config
 
 set( kdeconnect_share_config_SRCS share_config.cpp )
-kde4_add_ui_files( kdeconnect_share_config_SRCS share_config.ui )
+qt5_wrap_ui( kdeconnect_share_config_SRCS share_config.ui )
 
-kde4_add_plugin( kdeconnect_share_config ${kdeconnect_share_config_SRCS} )
+add_library(kdeconnect_share_config MODULE ${kdeconnect_share_config_SRCS} )
 target_link_libraries( kdeconnect_share_config
-    ${KDE4_KDECORE_LIBS}
+    
     ${KDE4_KDEUI_LIBS}
-    ${KDE4_KIO_LIBS}
+    KF5::KIOWidgets
 )
 
 install(TARGETS kdeconnect_share_config DESTINATION ${PLUGIN_INSTALL_DIR} )
diff --git a/plugins/share/share_config.cpp b/plugins/share/share_config.cpp
index 805f277..3805fc9 100644
--- a/plugins/share/share_config.cpp
+++ b/plugins/share/share_config.cpp
@@ -25,6 +25,7 @@
 #include <KPluginFactory>
 #include <KSharedConfig>
 #include <KUrlRequester>
+#include <KAboutData>
 
 #include <core/kdebugnamespace.h>
 
@@ -34,7 +35,7 @@ K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<ShareConfig>();)
 K_EXPORT_PLUGIN(ShareConfigFactory("kdeconnect_share_config", "kdeconnect_share_config"))
 
 ShareConfig::ShareConfig(QWidget *parent, const QVariantList& )
-    : KCModule(ShareConfigFactory::componentData(), parent)
+    : KCModule(KAboutData::pluginData("kdeconnect_share_config"), parent)
     , m_ui(new Ui::ShareConfigUi())
     , m_cfg(KSharedConfig::openConfig("kdeconnect/plugins/share"))
 {
@@ -77,3 +78,4 @@ void ShareConfig::save()
     Q_EMIT changed(false);
 }
 
+#include "share_config.moc"
diff --git a/plugins/share/shareplugin.cpp b/plugins/share/shareplugin.cpp
index 8af0ae1..2f09ad2 100644
--- a/plugins/share/shareplugin.cpp
+++ b/plugins/share/shareplugin.cpp
@@ -131,7 +131,7 @@ void SharePlugin::finished(KJob* job)
     FileTransferJob* transferJob = (FileTransferJob*)job;
     KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
     notification->setPixmap(KIcon(error? "edit-delete" : "dialog-ok").pixmap(48, 48));
-    notification->setComponentData(KComponentData("kdeconnect", "kdeconnect-kded"));
+    notification->setComponentName("kdeconnect");
     notification->setTitle(i18n("Transfer finished"));
     notification->setText(transferJob->destination().fileName());
     notification->setActions(QStringList(i18n("Open destination folder")));
@@ -166,3 +166,5 @@ QString SharePlugin::dbusPath() const
 {
     return "/modules/kdeconnect/devices/" + device()->id() + "/share";
 }
+
+#include "shareplugin.moc"
diff --git a/plugins/telephony/CMakeLists.txt b/plugins/telephony/CMakeLists.txt
index 01b2f9a..c26bd40 100644
--- a/plugins/telephony/CMakeLists.txt
+++ b/plugins/telephony/CMakeLists.txt
@@ -2,7 +2,7 @@ set(kdeconnect_telephony_SRCS
     telephonyplugin.cpp
 )
 
-kde4_add_plugin(kdeconnect_telephony ${kdeconnect_telephony_SRCS})
+add_library(kdeconnect_telephony MODULE ${kdeconnect_telephony_SRCS})
 
 target_link_libraries(kdeconnect_telephony kdeconnectcore ${KDE4_KDEUI_LIBS})
 
diff --git a/plugins/telephony/telephonyplugin.cpp b/plugins/telephony/telephonyplugin.cpp
index 6b9378f..b3484e4 100644
--- a/plugins/telephony/telephonyplugin.cpp
+++ b/plugins/telephony/telephonyplugin.cpp
@@ -70,7 +70,7 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
 
     KNotification* notification = new KNotification(type, KNotification::CloseOnTimeout, this); //, KNotification::Persistent
     notification->setPixmap(KIcon(icon).pixmap(48, 48));
-    notification->setComponentData(KComponentData("kdeconnect", "kdeconnect-kded"));
+    notification->setComponentName("kdeconnect");
     notification->setTitle(title);
     notification->setText(content);
 
@@ -96,3 +96,5 @@ bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
     return true;
 
 }
+
+#include "telephonyplugin.moc"
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 51ad49d..711fbb0 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -7,20 +7,13 @@ include_directories(
 )
 
 set(kdeconnect_libraries
-    ${KDE4_KDECORE_LIBS}
-    ${KDE4_KDEUI_LIBS}
-	${KDE4_KIO_LIBS}
-    ${QT_QTNETWORK_LIBRARY}
+    KF5::KIOWidgets
+    Qt5::Network
     ${QJSON_LIBRARIES}
     ${QCA2_LIBRARIES}
-    ${QT_QTTEST_LIBRARY}
+    Qt5::Test
     kdeconnectcore
 )
 
-#NetworkPackage
-kde4_add_unit_test(kdeconnect_tests networkpackagetests.cpp)
-target_link_libraries(kdeconnect_tests ${kdeconnect_libraries})
-
-#Socketlinereader
-kde4_add_unit_test(testsocketlinereader testsocketlinereader.cpp ../core/backends/lan/socketlinereader.cpp)
-target_link_libraries(testsocketlinereader ${kdeconnect_libraries})
+ecm_add_test(networkpackagetests.cpp LINK_LIBRARIES ${kdeconnect_libraries})
+ecm_add_test(testsocketlinereader.cpp ../core/backends/lan/socketlinereader.cpp TEST_NAME testsocketlinereader LINK_LIBRARIES ${kdeconnect_libraries})


More information about the KDEConnect mailing list