Commit 7f94c102 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

ZeroConf: Interface improvements.



Change-Id: I1966d375167612675ac78a40de4060ff1810c9d4
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@nokia.com>
parent cb0b3424
......@@ -397,23 +397,20 @@ bool ServiceBrowser::startBrowsing(qint32 interfaceIndex)
}
/// create a new brower for the given service type
ServiceBrowser::ServiceBrowser(const QString &serviceType, const QString &domain, bool requireAddresses,
QObject *parent):
QObject(parent), d(new ServiceBrowserPrivate(serviceType, domain, requireAddresses, MainConnectionPtr()))
{
d->q = this;
}
/// create a new brower for the given service type
ServiceBrowser::ServiceBrowser(const QString &serviceType, const QString &domain, bool requireAddresses,
QObject *parent, MainConnectionPtr connection):
QObject(parent), d(new ServiceBrowserPrivate(serviceType, domain, requireAddresses, connection))
ServiceBrowser::ServiceBrowser(const QString &serviceType, const QString &domain,
AddressesSetting addressesSetting, QObject *parent)
: QObject(parent),
d(new ServiceBrowserPrivate(serviceType, domain, addressesSetting == RequireAddresses,
MainConnectionPtr()))
{
d->q = this;
}
/// create a new ServiceBrowser (which is basically constant once created)
ServiceBrowser::ServiceBrowser(const QString &serviceType, MainConnectionPtr connection) :
QObject(), d(new ServiceBrowserPrivate(serviceType, QString::fromUtf8("local."), true, connection))
ServiceBrowser::ServiceBrowser(const MainConnectionPtr &mainConnection, const QString &serviceType,
const QString &domain, AddressesSetting addressesSetting, QObject *parent)
: QObject(parent),
d(new ServiceBrowserPrivate(serviceType, domain, addressesSetting == RequireAddresses,
mainConnection))
{
d->q = this;
}
......@@ -424,7 +421,7 @@ ServiceBrowser::~ServiceBrowser()
}
/// returns the main connection used by this ServiceBrowser
MainConnectionPtr ServiceBrowser::mainConnection()
MainConnectionPtr ServiceBrowser::mainConnection() const
{
return d->mainConnection;
}
......@@ -460,7 +457,7 @@ bool ServiceBrowser::adressesAutoResolved() const
}
/// if addresses are required to add the service to the list of available services
bool ServiceBrowser::adressesRequired() const
bool ServiceBrowser::addressesRequired() const
{
return d->requireAddresses;
}
......
......@@ -98,13 +98,16 @@ class ZEROCONFSHARED_EXPORT ServiceBrowser : public QObject
Q_OBJECT
friend class Internal::ServiceBrowserPrivate;
public:
ServiceBrowser(const QString &serviceType, const QString &domain = QLatin1String("local."), bool adressesRequired = true, QObject *parent = 0);
// this is here to avoid to instantiate a partially defined type (MainConnectionPtr)
ServiceBrowser(const QString &serviceType, const QString &domain, bool adressesRequired, QObject *parent, MainConnectionPtr mainConnection);
ServiceBrowser(const QString &serviceType, MainConnectionPtr mainConnection);
enum AddressesSetting { RequireAddresses, DoNotRequireAddresses };
ServiceBrowser(const QString &serviceType, const QString &domain = QLatin1String("local."),
AddressesSetting addressesSetting = RequireAddresses, QObject *parent = 0);
ServiceBrowser(const MainConnectionPtr &mainConnection, const QString &serviceType,
const QString &domain = QLatin1String("local."),
AddressesSetting addressesSetting = RequireAddresses, QObject *parent = 0);
~ServiceBrowser();
MainConnectionPtr mainConnection();
MainConnectionPtr mainConnection() const;
bool startBrowsing(qint32 interfaceIndex = 0);
void stopBrowsing();
......@@ -115,7 +118,7 @@ public:
const QString& domain() const;
bool adressesAutoResolved() const;
bool adressesRequired() const;
bool addressesRequired() const;
QList<Service::ConstPtr> services() const;
void reconfirmService(Service::ConstPtr service);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment