diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-06-24 17:24:16 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-06-27 15:34:29 +0000 |
commit | c2b26d91f7b7d3fe8ba10cffbb959cdd853b09d0 (patch) | |
tree | 2cd32ed9e476670207abdf28cedee470b63cc7cf /src | |
parent | aa3d90e751d552f7092bd548397032c950e9be1e (diff) |
Fix wildcard handling for subdirs
Task-number: QTCREATORBUG-16499
Change-Id: I262a9f6a6b0e900f8d53dda417ae26b964bd7609
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/jomlib/parser.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/jomlib/parser.cpp b/src/jomlib/parser.cpp index 25a3ccd..b7b5353 100644 --- a/src/jomlib/parser.cpp +++ b/src/jomlib/parser.cpp @@ -354,10 +354,17 @@ static bool containsWildcard(const QString &str) static QStringList expandWildcards(const QString &dirPath, const QStringList &lst) { QStringList result; - result.reserve(lst.count()); - foreach (const QString &str, lst) { + foreach (QString str, lst) { if (containsWildcard(str)) { - QDirIterator dit(dirPath, QStringList(str)); + QString path = dirPath; + str = QDir::fromNativeSeparators(str); + int idx = str.lastIndexOf(QLatin1Char('/')); + if (idx != -1) { + path += QLatin1Char('/') + str.left(idx); + str.remove(0, idx + 1); + } + + QDirIterator dit(path, QStringList(str)); while (dit.hasNext()) { QString filePath = dit.next(); if (filePath.startsWith(dirPath, Qt::CaseInsensitive)) { @@ -365,7 +372,7 @@ static QStringList expandWildcards(const QString &dirPath, const QStringList &ls if (filePath.startsWith(QLatin1Char('/'))) filePath.remove(0, 1); } - result.append(filePath); + result.append(QDir::toNativeSeparators(filePath)); } } else { result.append(str); |