diff options
Diffstat (limited to 'src/network/kernel/qhostinfo_win.cpp')
-rw-r--r-- | src/network/kernel/qhostinfo_win.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index e044728198..fc65ce9fa2 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -111,7 +111,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) QMutexLocker locker(&qPrivCEMutex); #endif - QWindowsSockInit winSock; + QSysInfo::machineHostName(); // this initializes ws2_32.dll // Load res_init on demand. static QBasicAtomicInt triedResolve = Q_BASIC_ATOMIC_INITIALIZER(false); @@ -256,17 +256,6 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) return results; } -QString QHostInfo::localHostName() -{ - QWindowsSockInit winSock; - - char hostName[512]; - if (gethostname(hostName, sizeof(hostName)) == -1) - return QString(); - hostName[sizeof(hostName) - 1] = '\0'; - return QString::fromLocal8Bit(hostName); -} - // QString QHostInfo::localDomainName() defined in qnetworkinterface_win.cpp QT_END_NAMESPACE |