diff options
author | axis <qt-info@nokia.com> | 2009-06-29 12:25:09 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-06-29 12:25:09 (GMT) |
commit | 1a8c89e9eaec05e9f38eae4fbc007d8344015de3 (patch) | |
tree | d87e517cfab9443926841b3ef92ca715a717f54a /src/sql/drivers/sqlite2/qsql_sqlite2.cpp | |
parent | 78166d5235a5045fdc887febe01d789cac333bb3 (diff) | |
parent | b6171cfbe3b1453a2c46f78db0df4819e4e5e54f (diff) | |
download | Qt-1a8c89e9eaec05e9f38eae4fbc007d8344015de3.zip Qt-1a8c89e9eaec05e9f38eae4fbc007d8344015de3.tar.gz Qt-1a8c89e9eaec05e9f38eae4fbc007d8344015de3.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts:
.gitignore
src/gui/dialogs/qfiledialog_p.h
src/gui/painting/qpaintengine_raster.cpp
src/gui/text/qfontdatabase.cpp
tests/auto/network-settings.h
tests/auto/qitemdelegate/tst_qitemdelegate.cpp
Diffstat (limited to 'src/sql/drivers/sqlite2/qsql_sqlite2.cpp')
-rw-r--r-- | src/sql/drivers/sqlite2/qsql_sqlite2.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp index d0c6e18..76bef08 100644 --- a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp +++ b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtSql module of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -167,15 +167,7 @@ void QSQLite2ResultPrivate::init(const char **cnames, int numCols) for (int i = 0; i < numCols; ++i) { const char* lastDot = strrchr(cnames[i], '.'); const char* fieldName = lastDot ? lastDot + 1 : cnames[i]; - - //remove quotations around the field name if any - QString fieldStr = QString::fromAscii(fieldName); - QString quote = QString::fromLatin1("\""); - if ( fieldStr.length() > 2 && fieldStr.left(1) == quote && fieldStr.right(1) == quote) { - fieldStr = fieldStr.mid(1); - fieldStr.chop(1); - } - rInf.append(QSqlField(fieldStr, + rInf.append(QSqlField(QString::fromAscii(fieldName), nameToType(QString::fromAscii(cnames[i+numCols])))); } } @@ -511,11 +503,8 @@ QSqlIndex QSQLite2Driver::primaryIndex(const QString &tblname) const QSqlQuery q(createResult()); q.setForwardOnly(true); - QString table = tblname; - if (isIdentifierEscaped(table, QSqlDriver::TableName)) - table = stripDelimiters(table, QSqlDriver::TableName); // finrst find a UNIQUE INDEX - q.exec(QLatin1String("PRAGMA index_list('") + table + QLatin1String("');")); + q.exec(QLatin1String("PRAGMA index_list('") + tblname + QLatin1String("');")); QString indexname; while(q.next()) { if (q.value(2).toInt()==1) { @@ -528,7 +517,7 @@ QSqlIndex QSQLite2Driver::primaryIndex(const QString &tblname) const q.exec(QLatin1String("PRAGMA index_info('") + indexname + QLatin1String("');")); - QSqlIndex index(table, indexname); + QSqlIndex index(tblname, indexname); while(q.next()) { QString name = q.value(2).toString(); QVariant::Type type = QVariant::Invalid; @@ -543,9 +532,6 @@ QSqlRecord QSQLite2Driver::record(const QString &tbl) const { if (!isOpen()) return QSqlRecord(); - QString table = tbl; - if (isIdentifierEscaped(tbl, QSqlDriver::TableName)) - table = stripDelimiters(table, QSqlDriver::TableName); QSqlQuery q(createResult()); q.setForwardOnly(true); |