summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorck <qt-info@nokia.com>2010-02-01 16:41:13 (GMT)
committerck <qt-info@nokia.com>2010-02-01 16:41:53 (GMT)
commitff8e8af2c16362ab0bbf7ea14bcdd83b711ebd46 (patch)
tree59e4ac0f82fa0be3ce8bf86942056e5e968beed5 /examples
parent296b2f47b652c0f200b19bf556649b56efa6f26f (diff)
downloadQt-ff8e8af2c16362ab0bbf7ea14bcdd83b711ebd46.zip
Qt-ff8e8af2c16362ab0bbf7ea14bcdd83b711ebd46.tar.gz
Qt-ff8e8af2c16362ab0bbf7ea14bcdd83b711ebd46.tar.bz2
Assistant: Use const references in foreach loops.
Reviewed-by: kh1
Diffstat (limited to 'examples')
-rw-r--r--examples/assistant/simpletextviewer/findfiledialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/assistant/simpletextviewer/findfiledialog.cpp b/examples/assistant/simpletextviewer/findfiledialog.cpp
index 939d90a..0f7bbae 100644
--- a/examples/assistant/simpletextviewer/findfiledialog.cpp
+++ b/examples/assistant/simpletextviewer/findfiledialog.cpp
@@ -119,7 +119,7 @@ void FindFileDialog::update()
void FindFileDialog::findFiles()
{
- QRegExp filePattern(fileNameComboBox->currentText() + "*");
+ QRegExp filePattern(fileNameComboBox->currentText() + '*');
filePattern.setPatternSyntax(QRegExp::Wildcard);
QDir directory(directoryComboBox->currentText());
@@ -127,7 +127,7 @@ void FindFileDialog::findFiles()
QStringList allFiles = directory.entryList(QDir::Files | QDir::NoSymLinks);
QStringList matchingFiles;
- foreach (QString file, allFiles) {
+ foreach (const QString &file, allFiles) {
if (filePattern.exactMatch(file))
matchingFiles << file;
}