diff options
author | kh <karsten.heimrich@theqtcompany.com> | 2014-11-24 15:26:21 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2014-11-24 16:52:17 +0100 |
commit | b34f41a3bb527430f66f349bf612e6978a1c2338 (patch) | |
tree | 5ca5c2f506f7df8179738f67530b4ad12287d318 /src | |
parent | 44b12b11b2f86575f86b12c2e3172c4c038f4556 (diff) |
Use written localhost address, adapt code.
Use the default address throughout the whole code. Instead of
relying on the QHostAddress::SpecialAddress enum, use the full
qualified and more descriptive address of localhost.
Change-Id: I64b3459245682532f84306703e29ac276d4e468d
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 3 | ||||
-rw-r--r-- | src/libs/installer/protocol.h | 2 | ||||
-rw-r--r-- | src/libs/installer/remoteclient_p.h | 2 | ||||
-rw-r--r-- | src/libs/installer/remoteserver_p.h | 2 | ||||
-rw-r--r-- | src/sdk/main.cpp | 3 |
5 files changed, 7 insertions, 5 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index e65e3aea7..5944e4100 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -245,7 +245,8 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q // Creates and initializes a remote client, makes us get admin rights for QFile, QSettings // and QProcess operations. Init needs to called before we can get the real authorization key. int port = 30000 + qrand() % 1000; - RemoteClient::instance().init(port, QHostAddress::LocalHost, Protocol::Mode::Release); + RemoteClient::instance().init(port, + QHostAddress(QLatin1String(Protocol::DefaultHostAddress)), Protocol::Mode::Release); RemoteClient::instance().setStartServerCommand(QCoreApplication::applicationFilePath(), QStringList() << QLatin1String("--startserver") << QString::fromLatin1("%1,%2") .arg(port) diff --git a/src/libs/installer/protocol.h b/src/libs/installer/protocol.h index d99da20e6..2aee34769 100644 --- a/src/libs/installer/protocol.h +++ b/src/libs/installer/protocol.h @@ -49,7 +49,7 @@ enum struct StartAs { }; const unsigned short DefaultPort = 39999; -const int DefaultHostAddress = 2; // QHostAddress::LocalHost +const char DefaultHostAddress[] = "127.0.0.1"; const char DefaultAuthorizationKey[] = "DefaultAuthorizationKey"; const char Create[] = "Create"; diff --git a/src/libs/installer/remoteclient_p.h b/src/libs/installer/remoteclient_p.h index f4e8e5ffb..515ce52c8 100644 --- a/src/libs/installer/remoteclient_p.h +++ b/src/libs/installer/remoteclient_p.h @@ -108,7 +108,7 @@ public: RemoteClientPrivate(RemoteClient *parent) : q_ptr(parent) , m_mutex(QMutex::Recursive) - , m_address(Protocol::DefaultHostAddress) + , m_address(QLatin1String(Protocol::DefaultHostAddress)) , m_port(Protocol::DefaultPort) , m_startServerAs(Protocol::StartAs::User) , m_serverStarted(false) diff --git a/src/libs/installer/remoteserver_p.h b/src/libs/installer/remoteserver_p.h index 3e56e593c..d49ae5ca5 100644 --- a/src/libs/installer/remoteserver_p.h +++ b/src/libs/installer/remoteserver_p.h @@ -96,7 +96,7 @@ public: , m_tcpServer(0) , m_key(QLatin1String(Protocol::DefaultAuthorizationKey)) , m_port(Protocol::DefaultPort) - , m_address(Protocol::DefaultHostAddress) + , m_address(QLatin1String(Protocol::DefaultHostAddress)) , m_mode(Protocol::Mode::Debug) , m_watchdog(new QTimer) { diff --git a/src/sdk/main.cpp b/src/sdk/main.cpp index 5b6019c74..a5565fe5a 100644 --- a/src/sdk/main.cpp +++ b/src/sdk/main.cpp @@ -137,7 +137,8 @@ int main(int argc, char *argv[]) QInstaller::RemoteServer *server = new QInstaller::RemoteServer; QObject::connect(server, SIGNAL(destroyed()), &app, SLOT(quit())); - server->init(port.toInt(), QHostAddress::LocalHost, QInstaller::Protocol::Mode::Release); + server->init(port.toInt(), QHostAddress(QLatin1String(QInstaller::Protocol + ::DefaultHostAddress)), QInstaller::Protocol::Mode::Release); server->setAuthorizationKey(key); server->start(); return app.exec(); |