forked from jbagg/QtZeroConf
Emit removeService() for all discovered services when browser is stopped.
This commit is contained in:
@ -208,8 +208,10 @@ public:
|
|||||||
browser = NULL;
|
browser = NULL;
|
||||||
|
|
||||||
QMap<QString, QZeroConfService *>::iterator i;
|
QMap<QString, QZeroConfService *>::iterator i;
|
||||||
for (i = pub->services.begin(); i != pub->services.end(); i++)
|
for (i = pub->services.begin(); i != pub->services.end(); i++) {
|
||||||
|
emit pub->serviceRemoved(*i);
|
||||||
delete *i;
|
delete *i;
|
||||||
|
}
|
||||||
pub->services.clear();
|
pub->services.clear();
|
||||||
|
|
||||||
QMap<QString, AvahiServiceResolver *>::iterator r;
|
QMap<QString, AvahiServiceResolver *>::iterator r;
|
||||||
|
@ -220,8 +220,10 @@ public:
|
|||||||
browser = NULL;
|
browser = NULL;
|
||||||
|
|
||||||
QMap<QString, QZeroConfService *>::iterator i;
|
QMap<QString, QZeroConfService *>::iterator i;
|
||||||
for (i = pub->services.begin(); i != pub->services.end(); i++)
|
for (i = pub->services.begin(); i != pub->services.end(); i++) {
|
||||||
|
emit pub->serviceRemoved(*i);
|
||||||
delete *i;
|
delete *i;
|
||||||
|
}
|
||||||
pub->services.clear();
|
pub->services.clear();
|
||||||
|
|
||||||
QMap<QString, AvahiSServiceResolver *>::iterator r;
|
QMap<QString, AvahiSServiceResolver *>::iterator r;
|
||||||
|
@ -250,8 +250,10 @@ void QZeroConfPrivate::cleanUp(DNSServiceRef toClean)
|
|||||||
browserSocket = NULL;
|
browserSocket = NULL;
|
||||||
}
|
}
|
||||||
QMap<QString, QZeroConfService *>::iterator i;
|
QMap<QString, QZeroConfService *>::iterator i;
|
||||||
for (i = pub->services.begin(); i != pub->services.end(); i++)
|
for (i = pub->services.begin(); i != pub->services.end(); i++) {
|
||||||
|
emit pub->serviceRemoved(*i);
|
||||||
delete *i;
|
delete *i;
|
||||||
|
}
|
||||||
pub->services.clear();
|
pub->services.clear();
|
||||||
}
|
}
|
||||||
else if (toClean == dnssRef) {
|
else if (toClean == dnssRef) {
|
||||||
|
@ -74,12 +74,14 @@ public:
|
|||||||
~QZeroConf();
|
~QZeroConf();
|
||||||
void startServicePublish(const char *name, const char *type, const char *domain, quint16 port);
|
void startServicePublish(const char *name, const char *type, const char *domain, quint16 port);
|
||||||
void stopServicePublish(void);
|
void stopServicePublish(void);
|
||||||
|
bool publishExists(void);
|
||||||
inline void startBrowser(QString type)
|
inline void startBrowser(QString type)
|
||||||
{
|
{
|
||||||
startBrowser(type, QAbstractSocket::IPv4Protocol);
|
startBrowser(type, QAbstractSocket::IPv4Protocol);
|
||||||
}
|
}
|
||||||
void startBrowser(QString type, QAbstractSocket::NetworkLayerProtocol protocol);
|
void startBrowser(QString type, QAbstractSocket::NetworkLayerProtocol protocol);
|
||||||
void stopBrowser(void);
|
void stopBrowser(void);
|
||||||
|
bool browserExists(void);
|
||||||
void addServiceTxtRecord(QString nameOnly);
|
void addServiceTxtRecord(QString nameOnly);
|
||||||
void addServiceTxtRecord(QString name, QString value);
|
void addServiceTxtRecord(QString name, QString value);
|
||||||
void clearServiceTxtRecords();
|
void clearServiceTxtRecords();
|
||||||
|
Reference in New Issue
Block a user