Avoid some unnecessary byte array <-> string conversions.

Reviewed-by: dt
This commit is contained in:
con
2009-12-02 15:26:21 +01:00
parent 15c4e5d42e
commit b6bd021a65

View File

@@ -235,6 +235,9 @@ bool S60Devices::readWin()
bool S60Devices::detectQtForDevices() bool S60Devices::detectQtForDevices()
{ {
// Do not normalize these backslashes since they are in ARM binaries:
const QByteArray indicator("\\src\\corelib\\kernel\\qobject.h");
const int indicatorlength = indicator.size();
for (int i = 0; i < m_devices.size(); ++i) { for (int i = 0; i < m_devices.size(); ++i) {
if (!m_devices.at(i).qt.isEmpty()) if (!m_devices.at(i).qt.isEmpty())
continue; continue;
@@ -243,14 +246,11 @@ bool S60Devices::detectQtForDevices()
m_devices[i].qt = QString(); m_devices[i].qt = QString();
continue; continue;
} }
// Do not normalize these backslashes since they are in ARM binaries:
const QString indicator("\\src\\corelib\\kernel\\qobject.h");
int indicatorlength = indicator.length();
QByteArray buffer; QByteArray buffer;
int index = -1; int index = -1;
while (!qtDll.atEnd()) { while (!qtDll.atEnd()) {
buffer = qtDll.read(10000); buffer = qtDll.read(10000);
index = buffer.indexOf(indicator.toLatin1()); index = buffer.indexOf(indicator);
if (index >= 0) if (index >= 0)
break; break;
if (!qtDll.atEnd()) if (!qtDll.atEnd())