From a1a560c4695a67ef7bca94c46a54aadb7289f081 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 16 Jun 2014 20:02:07 +0200 Subject: [PATCH] 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@kde.org --- CMakeLists.txt | 22 +++++---- cli/CMakeLists.txt | 2 +- cli/kdeconnect-cli.cpp | 5 +- cmake/FindQCA2.cmake | 48 +++++++++++++++++++ cmake/macros.cmake | 18 ++++--- core/CMakeLists.txt | 10 ++-- core/daemon.cpp | 2 +- core/daemon.h | 1 - core/device.cpp | 6 ++- core/filetransferjob.cpp | 14 +++--- core/filetransferjob.h | 2 +- core/kdebugnamespace.h | 1 + fileitemactionplugin/CMakeLists.txt | 4 +- fileitemactionplugin/sendfileitemaction.cpp | 3 ++ icon/CMakeLists.txt | 2 +- interfaces/CMakeLists.txt | 26 +++++----- kcm/CMakeLists.txt | 10 ++-- kcm/kcm.cpp | 19 +++++--- kded/CMakeLists.txt | 8 ++-- kded/kdeconnectd.cpp | 6 +-- kded/kded.cpp | 2 + kio/CMakeLists.txt | 11 ++--- kio/kiokdeconnect.cpp | 11 +++-- kio/kiokdeconnect.h | 6 +-- plasmoid/declarativeplugin/CMakeLists.txt | 11 ++--- .../kdeconnectdeclarativeplugin.cpp | 12 ++--- .../kdeconnectdeclarativeplugin.h | 10 ++-- plasmoid/declarativeplugin/responsewaiter.h | 2 - plugins/battery/CMakeLists.txt | 2 +- plugins/battery/batteryplugin.cpp | 3 +- plugins/clipboard/CMakeLists.txt | 4 +- plugins/clipboard/clipboardplugin.cpp | 2 + plugins/mpriscontrol/CMakeLists.txt | 6 +-- plugins/mpriscontrol/mpriscontrolplugin.cpp | 2 + plugins/mpriscontrol/propertiesInterface.xml | 11 +++-- plugins/notifications/CMakeLists.txt | 2 +- .../notificationsdbusinterface.cpp | 4 +- plugins/notifications/notificationsplugin.cpp | 2 +- plugins/pausemusic/CMakeLists.txt | 8 ++-- plugins/pausemusic/pausemusic_config.cpp | 4 +- plugins/pausemusic/pausemusicplugin.cpp | 2 + plugins/ping/CMakeLists.txt | 2 +- plugins/ping/pingplugin.cpp | 4 +- plugins/sftp/CMakeLists.txt | 10 ++-- plugins/sftp/sftp_config.cpp | 6 ++- plugins/sftp/sftpplugin.cpp | 3 +- plugins/share/CMakeLists.txt | 12 ++--- plugins/share/share_config.cpp | 4 +- plugins/share/shareplugin.cpp | 4 +- plugins/telephony/CMakeLists.txt | 2 +- plugins/telephony/telephonyplugin.cpp | 4 +- tests/CMakeLists.txt | 17 ++----- 52 files changed, 237 insertions(+), 157 deletions(-) create mode 100644 cmake/FindQCA2.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b916d929..3aa3c9f74 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 0eb84026b..1c368a1b1 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 3366e7d18..dcb7b827a 100644 --- a/cli/kdeconnect-cli.cpp +++ b/cli/kdeconnect-cli.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -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@kde.org" ); KCmdLineArgs::init(argc, argv, &about); KCmdLineOptions options; diff --git a/cmake/FindQCA2.cmake b/cmake/FindQCA2.cmake new file mode 100644 index 000000000..e2d8f2a5e --- /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, +# +# 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 9d4810d95..85a1a75ba 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 e722ebab5..da0fb0cb1 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 4243ea9f7..9b4673359 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 5f2ae2624..35efa33e6 100644 --- a/core/daemon.h +++ b/core/daemon.h @@ -25,7 +25,6 @@ #include #include -#include #include #include "kdeconnectcore_export.h" diff --git a/core/device.cpp b/core/device.cpp index 29982e70a..049705bd3 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include #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 f98e95a2d..14d175179 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 0969dce0e..a3d197f67 100644 --- a/core/filetransferjob.h +++ b/core/filetransferjob.h @@ -58,7 +58,7 @@ private: QSharedPointer 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 60c733dab..037852d13 100644 --- a/core/kdebugnamespace.h +++ b/core/kdebugnamespace.h @@ -22,6 +22,7 @@ #define KDEBUG_KDECONNECT_KDED_H #include +#include KDE_EXPORT int kdeconnect_kded(); diff --git a/fileitemactionplugin/CMakeLists.txt b/fileitemactionplugin/CMakeLists.txt index 3043f6954..e25a72222 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 9d04dfd9c..36325c99e 100644 --- a/fileitemactionplugin/sendfileitemaction.cpp +++ b/fileitemactionplugin/sendfileitemaction.cpp @@ -36,6 +36,7 @@ #include #include #include +#include K_PLUGIN_FACTORY(SendFileItemActionFactory, registerPlugin();) 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 ffc1183c1..095e6f425 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 a708ba1ab..cc5f06c4e 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 a1c1db4a7..92f04bea9 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 78a39cf93..fd5fbeaa7 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -20,19 +20,21 @@ #include "kcm.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include +#include #include +#include #include "ui_kcm.h" #include "interfaces/dbusinterfaces.h" @@ -44,7 +46,7 @@ K_PLUGIN_FACTORY(KdeConnectKcmFactory, registerPlugin();) 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 23042227b..9ccd83dd0 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 65606a893..46f9e5b81 100644 --- a/kded/kdeconnectd.cpp +++ b/kded/kdeconnectd.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #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 8159124ce..a08e91b46 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 f5a202ab8..96a95a2bc 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 662712664..64ba6ffc7 100644 --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -27,16 +27,17 @@ #include #include #include -#include #include #include #include +#include +#include #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 ae63c1fb6..48c7c7ab7 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 615ee533c..54c6bf06e 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 0fa00b7b7..9ea7f16f7 100644 --- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp +++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.cpp @@ -20,11 +20,11 @@ #include "kdeconnectdeclarativeplugin.h" -#include -#include -#include +#include +#include #include #include +#include #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("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 6324b7aba..8c9ecd288 100644 --- a/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h +++ b/plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h @@ -21,12 +21,16 @@ #ifndef ANALITZADECLARATIVEPLUGIN_H #define ANALITZADECLARATIVEPLUGIN_H -#include +#include -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 3d2a63dd2..a2aec1994 100644 --- a/plasmoid/declarativeplugin/responsewaiter.h +++ b/plasmoid/declarativeplugin/responsewaiter.h @@ -6,8 +6,6 @@ #include #include -#include - class QDBusPendingCall; class QDBusPendingCallWatcher; diff --git a/plugins/battery/CMakeLists.txt b/plugins/battery/CMakeLists.txt index b6da5cbb6..2448463eb 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 af3e47aaf..ec62c003a 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 b6624a03c..cf7bfa420 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 bb31bb546..eba3421c3 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("content")); return true; } + +#include "clipboardplugin.moc" diff --git a/plugins/mpriscontrol/CMakeLists.txt b/plugins/mpriscontrol/CMakeLists.txt index d5332fab6..e7a7b2582 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 30a78c65e..ff7c286b0 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 511806154..516177f49 100644 --- a/plugins/mpriscontrol/propertiesInterface.xml +++ b/plugins/mpriscontrol/propertiesInterface.xml @@ -8,6 +8,11 @@ + + + + + @@ -15,11 +20,9 @@ - - - - + + diff --git a/plugins/notifications/CMakeLists.txt b/plugins/notifications/CMakeLists.txt index cc6dd97d7..9553648b4 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 75172b20f..b0a3dce22 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("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 67fa82530..2b7247bf6 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 337e95246..4bdb6ba37 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 7833c2107..aed6b460a 100644 --- a/plugins/pausemusic/pausemusic_config.cpp +++ b/plugins/pausemusic/pausemusic_config.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -32,7 +33,7 @@ K_PLUGIN_FACTORY(PauseMusicConfigFactory, registerPlugin();) 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 a89bd6fe3..46a162764 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 0f6f0ac3e..506e58722 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 11826e233..f2de9f501 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("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 500067e2f..7f6588abd 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 119fe5b5d..3eaea2e27 100644 --- a/plugins/sftp/sftp_config.cpp +++ b/plugins/sftp/sftp_config.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include "sftpplugin.h" #include @@ -35,7 +37,7 @@ K_PLUGIN_FACTORY(SftpConfigFactory, registerPlugin();) 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 716b52571..db3eebe92 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 ab91134c4..b9194337f 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 805f27702..3805fc9f0 100644 --- a/plugins/share/share_config.cpp +++ b/plugins/share/share_config.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -34,7 +35,7 @@ K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin();) 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 8af0ae1f8..2f09ad254 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 01b2f9a86..c26bd404b 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 6b9378f22..b3484e47b 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 51ad49d48..711fbb088 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})