Skip to content

Commit

Permalink
Use QNetworkInterface::allAddresses() instead of ServerPool. Fixes #1…
Browse files Browse the repository at this point in the history
…1393
  • Loading branch information
stuartm committed Apr 30, 2013
1 parent 8a40b1a commit 7c31160
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mythtv/programs/mythtv-setup/backendsettings.cpp
Expand Up @@ -5,19 +5,21 @@
#include "mythcorecontext.h"
#include "settings.h"
#include "channelsettings.h" // for ChannelTVFormat::GetFormats()
#include "serverpool.h"
#include <unistd.h>

#include <QNetworkInterface>


static HostComboBox *LocalServerIP()
{
HostComboBox *gc = new HostComboBox("BackendServerIP");
gc->setLabel(QObject::tr("IPv4 address"));
QList<QHostAddress> list = ServerPool::DefaultListenIPv4();
QList<QHostAddress> list = QNetworkInterface::allAddresses();
QList<QHostAddress>::iterator it;
for (it = list.begin(); it != list.end(); ++it)
{
gc->addSelection((*it).toString(), (*it).toString());
if ((*it).protocol() == QAbstractSocket::IPv4Protocol)
gc->addSelection((*it).toString(), (*it).toString());
}

gc->setValue("127.0.0.1");
Expand All @@ -34,11 +36,12 @@ static HostComboBox *LocalServerIP6()
{
HostComboBox *gc = new HostComboBox("BackendServerIP6");
gc->setLabel(QObject::tr("IPv6 address"));
QList<QHostAddress> list = ServerPool::DefaultListenIPv6();
QList<QHostAddress> list = QNetworkInterface::allAddresses();
QList<QHostAddress>::iterator it;
for (it = list.begin(); it != list.end(); ++it)
{
gc->addSelection((*it).toString(), (*it).toString());
if ((*it).protocol() == QAbstractSocket::IPv6Protocol)
gc->addSelection((*it).toString(), (*it).toString());
}

#if defined(QT_NO_IPV6)
Expand Down

0 comments on commit 7c31160

Please sign in to comment.