KDNSSD 5.109.0
|
Browses recommended domains for browsing or publishing to. More...
#include <KDNSSD/DomainBrowser>
Public Types | |
enum | DomainType { Browsing , Publishing } |
A type of domain recommendation. More... | |
Signals | |
void | domainAdded (const QString &domain) |
A new domain has been discovered. | |
void | domainRemoved (const QString &domain) |
A domain has disappeared from the browsed list. | |
Public Member Functions | |
DomainBrowser (DomainType type, QObject *parent=nullptr) | |
Standard constructor. | |
QStringList | domains () const |
The current known list of domains of the requested DomainType. | |
bool | isRunning () const |
Whether the browsing has been started. | |
void | startBrowse () |
Starts browsing. | |
Browses recommended domains for browsing or publishing to.
Usage of this class is very simple. If you are interested in browsing for services, simple do
If you are interested in domains where you can register services, usage is identical except that you should pass KDNSSD::DomainBrowser::Registering
to the constructor.
A type of domain recommendation.
Enumerator | |
---|---|
Browsing | Domains recommended for browsing for services on (using ServiceBrowser) |
Publishing | Domains recommended for publishing to (using PublicService) |
|
explicit |
Standard constructor.
The global DNS-SD configuration (for example, the global Avahi configuration for the Avahi backend) will be used.
type | the type of domain to search for |
parent | parent object (see QObject documentation) |
|
signal |
A new domain has been discovered.
If the requested DomainType is Browsing, this will also be emitted for the domains specified in the global configuration.
domain | the name of the domain |
|
signal |
A domain has disappeared from the browsed list.
Emitted when domain has been removed from browsing list or the publishing list (depending on which list was requested in the constructor).
domain | the name of the domain |
QStringList KDNSSD::DomainBrowser::domains | ( | ) | const |
The current known list of domains of the requested DomainType.
bool KDNSSD::DomainBrowser::isRunning | ( | ) | const |
Whether the browsing has been started.
true
if startBrowse() has been called, false
otherwise void KDNSSD::DomainBrowser::startBrowse | ( | ) |
Starts browsing.
Only the first call to this function will have any effect.
Browsing stops when the DomainBrowser object is destroyed.