From 68e0c5c69514648ee6fb28939f7dd5fc06fed2ad Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Date: Tue, 15 Jun 2010 22:51:37 +0200 Subject: [PATCH] move value() implementation down to ProFileEvaluator --- src/plugins/qt4projectmanager/profilereader.cpp | 10 ---------- src/plugins/qt4projectmanager/profilereader.h | 2 -- src/shared/proparser/profileevaluator.cpp | 9 +++++++++ src/shared/proparser/profileevaluator.h | 1 + 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/plugins/qt4projectmanager/profilereader.cpp b/src/plugins/qt4projectmanager/profilereader.cpp index 66fbc2f8b97..7eaa5157b9b 100644 --- a/src/plugins/qt4projectmanager/profilereader.cpp +++ b/src/plugins/qt4projectmanager/profilereader.cpp @@ -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) diff --git a/src/plugins/qt4projectmanager/profilereader.h b/src/plugins/qt4projectmanager/profilereader.h index 1019be7870a..3fec6307f1f 100644 --- a/src/plugins/qt4projectmanager/profilereader.h +++ b/src/plugins/qt4projectmanager/profilereader.h @@ -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); diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp index b18d06794a4..700c30b2c7f 100644 --- a/src/shared/proparser/profileevaluator.cpp +++ b/src/shared/proparser/profileevaluator.cpp @@ -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))); diff --git a/src/shared/proparser/profileevaluator.h b/src/shared/proparser/profileevaluator.h index 2fe48fc562f..239c4e1d0b2 100644 --- a/src/shared/proparser/profileevaluator.h +++ b/src/shared/proparser/profileevaluator.h @@ -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; -- GitLab