diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-29 10:37:04 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-29 10:37:04 (GMT) |
commit | eaf85eb428bc1336c16187b5e4df61f63a19068c (patch) | |
tree | ea017ac92bea46c6ec10f75775c4a2d18330cf23 /util | |
parent | 429cd0ee393ad2eef9cea253f7e4dc8940e0cad7 (diff) | |
parent | 766cf07cbe7ebfda01dad163bb070fff7e3077d5 (diff) | |
download | Qt-eaf85eb428bc1336c16187b5e4df61f63a19068c.zip Qt-eaf85eb428bc1336c16187b5e4df61f63a19068c.tar.gz Qt-eaf85eb428bc1336c16187b5e4df61f63a19068c.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'util')
-rw-r--r-- | util/normalize/main.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/util/normalize/main.cpp b/util/normalize/main.cpp index 905c1ec..b16335e 100644 --- a/util/normalize/main.cpp +++ b/util/normalize/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ #include <qcoreapplication.h> -#include <qdir.h> +#include <qdiriterator.h> #include <qfile.h> #include <qmetaobject.h> #include <qstring.h> @@ -140,18 +140,14 @@ void check(const QString &fileName) void traverse(const QString &path) { - QDir dir(path); - dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoSymLinks); - - const QFileInfoList list = dir.entryInfoList(); - for (int i = 0; i < list.count(); ++i) { - const QFileInfo fi = list.at(i); - if (fi.fileName() == QLatin1String(".") || fi.fileName() == QLatin1String("..")) - continue; - if (fi.fileName().endsWith(".cpp")) - check(path + fi.fileName()); - if (fi.isDir()) - traverse(path + fi.fileName() + "/"); // recurse + QDirIterator dirIterator(path, QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::NoSymLinks); + + while (dirIterator.hasNext()) { + QString filePath = dirIterator.next(); + if (filePath.endsWith(".cpp")) + check(filePath); + else if (QFileInfo(filePath).isDir()) + traverse(filePath); // recurse } } |