From 703ef4f79edb30b8cf90c5bb62b1adf7acba55ff Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 3 Feb 2012 18:34:56 +0100 Subject: make QMakeProject's copy c'tor actually behave like one instead of initializing base_vars with the original's vars, initialize vars itself. this has two consequences: - there is no need to call read(0) to initialize vars - one cannot usefully call the complex read() anymore, as that would re-initialize vars from base_vars this is much closer to an actual copy than the previous "seeding with existing project". Change-Id: Ib007bc5b779aedb680a27329aa578f7c604a4308 Reviewed-by: Joerg Bornemann Reviewed-by: Marius Storm-Olsen --- qmake/project.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qmake/project.cpp') diff --git a/qmake/project.cpp b/qmake/project.cpp index ecd31d5234..7f73b1f56f 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -627,10 +627,11 @@ QMakeProject::init(QMakeProperty *p) reset(); } -QMakeProject::QMakeProject(QMakeProject *p, const QHash *vars) +// Duplicate project. It is *not* allowed to call the complex read() functions on the copy. +QMakeProject::QMakeProject(QMakeProject *p, const QHash *_vars) { init(p->properties()); - base_vars = vars ? *vars : p->variables(); + vars = _vars ? *_vars : p->variables(); for(QHash::iterator it = p->replaceFunctions.begin(); it != p->replaceFunctions.end(); ++it) { it.value()->ref(); replaceFunctions.insert(it.key(), it.value()); -- cgit v1.2.3