From 214caebbaba6a27b2cc848afe258ec7d14c167ce Mon Sep 17 00:00:00 2001 From: Jan Darmochwal Date: Wed, 6 Oct 2010 18:43:14 +0200 Subject: recursive globbing in VSession::readXmlDir() VSession::readXmlDir() now reads .xml files in subdirectories as well --- src/vsession.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/vsession.cpp b/src/vsession.cpp index bd86610..249594a 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -277,12 +277,16 @@ QList VSession::readXmlDir(const QString& path) { myFilterScript.close(); } else { - // iterate over all .xml files in directory path and read them - foreach (QFileInfo fi, QDir(path).entryInfoList(QStringList("*.xml"))) { - retval.append(readXmlFile(fi.absoluteFilePath())); + // iterate over all .xml files in directory (and sub-directories) + // and read them + QDirIterator di(path, + QDirIterator::Subdirectories | + QDirIterator::FollowSymlinks); + while(di.hasNext()) { + if (!di.next().endsWith(".xml")) continue; + retval.append(readXmlFile(di.fileInfo().absoluteFilePath())); } } - return retval; } -- cgit v1.2.3-55-g7522