diff --git a/CMakeLists.txt b/CMakeLists.txt index ed3c4f13b..342a3f43e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ else() find_package(Qca-qt${QT_MAJOR_VERSION} ${QCA_MIN_VERSION} REQUIRED) set(Qca_LIBRARY qca-qt${QT_MAJOR_VERSION}) - set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem GuiAddons) + set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem GuiAddons DNSSD) set(KF5_OPTIONAL_COMPONENTS DocTools) set_package_properties(KF5Kirigami2 PROPERTIES diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 919a1ec23..14415aa5d 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -18,11 +18,6 @@ configure_file(dbushelper.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbushelper.h) add_subdirectory(backends/lan) add_subdirectory(backends/loopback) -option(MDNS_ENABLED "Use MDNS for device discovery" OFF) -if (MDNS_ENABLED) - find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DNSSD) -endif() - option(BLUETOOTH_ENABLED "Bluetooth support for kdeconnect" OFF) if(BLUETOOTH_ENABLED) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Bluetooth) @@ -68,6 +63,7 @@ PRIVATE Qt${QT_MAJOR_VERSION}::DBus KF5::I18n KF5::ConfigCore + KF5::DNSSD ) if(${KF5KIO_FOUND}) @@ -83,11 +79,6 @@ if (LOOPBACK_ENABLED) target_compile_definitions(kdeconnectcore PRIVATE -DKDECONNECT_LOOPBACK) endif() -if (MDNS_ENABLED) - target_compile_definitions(kdeconnectcore PRIVATE -DKDECONNECT_MDNS) - target_link_libraries(kdeconnectcore PRIVATE KF5::DNSSD) -endif() - set_target_properties(kdeconnectcore PROPERTIES VERSION ${KDECONNECT_VERSION} SOVERSION ${KDECONNECT_VERSION_MAJOR} diff --git a/core/backends/lan/CMakeLists.txt b/core/backends/lan/CMakeLists.txt index a915e6716..042581cdd 100644 --- a/core/backends/lan/CMakeLists.txt +++ b/core/backends/lan/CMakeLists.txt @@ -1,21 +1,13 @@ set(backends_kdeconnect_SRCS ${backends_kdeconnect_SRCS} + backends/lan/server.cpp backends/lan/lanlinkprovider.cpp backends/lan/landevicelink.cpp backends/lan/compositeuploadjob.cpp backends/lan/uploadjob.cpp -) + backends/lan/mdnsdiscovery.cpp -if (MDNS_ENABLED) - set(backends_kdeconnect_SRCS - ${backends_kdeconnect_SRCS} - backends/lan/mdnsdiscovery.cpp - ) -endif() - -set(backends_kdeconnect_SRCS - ${backends_kdeconnect_SRCS} PARENT_SCOPE ) diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index 80ea3854f..44ef99f96 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -45,9 +45,7 @@ LanLinkProvider::LanLinkProvider(bool testMode, quint16 udpBroadcastPort, quint1 , m_udpListenPort(udpListenPort) , m_testMode(testMode) , m_combineBroadcastsTimer(this) -#ifdef KDECONNET_MDNS , m_mdnsDiscovery(this) -#endif { m_combineBroadcastsTimer.setInterval(0); // increase this if waiting a single event-loop iteration is not enough m_combineBroadcastsTimer.setSingleShot(true); @@ -105,21 +103,16 @@ void LanLinkProvider::onStart() } broadcastUdpIdentityPacket(); - -#ifdef KDECONNET_MDNS m_mdnsDiscovery.startAnnouncing(); m_mdnsDiscovery.startDiscovering(); -#endif qCDebug(KDECONNECT_CORE) << "LanLinkProvider started"; } void LanLinkProvider::onStop() { -#ifdef KDECONNET_MDNS m_mdnsDiscovery.stopAnnouncing(); m_mdnsDiscovery.stopDiscovering(); -#endif m_udpSocket.close(); m_server->close(); qCDebug(KDECONNECT_CORE) << "LanLinkProvider stopped"; @@ -145,10 +138,8 @@ void LanLinkProvider::broadcastToNetwork() Q_ASSERT(m_tcpPort != 0); broadcastUdpIdentityPacket(); -#ifdef KDECONNET_MDNS m_mdnsDiscovery.stopDiscovering(); m_mdnsDiscovery.startDiscovering(); -#endif } void LanLinkProvider::broadcastUdpIdentityPacket() diff --git a/core/backends/lan/lanlinkprovider.h b/core/backends/lan/lanlinkprovider.h index ce54af16c..8089146b0 100644 --- a/core/backends/lan/lanlinkprovider.h +++ b/core/backends/lan/lanlinkprovider.h @@ -17,10 +17,8 @@ #include "backends/linkprovider.h" #include "kdeconnectcore_export.h" #include "landevicelink.h" -#include "server.h" -#ifdef KDECONNET_MDNS #include "mdnsdiscovery.h" -#endif +#include "server.h" class KDECONNECTCORE_EXPORT LanLinkProvider : public LinkProvider { @@ -93,9 +91,7 @@ private: const bool m_testMode; QTimer m_combineBroadcastsTimer; -#ifdef KDECONNET_MDNS MdnsDiscovery m_mdnsDiscovery; -#endif }; #endif