From fd43e238233142bdd6b045c69f9cbb56b3601984 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Thu, 3 May 2012 15:13:46 +0200
Subject: [PATCH] Change remaining uses of {to,from}Ascii to {to,from}Latin1
 [other]

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: Ib84e307f486cb3049f0b61a667caa40799394f86
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
---
 src/xmlpatterns/functions/qpatternmatchingfns.cpp |  2 +-
 src/xmlpatterns/parser/qxquerytokenizer.cpp       | 10 +++++-----
 src/xmlpatterns/parser/qxquerytokenizer_p.h       |  2 +-
 tests/auto/network-settings.h                     |  8 ++++----
 tools/xmlpatterns/qapplicationargumentparser.cpp  |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/xmlpatterns/functions/qpatternmatchingfns.cpp b/src/xmlpatterns/functions/qpatternmatchingfns.cpp
index 27c7dd44..4e5848dc 100644
--- a/src/xmlpatterns/functions/qpatternmatchingfns.cpp
+++ b/src/xmlpatterns/functions/qpatternmatchingfns.cpp
@@ -111,7 +111,7 @@ QString ReplaceFN::parseReplacement(const int,
     for(int i = 0; i < len; ++i)
     {
         const QChar ch(input.at(i));
-        switch(ch.toAscii())
+        switch(ch.toLatin1())
         {
             case '$':
             {
diff --git a/src/xmlpatterns/parser/qxquerytokenizer.cpp b/src/xmlpatterns/parser/qxquerytokenizer.cpp
index 9988c7d3..0c8960d4 100644
--- a/src/xmlpatterns/parser/qxquerytokenizer.cpp
+++ b/src/xmlpatterns/parser/qxquerytokenizer.cpp
@@ -83,7 +83,7 @@ const QChar XQueryTokenizer::current() const
 
 char XQueryTokenizer::peekCurrent() const
 {
-    return current().toAscii();
+    return current().toLatin1();
 }
 
 int XQueryTokenizer::peekForColonColon() const
@@ -94,7 +94,7 @@ int XQueryTokenizer::peekForColonColon() const
 
     while(pos < m_length)
     {
-        switch(m_data.at(pos).toAscii())
+        switch(m_data.at(pos).toLatin1())
         {
             /* Fallthrough these four. */
             case ' ':
@@ -317,7 +317,7 @@ Tokenizer::TokenType XQueryTokenizer::consumeWhitespace()
 char XQueryTokenizer::peekAhead(const int length) const
 {
     if(m_pos + length < m_length)
-        return m_data.at(m_pos + length).toAscii();
+        return m_data.at(m_pos + length).toLatin1();
     else
         return 0;
 }
@@ -702,7 +702,7 @@ bool XQueryTokenizer::aheadEquals(const char *const chs,
 
     for(int i = offset; i < (len + offset); ++i)
     {
-        if(m_data.at(m_pos + i).toAscii() != chs[i - offset])
+        if(m_data.at(m_pos + i).toLatin1() != chs[i - offset])
             return false;
     }
 
@@ -711,7 +711,7 @@ bool XQueryTokenizer::aheadEquals(const char *const chs,
 
 const TokenMap *XQueryTokenizer::lookupKeyword(const QString &keyword)
 {
-    return TokenLookup::value(keyword.toAscii().constData(), keyword.length());
+    return TokenLookup::value(keyword.toLatin1().constData(), keyword.length());
 }
 
 XQueryTokenizer::State XQueryTokenizer::state() const
diff --git a/src/xmlpatterns/parser/qxquerytokenizer_p.h b/src/xmlpatterns/parser/qxquerytokenizer_p.h
index b0ac364f..39490478 100644
--- a/src/xmlpatterns/parser/qxquerytokenizer_p.h
+++ b/src/xmlpatterns/parser/qxquerytokenizer_p.h
@@ -173,7 +173,7 @@ namespace QPatternist
          * Equivalent to calling:
          *
          * @code
-         * current().toAscii();
+         * current().toLatin1();
          * @endcode
          */
         inline char peekCurrent() const;
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index f2c12bc0..179eea97 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -82,12 +82,12 @@ public:
 
         // Mandriva; old test server
         expected << QByteArray( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] " )
-            .append(QtNetworkSettings::serverName().toAscii())
+            .append(QtNetworkSettings::serverName().toLatin1())
             .append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
 
         // Ubuntu 10.04; new test server
         expected << QByteArray( "* OK " )
-            .append(QtNetworkSettings::serverLocalName().toAscii())
+            .append(QtNetworkSettings::serverLocalName().toLatin1())
             .append(" Cyrus IMAP4 v2.2.13-Debian-2.2.13-19 server ready\r\n");
 
         // Feel free to add more as needed
@@ -107,12 +107,12 @@ public:
 
         // Mandriva; old test server
         expected << QByteArray( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " )
-            .append(QtNetworkSettings::serverName().toAscii())
+            .append(QtNetworkSettings::serverName().toLatin1())
             .append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
 
         // Ubuntu 10.04; new test server
         expected << QByteArray( "* OK " )
-            .append(QtNetworkSettings::serverLocalName().toAscii())
+            .append(QtNetworkSettings::serverLocalName().toLatin1())
             .append(" Cyrus IMAP4 v2.2.13-Debian-2.2.13-19 server ready\r\n");
 
         // Feel free to add more as needed
diff --git a/tools/xmlpatterns/qapplicationargumentparser.cpp b/tools/xmlpatterns/qapplicationargumentparser.cpp
index 008d9059..62a15cc5 100644
--- a/tools/xmlpatterns/qapplicationargumentparser.cpp
+++ b/tools/xmlpatterns/qapplicationargumentparser.cpp
@@ -299,7 +299,7 @@ void QApplicationArgumentParserPrivate::displayVersion() const
 {
     QTextStream out(stderr);
 
-    out << tr("%1 version %2 using Qt %3").arg(QCoreApplication::applicationName(), applicationVersion, QString::fromAscii(qVersion()))
+    out << tr("%1 version %2 using Qt %3").arg(QCoreApplication::applicationName(), applicationVersion, QString::fromLatin1(qVersion()))
         << endl;
 }
 
-- 
GitLab