summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppbaseprojectpartbuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CppTools/ProjectManagers: Reduce ui blocking when loading projectsNikolai Kosjar2017-02-201-308/+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: Report also C language back to projectNikolai Kosjar2017-02-061-3/+4
| | | | | | | ...for Project::setProjectLanguage(). Change-Id: I77347c4597061fb48782c629d5ad6898028fee13 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Unify projectexplorer language IDsUlf Hermann2017-01-301-1/+1
| | | | | | | | We don't need two IDs for C++ and the QmlJS ID should look the same as as the others. Change-Id: Ib9747f6b36a90bb652951d85eec69666615670c4 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Added support for registering custom languagesFilippo Cucchetto2017-01-231-2/+2
| | | | | Change-Id: I728a2ed1ef7d9f44d7c2b59d27d6e23444cd3bb5 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CppTools: Ensure that the C++ project part is the first oneNikolai Kosjar2016-12-141-14/+14
| | | | | | | | | | ...for a given file in the ambiguous case (CppModelManager::projectPart). There are several places where the first one will be preferred if there are multiple project parts associated with a project file. Change-Id: Ic01ea06277bc10f872238dcc181a55532b5783be Reviewed-by: David Schulz <david.schulz@qt.io>
* QMakeProjectManager: Use ProjectPartBuilderNikolai Kosjar2016-12-131-9/+9
| | | | | | | | | | ...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: Clean up ProjectPartNikolai Kosjar2016-12-131-1/+1
| | | | | Change-Id: Ia7969ceb52ffb25e7c63b24bc33b091001e9b50a Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Do not hardcode default language versionNikolai Kosjar2016-12-131-5/+5
| | | | | | | ...instead, use the latest we support. Change-Id: I7e7768bc4bc31de1fe0f441c03f3ab5d677d76e8 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Refactor ProjectPartBuilderNikolai Kosjar2016-12-131-0/+307
...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>