diff options
-rw-r--r-- | Slimber/MainController.cpp | 5 | ||||
-rw-r--r-- | Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp | 8 | ||||
-rw-r--r-- | Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/Slimber/MainController.cpp b/Slimber/MainController.cpp index 1d5b86c..e5def24 100644 --- a/Slimber/MainController.cpp +++ b/Slimber/MainController.cpp @@ -28,10 +28,7 @@ MainController::MainController(Menulet* menulet) : menulet(menulet) { &MainController::handleRestartRequested, this)); dnsSDQuerier = PlatformDNSSDQuerierFactory().createQuerier(); - if (!dnsSDQuerier) { - // TODO - assert(false); - } + assert(dnsSDQuerier); linkLocalServiceBrowser = new LinkLocalServiceBrowser(dnsSDQuerier); linkLocalServiceBrowser->onServiceAdded.connect( diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp index 279b125..56128f0 100644 --- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp +++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp @@ -25,4 +25,12 @@ boost::shared_ptr<DNSSDQuerier> PlatformDNSSDQuerierFactory::createQuerier() { #endif } +bool PlatformDNSSDQuerierFactory::canCreate() { +#if defined(HAVE_BONJOUR) || defined(HAVE_AVAHI) + return true; +#else + return false; +#endif +} + } diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h index c49fb4e..674c13a 100644 --- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h +++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h @@ -14,5 +14,7 @@ namespace Swift { class PlatformDNSSDQuerierFactory { public: boost::shared_ptr<DNSSDQuerier> createQuerier(); + + bool canCreate(); }; } |