diff options
author | ck <qt-info@nokia.com> | 2010-02-01 16:41:13 (GMT) |
---|---|---|
committer | ck <qt-info@nokia.com> | 2010-02-01 16:41:53 (GMT) |
commit | ff8e8af2c16362ab0bbf7ea14bcdd83b711ebd46 (patch) | |
tree | 59e4ac0f82fa0be3ce8bf86942056e5e968beed5 /tools/assistant/lib/qhelpcollectionhandler.cpp | |
parent | 296b2f47b652c0f200b19bf556649b56efa6f26f (diff) | |
download | Qt-ff8e8af2c16362ab0bbf7ea14bcdd83b711ebd46.zip Qt-ff8e8af2c16362ab0bbf7ea14bcdd83b711ebd46.tar.gz Qt-ff8e8af2c16362ab0bbf7ea14bcdd83b711ebd46.tar.bz2 |
Assistant: Use const references in foreach loops.
Reviewed-by: kh1
Diffstat (limited to 'tools/assistant/lib/qhelpcollectionhandler.cpp')
-rw-r--r-- | tools/assistant/lib/qhelpcollectionhandler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/assistant/lib/qhelpcollectionhandler.cpp b/tools/assistant/lib/qhelpcollectionhandler.cpp index fe0c417..cb7e457 100644 --- a/tools/assistant/lib/qhelpcollectionhandler.cpp +++ b/tools/assistant/lib/qhelpcollectionhandler.cpp @@ -252,7 +252,7 @@ bool QHelpCollectionHandler::createTables(QSqlQuery *query) "Key TEXT PRIMARY KEY, " "Value BLOB )"); - foreach (QString q, tables) { + foreach (const QString &q, tables) { if (!query->exec(q)) return false; } @@ -323,7 +323,7 @@ bool QHelpCollectionHandler::addCustomFilter(const QString &filterName, idsToInsert.removeAll(m_query.value(1).toString()); } - foreach (QString id, idsToInsert) { + foreach (const QString &id, idsToInsert) { m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); m_query.bindValue(0, id); m_query.exec(); @@ -346,7 +346,7 @@ bool QHelpCollectionHandler::addCustomFilter(const QString &filterName, m_query.bindValue(0, nameId); m_query.exec(); - foreach (QString att, attributes) { + foreach (const QString &att, attributes) { m_query.prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); m_query.bindValue(0, nameId); m_query.bindValue(1, attributeMap[att]); @@ -400,7 +400,7 @@ bool QHelpCollectionHandler::registerDocumentation(const QString &fileName) return false; addFilterAttributes(reader.filterAttributes()); - foreach (QString filterName, reader.customFilters()) + foreach (const QString &filterName, reader.customFilters()) addCustomFilter(filterName, reader.filterAttributes(filterName)); optimizeDatabase(fileName); @@ -499,7 +499,7 @@ bool QHelpCollectionHandler::addFilterAttributes(const QStringList &attributes) while (m_query.next()) atts.insert(m_query.value(0).toString()); - foreach (QString s, attributes) { + foreach (const QString &s, attributes) { if (!atts.contains(s)) { m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); m_query.bindValue(0, s); |