From a54875057f3292799f1d9211ded7b7eb19ef3a39 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 23 Apr 2012 17:06:58 +0200 Subject: make a bunch of functions const values() and variables() get both const and non-const overloads Change-Id: Idfabea1acc488bf78f24edb831681ee07f0074c4 Reviewed-by: Mark Brand --- qmake/project.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'qmake/project.h') diff --git a/qmake/project.h b/qmake/project.h index e46c7440ee..171016e264 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -164,11 +164,13 @@ public: bool isActiveConfig(const QString &x, bool regex=false, QHash *place=NULL); - bool isSet(const QString &v) { return vars.contains(v); } - bool isEmpty(const QString &v); + bool isSet(const QString &v) const { return vars.contains(v); } + bool isEmpty(const QString &v) const; + QStringList values(const QString &v) const { return vars[v]; } QStringList &values(const QString &v) { return vars[v]; } - QString first(const QString &v); - int intValue(const QString &v, int defaultValue = 0); + QString first(const QString &v) const; + int intValue(const QString &v, int defaultValue = 0) const; + const QHash &variables() const { return vars; } QHash &variables() { return vars; } bool isRecursive() const { return recursive; } @@ -189,7 +191,7 @@ inline QString QMakeProject::projectFile() return pfile; } -inline QString QMakeProject::first(const QString &v) +inline QString QMakeProject::first(const QString &v) const { const QStringList vals = values(v); if(vals.isEmpty()) @@ -197,7 +199,7 @@ inline QString QMakeProject::first(const QString &v) return vals.first(); } -inline int QMakeProject::intValue(const QString &v, int defaultValue) +inline int QMakeProject::intValue(const QString &v, int defaultValue) const { const QString str = first(v); if (!str.isEmpty()) { -- cgit v1.2.3