summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppbaseprojectpartbuilder.h
Commit message (Collapse)AuthorAgeFilesLines
* CppTools/ProjectManagers: Reduce ui blocking when loading projectsNikolai Kosjar2017-02-201-83/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ${AnyProject}::updateCppCodeModel() did two potentially not that cheap operations in the ui thread: (1) Querying the MimeDatabase for the mime type for the source files of the project. In 99.9% of the cases no files need to be read for this as the file extension will resolve the type. The expensiveness comes from the sheer number of files that can occur. (2) Calling compilers with the "(sub)project's compiler command line" to determine the macros. While the caches avoid redundant calls, the number of the unique compiler calls makes this still a ui-freezing experience. These two operations are moved into a worker thread. For this, the expensive compiler calls are encapsulated in thread safe lambdas ("runners") in order to keep the "mutexed" data minimal. The original API calls of the toolchains are implemented in terms of the runners. While adapting the project managers, remove also the calls to setProjectLanguage(). These are redundant because all of the project managers already set a proper value in the constructor. Also, currently there is no need (client) to report back detection of C sources in project parts. This also keeps CppProjectUpdater simple. There is still room for improvement: * Run the compiler calls in parallel instead of sequence. * Ensure that the mime type for a file is determined exactly once. Change-Id: I2efc4e132ee88e3c8f264012ec8fafe3d86c404f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CppTools: Remove excess includeNikolai Kosjar2017-01-301-2/+0
| | | | | Change-Id: Idacd899a206f17f0b023fb7ad0a3b4406d5edbea Reviewed-by: David Schulz <david.schulz@qt.io>
* QMakeProjectManager: Use ProjectPartBuilderNikolai Kosjar2016-12-131-3/+2
| | | | | | | | | | ...as the other project managers. This removes extra code paths, duplication and improves classification of source files (ambiguous headers). Change-Id: Iae05cbbc61ab2e5dd841ae617bec994e0a1e52d5 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CppTools: Refactor ProjectPartBuilderNikolai Kosjar2016-12-131-0/+86
...and add some basic tests. Introduce the abstractions ProjectInterface and ToolChainInterface in order to break the dependency to the ProjectExplorer. Also, some simple logic can go there to simplify the (Base)ProjectPartBuilder. Change-Id: I6c50a1804ce62098b87109931eb171f5c2542937 Reviewed-by: David Schulz <david.schulz@qt.io>