diff --git a/example/window.cpp b/example/window.cpp index f58e85f..ea332ef 100644 --- a/example/window.cpp +++ b/example/window.cpp @@ -52,10 +52,10 @@ mainWindow::mainWindow() publishEnabled = 0; buildGUI(); - connect(&zeroConf, SIGNAL(serviceAdded(QZeroConfService *)), this, SLOT(addService(QZeroConfService *))); - connect(&zeroConf, SIGNAL(serviceRemoved(QZeroConfService *)), this, SLOT(removeService(QZeroConfService *))); + connect(&zeroConf, SIGNAL(serviceAdded(QZeroConfService )), this, SLOT(addService(QZeroConfService ))); + connect(&zeroConf, SIGNAL(serviceRemoved(QZeroConfService )), this, SLOT(removeService(QZeroConfService ))); - zeroConf.startBrowser("_qtzeroconf_test._tcp"); + zeroConf.startBrowser("_workstation._tcp"); startPublish(); } @@ -126,16 +126,16 @@ void mainWindow::stopPublish() // ---------- Discovery Callbacks ---------- -void mainWindow::addService(QZeroConfService *zcs) +void mainWindow::addService(QZeroConfService zcs) { qint32 row; QTableWidgetItem *cell; row = table.rowCount(); table.insertRow(row); - cell = new QTableWidgetItem(zcs->name); + cell = new QTableWidgetItem(zcs.name()); table.setItem(row, 0, cell); - cell = new QTableWidgetItem(zcs->ip.toString()); + cell = new QTableWidgetItem(zcs.ip().toString()); table.setItem(row, 1, cell); table.resizeColumnsToContents(); #if !(defined(Q_OS_IOS) || defined(Q_OS_ANDROID)) @@ -143,17 +143,17 @@ void mainWindow::addService(QZeroConfService *zcs) #endif } -void mainWindow::removeService(QZeroConfService *zcs) +void mainWindow::removeService(QZeroConfService zcs) { qint32 i, row; QTableWidgetItem *nameItem, *ipItem; - QList search = table.findItems(zcs->name, Qt::MatchExactly); + QList search = table.findItems(zcs.name(), Qt::MatchExactly); for (i=0; irow(); ipItem = table.item(row, 1); - if (table.item(row, 1)->text() == zcs->ip.toString()) { // match ip address in case of dual homed systems + if (table.item(row, 1)->text() == zcs.ip().toString()) { // match ip address in case of dual homed systems delete nameItem; delete ipItem; table.removeRow(row); diff --git a/example/window.h b/example/window.h index b259b50..f99bfdf 100644 --- a/example/window.h +++ b/example/window.h @@ -48,8 +48,8 @@ private: private slots: void startPublish(); void stopPublish(); - void addService(QZeroConfService *item); - void removeService(QZeroConfService *item); + void addService(QZeroConfService item); + void removeService(QZeroConfService item); }; #endif /* WINDOW_H_ */