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/qhelpgenerator.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/qhelpgenerator.cpp')
-rw-r--r-- | tools/assistant/lib/qhelpgenerator.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/assistant/lib/qhelpgenerator.cpp b/tools/assistant/lib/qhelpgenerator.cpp index 324f67d..4b94ebf 100644 --- a/tools/assistant/lib/qhelpgenerator.cpp +++ b/tools/assistant/lib/qhelpgenerator.cpp @@ -203,7 +203,7 @@ bool QHelpGenerator::generate(QHelpDataInterface *helpData, addProgress(1.0); emit statusChanged(tr("Insert custom filters...")); - foreach (QHelpDataCustomFilter f, helpData->customFilters()) { + foreach (const QHelpDataCustomFilter &f, helpData->customFilters()) { if (!registerCustomFilter(f.name, f.filterAttributes, true)) { cleanupDB(); return false; @@ -367,7 +367,7 @@ bool QHelpGenerator::createTables() "Name Text, " "Value BLOB )"); - foreach (QString q, tables) { + foreach (const QString &q, tables) { if (!d->query->exec(q)) { d->error = tr("Cannot create tables!"); return false; @@ -629,7 +629,7 @@ bool QHelpGenerator::registerCustomFilter(const QString &filterName, idsToInsert.removeAll(d->query->value(1).toString()); } - foreach (QString id, idsToInsert) { + foreach (const QString &id, idsToInsert) { d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); d->query->bindValue(0, id); d->query->exec(); @@ -664,7 +664,7 @@ bool QHelpGenerator::registerCustomFilter(const QString &filterName, d->query->bindValue(0, nameId); d->query->exec(); - foreach (QString att, filterAttribs) { + foreach (const QString &att, filterAttribs) { d->query->prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); d->query->bindValue(0, nameId); d->query->bindValue(1, attributeMap[att]); @@ -687,7 +687,7 @@ bool QHelpGenerator::insertKeywords(const QList<QHelpDataIndexItem> keywords, indexId = d->query->value(0).toInt() + 1; QList<int> filterAtts; - foreach (QString filterAtt, filterAttributes) { + foreach (const QString &filterAtt, filterAttributes) { d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable WHERE Name=?")); d->query->bindValue(0, filterAtt); d->query->exec(); @@ -704,7 +704,7 @@ bool QHelpGenerator::insertKeywords(const QList<QHelpDataIndexItem> keywords, int i = 0; d->query->exec(QLatin1String("BEGIN")); - foreach (QHelpDataIndexItem itm, keywords) { + foreach (const QHelpDataIndexItem &itm, keywords) { pos = itm.reference.indexOf(QLatin1Char('#')); fileName = itm.reference.left(pos); if (pos > -1) @@ -773,7 +773,7 @@ bool QHelpGenerator::insertContents(const QByteArray &ba, } // associate the filter attributes - foreach (QString filterAtt, filterAttributes) { + foreach (const QString &filterAtt, filterAttributes) { d->query->prepare(QLatin1String("INSERT INTO ContentsFilterTable (FilterAttributeId, ContentsId) " "SELECT Id, ? FROM FilterAttributeTable WHERE Name=?")); d->query->bindValue(0, contentId); @@ -798,7 +798,7 @@ bool QHelpGenerator::insertFilterAttributes(const QStringList &attributes) while (d->query->next()) atts.insert(d->query->value(0).toString()); - foreach (QString s, attributes) { + foreach (const QString &s, attributes) { if (!atts.contains(s)) { d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); d->query->bindValue(0, s); |