forked from qt-creator/qt-creator
make $$files() qmake-compliant again
unfortunately, the efforts to use only absolute paths internally became externally visible ...
This commit is contained in:
@@ -2192,27 +2192,32 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
|
|||||||
if (args.count() == 2)
|
if (args.count() == 2)
|
||||||
recursive = (!args[1].compare(statics.strtrue, Qt::CaseInsensitive) || args[1].toInt());
|
recursive = (!args[1].compare(statics.strtrue, Qt::CaseInsensitive) || args[1].toInt());
|
||||||
QStringList dirs;
|
QStringList dirs;
|
||||||
QString r = fixPathToLocalOS(resolvePath(args[0]));
|
QString r = fixPathToLocalOS(args[0]);
|
||||||
|
QString pfx;
|
||||||
|
if (IoUtils::isRelativePath(r)) {
|
||||||
|
pfx = currentDirectory();
|
||||||
|
if (!pfx.endsWith(QLatin1Char('/')))
|
||||||
|
pfx += QLatin1Char('/');
|
||||||
|
}
|
||||||
int slash = r.lastIndexOf(QDir::separator());
|
int slash = r.lastIndexOf(QDir::separator());
|
||||||
if (slash != -1) {
|
if (slash != -1) {
|
||||||
dirs.append(r.left(slash));
|
dirs.append(r.left(slash));
|
||||||
r = r.mid(slash+1);
|
r = r.mid(slash+1);
|
||||||
} else {
|
} else {
|
||||||
dirs.append(fixPathToLocalOS(currentDirectory()));
|
dirs.append(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
const QRegExp regex(r, Qt::CaseSensitive, QRegExp::Wildcard);
|
const QRegExp regex(r, Qt::CaseSensitive, QRegExp::Wildcard);
|
||||||
for (int d = 0; d < dirs.count(); d++) {
|
for (int d = 0; d < dirs.count(); d++) {
|
||||||
QString dir = dirs[d];
|
QString dir = dirs[d];
|
||||||
if (!dir.endsWith(QDir::separator()))
|
QDir qdir(pfx + dir);
|
||||||
|
if (!dir.isEmpty() && !dir.endsWith(QDir::separator()))
|
||||||
dir += QDir::separator();
|
dir += QDir::separator();
|
||||||
|
|
||||||
QDir qdir(dir);
|
|
||||||
for (int i = 0; i < (int)qdir.count(); ++i) {
|
for (int i = 0; i < (int)qdir.count(); ++i) {
|
||||||
if (qdir[i] == statics.strDot || qdir[i] == statics.strDotDot)
|
if (qdir[i] == statics.strDot || qdir[i] == statics.strDotDot)
|
||||||
continue;
|
continue;
|
||||||
QString fname = dir + qdir[i];
|
QString fname = dir + qdir[i];
|
||||||
if (IoUtils::fileType(fname) == IoUtils::FileIsDir) {
|
if (IoUtils::fileType(pfx + fname) == IoUtils::FileIsDir) {
|
||||||
if (recursive)
|
if (recursive)
|
||||||
dirs.append(fname);
|
dirs.append(fname);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user