refs #277, slow auio init

* fixed QHostInfo::localHostName()
* move to BlackMisc, as it can be used elsewhere
* temp. change, moved methods in body until refs #278, #277 is fixed/ resolved
This commit is contained in:
Klaus Basan
2014-06-20 00:46:34 +02:00
parent 2ecef24c91
commit 97b8ee8c32
5 changed files with 38 additions and 18 deletions

View File

@@ -5,7 +5,6 @@
#include "audiodevice.h"
#include "blackmisc/blackmiscfreefunctions.h"
#include <QtNetwork/QHostInfo>
#include <tuple>
namespace BlackMisc
@@ -17,7 +16,7 @@ namespace BlackMisc
*/
CAudioDevice::CAudioDevice() :
m_type(Unknown), m_deviceIndex(invalidDeviceIndex()),
m_deviceName(""), m_hostName(CAudioDevice::computerHostName())
m_deviceName(""), m_hostName(BlackMisc::localHostName())
{
// void
}
@@ -27,20 +26,11 @@ namespace BlackMisc
*/
CAudioDevice::CAudioDevice(DeviceType type, const qint16 index, const QString &name) :
m_type(type), m_deviceIndex(index),
m_deviceName(name), m_hostName(CAudioDevice::computerHostName())
m_deviceName(name), m_hostName(BlackMisc::localHostName())
{
// void
}
/*
* Host name
*/
const QString &CAudioDevice::computerHostName()
{
static const QString hostName = QHostInfo::fromName(QHostInfo::localHostName()).localHostName();
return hostName;
}
/*
* Compare
*/