summaryrefslogtreecommitdiffstats
path: root/qmake/project.h
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/project.h')
-rw-r--r--qmake/project.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/qmake/project.h b/qmake/project.h
index d458dd9..4e18fd0 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -156,6 +156,7 @@ public:
QStringList &values(const QString &v); // With compat mapping and magic variables
QString first(const QString &v); // ditto
QMap<QString, QStringList> &variables(); // No compat mapping and magic, obviously
+ int intValue(const QString &v, int defaultValue = 0); // ditto
bool isRecursive() const { return recursive; }
@@ -188,6 +189,18 @@ inline QString QMakeProject::first(const QString &v)
return vals.first();
}
+inline int QMakeProject::intValue(const QString &v, int defaultValue)
+{
+ const QString str = first(v);
+ if (!str.isEmpty()) {
+ bool ok;
+ int i = str.toInt(&ok);
+ if (ok)
+ return i;
+ }
+ return defaultValue;
+}
+
inline QMap<QString, QStringList> &QMakeProject::variables()
{ return vars; }