From 618bfa7276fe46f308a7ab8f003c785bf863c7e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Thu, 22 Apr 2010 22:15:50 +0200
Subject: Add PlatformDNSSDQuerierFactory::canCreate().


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();
 	};
 }
-- 
cgit v0.10.2-6-g49f6