Change uses of {to,from}Ascii to {to,from}Latin1 [other tools]
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 3 May 2012 13:46:22 +0000 (15:46 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 3 May 2012 13:55:06 +0000 (15:55 +0200)
This operation should be a no-op anyway, since at this point in time,
the fromAscii and toAscii functions simply call their fromLatin1 and
toLatin1 counterparts.

Task-number: QTBUG-21872
Change-Id: I1e82285ad996cb2796807260383d1d056b930d0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/makeqpf/mainwindow.cpp
src/runonphone/serenum_unix.cpp
src/runonphone/symbianutils/launcher.cpp
src/runonphone/symbianutils/tcftrkdevice.cpp
src/runonphone/symbianutils/trkdevice.cpp
src/runonphone/symbianutils/trkutils.cpp

index 5d8507b..1da7db9 100644 (file)
@@ -257,7 +257,7 @@ void MainWindow::populateCharacterRanges()
         ellipsis = QLatin1String("...");
 
     while (!f.atEnd()) {
-        QString line = QString::fromAscii(f.readLine());
+        QString line = QString::fromLatin1(f.readLine());
 
         if (line.endsWith(QLatin1Char('\n')))
             line.chop(1);
index 5050b07..1a7b9c7 100644 (file)
@@ -124,7 +124,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel)
                         if (loglevel > 1)
                             qDebug() << "      can't read manufacturer name, error:" << err;
                     } else {
-                        manufacturerString = QString::fromAscii(buf);
+                        manufacturerString = QString::fromLatin1(buf);
                         if (loglevel > 1)
                             qDebug() << "      manufacturer:" << manufacturerString;
                     }
@@ -135,7 +135,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel)
                         if (loglevel > 1)
                             qDebug() << "      can't read product name, error:" << err;
                     } else {
-                        productString = QString::fromAscii(buf);
+                        productString = QString::fromLatin1(buf);
                         if (loglevel > 1)
                             qDebug() << "      product:" << productString;
                     }
index 8f22143..f07867d 100644 (file)
@@ -470,9 +470,9 @@ void Launcher::handleResult(const TrkResult &result)
             const uint tid = result.data.size() >= 10 ? extractShort(result.data.constData() + 6) : 0;
             Q_UNUSED(tid)
             const ushort len = result.data.size() > 12 ? extractShort(result.data.constData() + 10) : ushort(0);
-            const QString name = len ? QString::fromAscii(result.data.mid(12, len)) : QString();
+            const QString name = len ? QString::fromLatin1(result.data.mid(12, len)) : QString();
             logMessage(QString::fromLatin1("%1 %2 UNLOAD: %3").
-                       arg(QString::fromAscii(prefix)).arg(itemType ? QLatin1String("LIB") : QLatin1String("PROCESS")).
+                       arg(QString::fromLatin1(prefix)).arg(itemType ? QLatin1String("LIB") : QLatin1String("PROCESS")).
                        arg(name));
             d->m_device->sendTrkAck(result.token);
             if (itemType == kDSOSProcessItem // process
index 4fb100d..1acf6a9 100644 (file)
@@ -408,7 +408,7 @@ int TcfTrkDevice::parseMessage(const QByteArray &message)
     // "\3\2{"Time":1276096098255,"Code":3,"Format": "Protocol format error"}"
     if (message.startsWith("\003\002")) {
         QByteArray text = message.mid(2);
-        const QString errorMessage = QString::fromLatin1("Parse error received: %1").arg(QString::fromAscii(text));
+        const QString errorMessage = QString::fromLatin1("Parse error received: %1").arg(QString::fromLatin1(text));
         emit error(errorMessage);
         return 0;
     }
index afd128c..8dd1170 100644 (file)
@@ -987,7 +987,7 @@ bool TrkDevice::open(QString *errorMessage)
 
     struct termios termInfo;
     if (tcgetattr(d->deviceContext->file.handle(), &termInfo) < 0) {
-        *errorMessage = QString::fromLatin1("Unable to retrieve terminal settings: %1 %2").arg(errno).arg(QString::fromAscii(strerror(errno)));
+        *errorMessage = QString::fromLatin1("Unable to retrieve terminal settings: %1 %2").arg(errno).arg(QString::fromLatin1(strerror(errno)));
         return false;
     }
     // Turn off terminal echo as not get messages back, among other things
@@ -1002,7 +1002,7 @@ bool TrkDevice::open(QString *errorMessage)
     termInfo.c_cc[VSTOP] = _POSIX_VDISABLE;
     termInfo.c_cc[VSUSP] = _POSIX_VDISABLE;
     if (tcsetattr(d->deviceContext->file.handle(), TCSAFLUSH, &termInfo) < 0) {
-        *errorMessage = QString::fromLatin1("Unable to apply terminal settings: %1 %2").arg(errno).arg(QString::fromAscii(strerror(errno)));
+        *errorMessage = QString::fromLatin1("Unable to apply terminal settings: %1 %2").arg(errno).arg(QString::fromLatin1(strerror(errno)));
         return false;
     }
 #endif
index cafbbaa..16b52f3 100644 (file)
@@ -292,7 +292,7 @@ SYMBIANUTILS_EXPORT QString stringFromArray(const QByteArray &ba, int maxLen)
     const int size = maxLen == -1 ? ba.size() : qMin(ba.size(), maxLen);
     for (int i = 0; i < size; ++i) {
         const int c = byte(ba.at(i));
-        str += QString::fromAscii("%1 ").arg(c, 2, 16, QChar('0'));
+        str += QString::fromLatin1("%1 ").arg(c, 2, 16, QChar('0'));
         ascii += QChar(c).isPrint() ? QChar(c) : QChar('.');
     }
     if (size != ba.size()) {