Fixes from code review

This commit is contained in:
Albert Vaca Cintora 2023-07-13 14:56:02 +02:00
parent bb8e67efc9
commit 20750b7d99
4 changed files with 10 additions and 10 deletions

View file

@ -18,7 +18,7 @@ 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)
option(MDNS_ENABLED "Use MDNS for device discovery (under development)" OFF)
if (MDNS_ENABLED)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DNSSD)
endif()

View file

@ -46,7 +46,7 @@ LanLinkProvider::LanLinkProvider(bool testMode, quint16 udpBroadcastPort, quint1
, m_udpListenPort(udpListenPort)
, m_testMode(testMode)
, m_combineBroadcastsTimer(this)
#ifdef KDECONNET_MDNS
#ifdef KDECONNECT_MDNS
, m_mdnsDiscovery(this)
#endif
{
@ -107,7 +107,7 @@ void LanLinkProvider::onStart()
broadcastUdpIdentityPacket();
#ifdef KDECONNET_MDNS
#ifdef KDECONNECT_MDNS
m_mdnsDiscovery.startAnnouncing();
m_mdnsDiscovery.startDiscovering();
#endif
@ -117,7 +117,7 @@ void LanLinkProvider::onStart()
void LanLinkProvider::onStop()
{
#ifdef KDECONNET_MDNS
#ifdef KDECONNECT_MDNS
m_mdnsDiscovery.stopAnnouncing();
m_mdnsDiscovery.stopDiscovering();
#endif
@ -146,7 +146,7 @@ void LanLinkProvider::broadcastToNetwork()
Q_ASSERT(m_tcpPort != 0);
broadcastUdpIdentityPacket();
#ifdef KDECONNET_MDNS
#ifdef KDECONNECT_MDNS
m_mdnsDiscovery.stopDiscovering();
m_mdnsDiscovery.startDiscovering();
#endif

View file

@ -18,7 +18,7 @@
#include "kdeconnectcore_export.h"
#include "landevicelink.h"
#include "server.h"
#ifdef KDECONNET_MDNS
#ifdef KDECONNECT_MDNS
#include "mdnsdiscovery.h"
#endif
@ -93,7 +93,7 @@ private:
const bool m_testMode;
QTimer m_combineBroadcastsTimer;
#ifdef KDECONNET_MDNS
#ifdef KDECONNECT_MDNS
MdnsDiscovery m_mdnsDiscovery;
#endif
};

View file

@ -21,13 +21,13 @@ MdnsDiscovery::MdnsDiscovery(LanLinkProvider *lanLinkProvider)
{
switch (KDNSSD::ServiceBrowser::isAvailable()) {
case KDNSSD::ServiceBrowser::Stopped:
qWarning() << "mDNS or Avahi daemons are not running, mDNS discovery not available";
qCWarning(KDECONNECT_CORE) << "mDNS or Avahi daemons are not running, mDNS discovery not available";
break;
case KDNSSD::ServiceBrowser::Working:
qCDebug(KDECONNECT_CORE) << "mDNS discovery is available";
break;
case KDNSSD::ServiceBrowser::Unsupported:
qWarning() << "mDNS discovery not available (library built without DNS-SD support)";
qCWarning(KDECONNECT_CORE) << "mDNS discovery not available (library built without DNS-SD support)";
break;
}
}
@ -63,7 +63,7 @@ void MdnsDiscovery::startAnnouncing()
if (successful) {
qCDebug(KDECONNECT_CORE) << "MDNS published successfully";
} else {
qWarning() << "MDNS failed to publish";
qCWarning(KDECONNECT_CORE) << "MDNS failed to publish";
}
});