Commit 68e0c5c6 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

move value() implementation down to ProFileEvaluator

parent 3ef1bf0f
......@@ -87,16 +87,6 @@ QList<ProFile*> ProFileReader::includeFiles() const
return list;
}
QString ProFileReader::value(const QString &variable) const
{
const QStringList &vals = values(variable);
if (!vals.isEmpty())
return vals.first();
return QString();
}
void ProFileReader::fileMessage(const QString &message)
{
Q_UNUSED(message)
......
......@@ -51,8 +51,6 @@ public:
bool readProFile(const QString &fileName);
QList<ProFile*> includeFiles() const;
QString value(const QString &variable) const;
ProFile *proFileFor(const QString &name);
signals:
void errorFound(const QString &error);
......
......@@ -4080,6 +4080,15 @@ static QStringList expandEnvVars(const ProStringList &x)
return ret;
}
QString ProFileEvaluator::value(const QString &variable) const
{
const QStringList &vals = values(variable);
if (!vals.isEmpty())
return vals.first();
return QString();
}
QStringList ProFileEvaluator::values(const QString &variableName) const
{
return expandEnvVars(d->values(ProString(variableName)));
......
......@@ -90,6 +90,7 @@ public:
bool accept(ProFile *pro);
bool contains(const QString &variableName) const;
QString value(const QString &variableName) const;
QStringList values(const QString &variableName) const;
QStringList values(const QString &variableName, const ProFile *pro) const;
QStringList absolutePathValues(const QString &variable, const QString &baseDirectory) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment