equal
deleted
inserted
replaced
65 QString ipAddress; |
65 QString ipAddress; |
66 QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses(); |
66 QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses(); |
67 // use the first non-localhost IPv4 address |
67 // use the first non-localhost IPv4 address |
68 for (int i = 0; i < ipAddressesList.size(); ++i) { |
68 for (int i = 0; i < ipAddressesList.size(); ++i) { |
69 if (ipAddressesList.at(i) != QHostAddress::LocalHost && |
69 if (ipAddressesList.at(i) != QHostAddress::LocalHost && |
70 ipAddressesList.at(i).toIPv4Address()) |
70 ipAddressesList.at(i).toIPv4Address()) { |
71 ipAddress = ipAddressesList.at(i).toString(); |
71 ipAddress = ipAddressesList.at(i).toString(); |
|
72 break; |
|
73 } |
72 } |
74 } |
73 // if we did not find one, use IPv4 localhost |
75 // if we did not find one, use IPv4 localhost |
74 if (ipAddress.isEmpty()) |
76 if (ipAddress.isEmpty()) |
75 ipAddress = QHostAddress(QHostAddress::LocalHost).toString(); |
77 ipAddress = QHostAddress(QHostAddress::LocalHost).toString(); |
76 statusLabel->setText(tr("The server is running on\n\nIP: %1\nport: %2\n\n" |
78 statusLabel->setText(tr("The server is running on\n\nIP: %1\nport: %2\n\n" |