diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-16 17:23:18 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-02-16 18:10:38 (GMT) |
commit | d590fc729e3afaedf181da58f8b685d7597040da (patch) | |
tree | 446692610d5d85733074042115118a556f39c0e3 /src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp | |
parent | e6b629f3ebc1d530218f01a735275e56bf474a18 (diff) | |
download | Qt-d590fc729e3afaedf181da58f8b685d7597040da.zip Qt-d590fc729e3afaedf181da58f8b685d7597040da.tar.gz Qt-d590fc729e3afaedf181da58f8b685d7597040da.tar.bz2 |
optimization: get rid of QString::fromUtf16() usage, part 2
QString::fromUtf16() is slow - it does a BOM check and optionally byte
swapping, which is utterly irrelevant when converting internal data
structures which are raw utf16 in host byte order. so replace it with
QString::fromUnicode() where possible (which seems to be everywhere).
the reasoning is the same as in commit e0fda52f, so not getting further
reviews.
Reviewed-by: denis
Reviewed-by: joao
Diffstat (limited to 'src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp')
-rw-r--r-- | src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp index 955a880..67dc90c 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp @@ -218,7 +218,7 @@ void QAudioDeviceInfoInternal::updateLists() for(i=0;i<iNumDevs;i++) { if(waveOutGetDevCaps(i, &woc, sizeof(WAVEOUTCAPS)) == MMSYSERR_NOERROR) { - tmp = QString::fromUtf16((const unsigned short*)woc.szPname); + tmp = QString((const QChar *)woc.szPname); if(tmp.compare(device) == 0) { match = true; fmt = woc.dwFormats; @@ -238,7 +238,7 @@ void QAudioDeviceInfoInternal::updateLists() for(i=0;i<iNumDevs;i++) { if(waveInGetDevCaps(i, &woc, sizeof(WAVEINCAPS)) == MMSYSERR_NOERROR) { - tmp = QString::fromUtf16((const unsigned short*)woc.szPname); + tmp = QString((const QChar *)woc.szPname); if(tmp.compare(device) == 0) { match = true; fmt = woc.dwFormats; @@ -347,7 +347,7 @@ QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) for(i=0;i<iNumDevs;i++) { if(waveOutGetDevCaps(i, &woc, sizeof(WAVEOUTCAPS)) == MMSYSERR_NOERROR) { - devices.append(QString::fromUtf16((const unsigned short*)woc.szPname).toLocal8Bit().constData()); + devices.append(QString((const QChar *)woc.szPname).toLocal8Bit().constData()); } } } else { @@ -357,7 +357,7 @@ QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) for(i=0;i<iNumDevs;i++) { if(waveInGetDevCaps(i, &woc, sizeof(WAVEINCAPS)) == MMSYSERR_NOERROR) { - devices.append(QString::fromUtf16((const unsigned short*)woc.szPname).toLocal8Bit().constData()); + devices.append(QString((const QChar *)woc.szPname).toLocal8Bit().constData()); } } |