From 82430a6b37d1d2cecc6aa1358650c352163cc230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 10 Mar 2011 22:47:49 +0100 Subject: [PATCH] Generic project: Made C++ code model work better without a tool chain When no valid tool chain is selected, no project info update was done at all. After this patch, at least the project defines and include paths are used. Reviewed-by: Roberto Raggi --- .../genericprojectmanager/genericproject.cpp | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 841e5474860..7f2545d79a6 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -207,28 +207,23 @@ void GenericProject::refresh(RefreshOptions options) CPlusPlus::CppModelManagerInterface *modelManager = CPlusPlus::CppModelManagerInterface::instance(); - if (m_toolChain && modelManager) { - const QByteArray predefinedMacros = m_toolChain->predefinedMacros(); - + if (modelManager) { CPlusPlus::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this); - pinfo.defines = predefinedMacros; - pinfo.defines += '\n'; - pinfo.defines += m_defines; - QStringList allIncludePaths; - QStringList allFrameworkPaths; + if (m_toolChain) { + pinfo.defines = m_toolChain->predefinedMacros(); + pinfo.defines += '\n'; - foreach (const HeaderPath &headerPath, m_toolChain->systemHeaderPaths()) { - if (headerPath.kind() == HeaderPath::FrameworkHeaderPath) - allFrameworkPaths.append(headerPath.path()); - else - allIncludePaths.append(headerPath.path()); + foreach (const HeaderPath &headerPath, m_toolChain->systemHeaderPaths()) { + if (headerPath.kind() == HeaderPath::FrameworkHeaderPath) + pinfo.frameworkPaths.append(headerPath.path()); + else + pinfo.includePaths.append(headerPath.path()); + } } - allIncludePaths += this->allIncludePaths(); - - pinfo.frameworkPaths = allFrameworkPaths; - pinfo.includePaths = allIncludePaths; + pinfo.includePaths += allIncludePaths(); + pinfo.defines += m_defines; // ### add _defines. pinfo.sourceFiles = files();