From 14bf7ef504c63f783a0a7be6d6f4354946891e31 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 20 Jul 2012 15:31:14 +0200 Subject: inline MakefileGenerator::processPrlVariable() the visitor-pattern like approach is not needed any more Change-Id: I990db681cbeee91d89ecba97745a8104595247e7 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 24 ++++++------------------ qmake/generators/makefile.h | 1 - 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 497b77b800..f92ae3918a 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -896,9 +896,12 @@ MakefileGenerator::processPrlFile(QString &file) debug_msg(2, "Ignored meta file %s [%s]", real_meta_file.toLatin1().constData(), libinfo.type().toLatin1().constData()); } else { ret = true; - QHash &vars = libinfo.variables(); - for(QHash::Iterator it = vars.begin(); it != vars.end(); ++it) - processPrlVariable(it.key(), it.value()); + project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS"); + QStringList &defs = project->values("DEFINES"); + const QStringList &prl_defs = project->values("PRL_EXPORT_DEFINES"); + foreach (const QString &def, libinfo.values("QMAKE_PRL_DEFINES")) + if (!defs.contains(def) && prl_defs.contains(def)) + defs.append(def); if(try_replace_file && !libinfo.isEmpty("QMAKE_PRL_TARGET")) { QString dir; int slsh = real_meta_file.lastIndexOf(Option::dir_sep); @@ -940,21 +943,6 @@ MakefileGenerator::filterIncludedFiles(const QString &var) } } -void -MakefileGenerator::processPrlVariable(const QString &var, const QStringList &l) -{ - if(var == "QMAKE_PRL_LIBS") { - project->values("QMAKE_CURRENT_PRL_LIBS") += l; - } else if(var == "QMAKE_PRL_DEFINES") { - QStringList &out = project->values("DEFINES"); - for(QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { - if(out.indexOf((*it)) == -1 && - project->values("PRL_EXPORT_DEFINES").indexOf((*it)) == -1) - out.append((*it)); - } - } -} - void MakefileGenerator::processPrlFiles() { diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 611430a646..118e6e7ece 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -213,7 +213,6 @@ protected: QString prlFileName(bool fixify=true); void writePrlFile(); bool processPrlFile(QString &); - void processPrlVariable(const QString &, const QStringList &); virtual void processPrlFiles(); virtual void writePrlFile(QTextStream &); -- cgit v1.2.3