inline resoveDepends()

that's common practice for the expand functions, and that one isn't even
particularly big

Change-Id: I66c22e11edb66bd00d211fc1282eb75f5dd4832d
Reviewed-on: http://codereview.qt.nokia.com/1456
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
This commit is contained in:
Oswald Buddenhagen 2011-07-11 17:44:27 +02:00 committed by Qt by Nokia
parent 1aa9affcf1
commit 0f32f596ea
2 changed files with 9 additions and 20 deletions

View File

@ -1821,20 +1821,6 @@ void calculateDeps(QStringList &sortedList, const QString &item, const QString &
}
}
QStringList
QMakeProject::resolveDepends(const QStringList &deps, const QString &prefix, bool resolve,
QMap<QString, QStringList> &place)
{
QStringList sortedList;
QStringList org = deps;
foreach(QString item, deps) {
calculateDeps(sortedList, item, prefix, org, resolve, place);
if (!resolve && org.isEmpty())
break;
}
return sortedList;
}
QStringList
QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
QMap<QString, QStringList> &place)
@ -2287,10 +2273,15 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list,
fprintf(stderr, "%s:%d: %s(var, prefix) requires one or two arguments.\n",
parser.file.toLatin1().constData(), parser.line_no, func.toLatin1().constData());
} else {
ret += resolveDepends(values(args[0], place),
(args.count() != 2 ? QString() : args[1]),
(func_t == E_RESOLVE_DEPENDS),
place);
bool resolve = (func_t == E_RESOLVE_DEPENDS);
QString prefix = (args.count() != 2 ? QString() : args[1]);
QStringList deps = values(args[0], place);
QStringList org = deps;
foreach(const QString &item, deps) {
calculateDeps(ret, item, prefix, org, resolve, place);
if (!resolve && org.isEmpty())
break;
}
}
break; }
default: {

View File

@ -107,8 +107,6 @@ class QMakeProject
QStringList doVariableReplaceExpand(const QString &str, QMap<QString, QStringList> &place, bool *ok=0);
void init(QMakeProperty *, const QMap<QString, QStringList> *);
QStringList &values(const QString &v, QMap<QString, QStringList> &place);
QStringList resolveDepends(const QStringList &deps, const QString &prefix, bool resolve,
QMap<QString, QStringList> &place);
void validateModes();
public: