spaces to tabs

This commit is contained in:
Matthias Kollmann
2017-10-19 20:51:49 +02:00
parent 7f06953b6d
commit 2d21502972
10 changed files with 187 additions and 189 deletions
+13 -13
View File
@@ -16,12 +16,12 @@
You should have received a copy of the GNU Lesser General Public License
along with QtZeroConf. If not, see <http://www.gnu.org/licenses/>.
---------------------------------------------------------------------------------------------------
Project name : QtZeroConf Example
File name : window.cpp
Created : 3 November 2015
Author(s) : Jonathan Bagg
Project name : QtZeroConf Example
File name : window.cpp
Created : 3 November 2015
Author(s) : Jonathan Bagg
---------------------------------------------------------------------------------------------------
Example app to demonstrate service publishing and service discovery
Example app to demonstrate service publishing and service discovery
---------------------------------------------------------------------------------------------------
**************************************************************************************************/
#include <QGuiApplication>
@@ -54,8 +54,8 @@ mainWindow::mainWindow()
buildGUI();
connect(&zeroConf, &QZeroConf::serviceAdded, this, &mainWindow::addService);
connect(&zeroConf, &QZeroConf::serviceRemoved, this, &mainWindow::removeService);
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;
@@ -93,7 +93,7 @@ void mainWindow::buildGUI()
QString mainWindow::buildName(void)
{
QString name;
QString name;
QList<QNetworkInterface> list = QNetworkInterface::allInterfaces(); // now you have interfaces list
@@ -102,7 +102,7 @@ QString mainWindow::buildName(void)
name.remove(0, 6);
name+= ')';
name.prepend("Qt ZeroConf Test - " OS_NAME " (");
return name;
return name;
}
void mainWindow::appStateChanged(Qt::ApplicationState state)
@@ -154,9 +154,9 @@ void mainWindow::addService(QZeroConfService zcs)
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))
@@ -169,12 +169,12 @@ void mainWindow::removeService(QZeroConfService zcs)
qint32 i, row;
QTableWidgetItem *nameItem, *ipItem;
QList <QTableWidgetItem*> search = table.findItems(zcs.name(), Qt::MatchExactly);
QList <QTableWidgetItem*> search = table.findItems(zcs.name(), Qt::MatchExactly);
for (i=0; i<search.size(); i++) {
nameItem = search.at(i);
row = nameItem->row();
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);