From d3a6dbeed3f937318eebda3c6d5a73855909550d Mon Sep 17 00:00:00 2001 From: Arisotura Date: Sun, 10 Sep 2023 12:01:56 +0200 Subject: [PATCH] add host IP to the discovery dialog --- src/frontend/qt_sdl/LAN.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/qt_sdl/LAN.cpp b/src/frontend/qt_sdl/LAN.cpp index db4f3dc7..d8da701e 100644 --- a/src/frontend/qt_sdl/LAN.cpp +++ b/src/frontend/qt_sdl/LAN.cpp @@ -108,7 +108,7 @@ LANStartClientDialog::LANStartClientDialog(QWidget* parent) : QDialog(parent), u QStandardItemModel* model = new QStandardItemModel(); ui->tvAvailableGames->setModel(model); - const QStringList listheader = {"Name", "Players", "Status"}; + const QStringList listheader = {"Name", "Players", "Status", "Host IP"}; model->setHorizontalHeaderLabels(listheader); connect(ui->tvAvailableGames->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), @@ -247,6 +247,7 @@ void LANStartClientDialog::doUpdateDiscoveryList() row.append(new QStandardItem()); row.append(new QStandardItem()); row.append(new QStandardItem()); + row.append(new QStandardItem()); model->appendRow(row); } } @@ -268,6 +269,9 @@ void LANStartClientDialog::doUpdateDiscoveryList() } model->item(i, 2)->setText(status); + QString ip = QString("%0.%1.%2.%3").arg(key>>24).arg((key>>16)&0xFF).arg((key>>8)&0xFF).arg(key&0xFF); + model->item(i, 3)->setText(ip); + i++; }