summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-04-22 20:15:50 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-04-22 20:15:50 (GMT)
commit618bfa7276fe46f308a7ab8f003c785bf863c7e8 (patch)
tree2dbba21aed6e2d8659f129e677dd3bb968b47485
parent353022b20f6fe6bddff9cab99e68fd8dde3d79b3 (diff)
downloadswift-618bfa7276fe46f308a7ab8f003c785bf863c7e8.zip
swift-618bfa7276fe46f308a7ab8f003c785bf863c7e8.tar.bz2
Add PlatformDNSSDQuerierFactory::canCreate().
-rw-r--r--Slimber/MainController.cpp5
-rw-r--r--Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp8
-rw-r--r--Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h2
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();
};
}