Applied undo_some_whitespace_changes.patch

This commit is contained in:
Matthias Kollmann
2017-10-23 20:12:00 +02:00
parent 2d21502972
commit 323d9494f5
8 changed files with 96 additions and 110 deletions

View File

@ -162,8 +162,8 @@ public:
newRecord = 1;
zcs.setName(name);
zcs.setType(type);
zcs.setDomain( domain);
zcs.setHost( host_name);
zcs.setDomain(domain);
zcs.setHost(host_name);
zcs.setInterfaceIndex(interface);
zcs.setPort(port);
while (txt) // get txt records
@ -210,9 +210,7 @@ public:
QMap<QString, QZeroConfService>::iterator i;
for (i = pub->services.begin(); i != pub->services.end(); i++) {
emit pub->serviceRemoved(i.value());
}
pub->services.clear();
QMap<QString, AvahiServiceResolver *>::iterator r;
@ -233,8 +231,7 @@ public:
};
QZeroConf::QZeroConf(QObject *parent) : QObject(parent)
QZeroConf::QZeroConf(QObject *parent) : QObject (parent)
{
pri = new QZeroConfPrivate(this);
}

View File

@ -37,7 +37,6 @@ QZeroConfPrivate::QZeroConfPrivate(QZeroConf *parent)
browserSocket = NULL;
resolverSocket = NULL;
addressSocket = NULL;
}
void QZeroConfPrivate::bsRead()
@ -111,9 +110,8 @@ void DNSSD_API QZeroConfPrivate::browseCallback(DNSServiceRef, DNSServiceFlags f
key = name + QString::number(interfaceIndex);
if (flags & kDNSServiceFlagsAdd) {
if (!ref->pub->services.contains(key)) {
//zcs = new QZeroConfService;
zcs.setName(name);
zcs.setType( type);
zcs.setType(type);
zcs.setDomain(domain);
zcs.setInterfaceIndex(interfaceIndex);
if (!ref->newService.isValid()) {
@ -128,7 +126,6 @@ void DNSSD_API QZeroConfPrivate::browseCallback(DNSServiceRef, DNSServiceFlags f
zcs = ref->pub->services[key];
ref->pub->services.remove(key);
emit ref->pub->serviceRemoved(zcs);
}
}
else {
@ -245,12 +242,10 @@ void QZeroConfPrivate::cleanUp(DNSServiceRef toClean)
delete browserSocket;
browserSocket = NULL;
}
QMap<QString, QZeroConfService >::iterator i;
for (i = pub->services.begin(); i != pub->services.end(); i++) {
emit pub->serviceRemoved(*i);
}
pub->services.clear();
}
else if (toClean == dnssRef) {

View File

@ -53,13 +53,11 @@ mainWindow::mainWindow()
publishEnabled = 0;
buildGUI();
connect(&zeroConf, &QZeroConf::serviceAdded, this, &mainWindow::addService);
connect(&zeroConf, &QZeroConf::serviceRemoved, this, &mainWindow::removeService);
connect(qGuiApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(appStateChanged(Qt::ApplicationState)));
publishEnabled = 1;
}
void mainWindow::buildGUI()

View File

@ -47,13 +47,11 @@ private:
bool publishEnabled;
private slots:
void appStateChanged(Qt::ApplicationState state);
void startPublishClicked();
void stopPublishClicked();
void addService(QZeroConfService item);
void removeService(QZeroConfService item);
};
#endif /* WINDOW_H_ */

View File

@ -43,8 +43,6 @@
# define Q_ZEROCONF_EXPORT
#endif
class QZeroConfPrivate;
class Q_ZEROCONF_EXPORT QZeroConf : public QObject