diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-05-02 16:32:26 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-05 16:56:23 +0200 |
commit | 8f32994b508bf9b59d8446c3025795acd0337ef1 (patch) | |
tree | 28d567b6a2e6eeebdcf3e3fa330123d9b7571f9e /src/sql/drivers/psql/qsql_psql.cpp | |
parent | ec360d7ad90945273c7d96c9a159131dcbcd67c3 (diff) |
Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtSql]
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: Icb3ab0e1f4f3173563f3de36115b5457cf1ba856
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'src/sql/drivers/psql/qsql_psql.cpp')
-rw-r--r-- | src/sql/drivers/psql/qsql_psql.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 7889311996..bb0c1b311b 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -353,7 +353,7 @@ QVariant QPSQLResult::data(int i) case QVariant::Bool: return QVariant((bool)(val[0] == 't')); case QVariant::String: - return d->driver->isUtf8 ? QString::fromUtf8(val) : QString::fromAscii(val); + return d->driver->isUtf8 ? QString::fromUtf8(val) : QString::fromLatin1(val); case QVariant::LongLong: if (val[0] == '-') return QString::fromLatin1(val).toLongLong(); @@ -366,7 +366,7 @@ QVariant QPSQLResult::data(int i) if (numericalPrecisionPolicy() != QSql::HighPrecision) { QVariant retval; bool convert; - double dbl=QString::fromAscii(val).toDouble(&convert); + double dbl=QString::fromLatin1(val).toDouble(&convert); if (numericalPrecisionPolicy() == QSql::LowPrecisionInt64) retval = (qlonglong)dbl; else if (numericalPrecisionPolicy() == QSql::LowPrecisionInt32) @@ -377,9 +377,9 @@ QVariant QPSQLResult::data(int i) return QVariant(); return retval; } - return QString::fromAscii(val); + return QString::fromLatin1(val); } - return QString::fromAscii(val).toDouble(); + return QString::fromLatin1(val).toDouble(); case QVariant::Date: if (val[0] == '\0') { return QVariant(QDate()); @@ -685,7 +685,7 @@ QPSQLDriver::Protocol QPSQLDriverPrivate::getPSQLVersion() PGresult* result = exec("select version()"); int status = PQresultStatus(result); if (status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK) { - QString val = QString::fromAscii(PQgetvalue(result, 0, 0)); + QString val = QString::fromLatin1(PQgetvalue(result, 0, 0)); QRegExp rx(QLatin1String("(\\d+)\\.(\\d+)")); rx.setMinimal(true); // enforce non-greedy RegExp @@ -1380,7 +1380,7 @@ void QPSQLDriver::_q_handleNotification(int) QString payload; #if defined PG_VERSION_NUM && PG_VERSION_NUM-0 >= 70400 if (notify->extra) - payload = d->isUtf8 ? QString::fromUtf8(notify->extra) : QString::fromAscii(notify->extra); + payload = d->isUtf8 ? QString::fromUtf8(notify->extra) : QString::fromLatin1(notify->extra); #endif emit notification(name); QSqlDriver::NotificationSource source = (notify->be_pid == PQbackendPID(d->connection)) ? QSqlDriver::SelfSource : QSqlDriver::OtherSource; |