aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/project.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Do not enter edit mode when opening a .qmlproject as QDSThomas Hartmann2022-02-071-0/+5
| | | | | | | | | | | | If the user opens a .qmlproject in QDS mode we do not want to enter the edit mode by default. We check the startup project after opening and calling openEditMode() will determine if we keep the default of opening the edit mode or not. Change-Id: Ic8a7fbefa007d487ec680099544c07fe007c0b29 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ProjectExplorer: Prevent cascading "Replacement for" kit namesChristian Kandeler2021-10-201-2/+3
| | | | | | Fixes: QTCREATORBUG-26330 Change-Id: Id7abd00afb70fe2d2e3c1a43e2ea1298c0ff20cc Reviewed-by: David Schulz <david.schulz@qt.io>
* Don't call DocumentManager::addDocument() from non-main threadJarek Kobus2021-10-201-1/+2
| | | | | | | | | | | | | | | | | | | | Detect that constructor of ResourceTopLevelNode is being run from non-main thread and omit creation of ResourceFileWatcher in this case. The construction of ResourceFileWatcher will be postponed until the node tree returns back to the main thread. This happens later inside Project::setRootProjectNode() when ProjectTree::applyTreeManager() is called for the second time - this time it's done from the main thread. In order to setup the lacking resource file watchers we install an additional folder node visitor only in case when the handler is called from main thread. The visitor sets up the lacking resource watchers if that's still needed. Amends: 0bcab32657f1511892eda53194dce259e40edf21 Fixes: QTCREATORBUG-26417 Change-Id: Ia1bfb7f284afb833b6b4291accc4d0a91bd0d6c5 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix build with C++20Eike Ziller2021-10-191-1/+1
| | | | | | | | | | | "erase" without namespace conflicts with std::erase, with the latter taking precedence. Amends 9929d3dd7332ae6509e53c60d60b7f053e7ec92f Fixes: QTCREATORBUG-26386 Change-Id: I7fa64827ad61f1da262ce48082854975bc431c69 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Give build systems a nameChristian Kandeler2021-09-091-0/+1
| | | | | | | | ... and make it accessible through a variable. Fixes: QTCREATORBUG-26147 Change-Id: I0601c09a74360b91fe8421876207a8f4ae9d75b6 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: prevent using QFileInfo on remote pathsDavid Schulz2021-09-091-1/+1
| | | | | Change-Id: Icf5dc9a80af69e8e1c3d733847e227486fa8c897 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: De-noise project.cpphjk2021-08-261-147/+129
| | | | | | | Namespaces, some inlining. Change-Id: Ib6e8e0440e69492c1f486ae0358d8d59bafbfefb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Streamline access to buildDirectoryTemplate datahjk2021-08-241-6/+4
| | | | | | | There's only one kind of use, in the context of BuildConfiguration. Change-Id: I09628ff443ef08e28738125a614c17d5d979189b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Pass dialog parent to Utils::* file dialoghjk2021-08-171-0/+1
| | | | | | | | | | | | | Amends 3edc5673b58e55. Turns out quite a few potential uses have other parents than ICore::dialogParent(). Use a nullptr parent to mean ICore::dialogParent() to keep the caller side simple. Change-Id: Icfe1daafd710ae273d286679e0c8e2a3a27da552 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Introduce a FilePath constructor from char arrayshjk2021-08-171-2/+2
| | | | | | | | | | | | Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for decorations in user code. At the same time, drop some convenience constructors and functions in CommandLine and Icon essentially serving the same purpose. Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Use the new file dialog wrappers in some placeshjk2021-08-061-6/+4
| | | | | Change-Id: I326c883f2f76593e6fcb0f3e376d387273312982 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Use FilePath in ProjectExplorer::openProject{,s}()hjk2021-07-271-2/+1
| | | | | Change-Id: Ibfb7ab5ef7226b85452bd37b840408708935453b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectTree: Improve performance of finding nodesEike Ziller2021-07-141-1/+1
| | | | | | | | | | Using projectNode->forEachGenericNode(...) to find a node is much slower than using project->nodeForFilePath(...), since the latter uses a binary search. Fixes: QTCREATORBUG-25845 Change-Id: I91be577a11b03915d1f21fe86a4cdd9ab0381f51 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Project: Remove knowsAllBuildExecutables featureCristian Adam2021-07-011-11/+0
| | | | | | | | | | This is feature is no longer needed. Change-Id: Ia0798402fcb4c06fb4dd38225359738306211176 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org> Reviewed-by: hjk <hjk@qt.io>
* Avoid registering individual files for watchingEike Ziller2021-06-111-3/+6
| | | | | | | | | | | if we can do it en bloc. This reduces the freeze happening after loading a project, at least on macOS with QFSEventsFileSystemWatcher, which doesn't like getting 1000 files added one by one. Task-number: QTCREATORBUG-25783 Change-Id: I2d508ac3334520cb8805a2179d42b86c9ba840d6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Core: Add FilePath based overloads to EditorManager::openEditor{,at}hjk2021-05-251-1/+1
| | | | | | | | | | Part of the overall FilePath migration. Keep the original version for a while to allow using code to catch up. Change-Id: Ia7c5ea14416a06e679e8661c0e4045981db87b9b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Revert "Revert "Merge remote-tracking branch 'origin/4.15'""Eike Ziller2021-05-071-0/+18
| | | | | | | | | | | This reverts commit f0a86d45104f585b7aeef07fcc68cea24061aedb. Reverting a merge doesn't "undo" it - the changes would be lost forever even with subsequent merges. So we need to revert the revert to get the changes. Change-Id: I65928f876f4dc886561bed17c4b2aa42b388c1e3 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Revert "Merge remote-tracking branch 'origin/4.15'"Marco Bubke2021-05-061-18/+0
| | | | | | | | | This reverts commit 888ca0dd20ff647970fc85340e108cfa34d78c3a. Reason for revert: wrong patchset Change-Id: I1291789938601aaf606c59917ff938e3c24c78dd Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Merge remote-tracking branch 'origin/4.15'Tim Jenssen2021-05-061-0/+18
|\ | | | | | | | | | | | | | | Conflicts: src/libs/sqlite/sqlitebasestatement.h src/plugins/qmldesigner/qmldesignerplugin.cpp Change-Id: I0fa0a8a7feffed24c0d2bc26eca86590f1156755
| * ProjectExplorer: Enable to easily check if a project has dirty filesTapani Mattila2021-05-051-0/+18
| | | | | | | | | | | | | | Task-number: QDS-4241 Change-Id: I2fec5f411cdff9fabfa31bbd73971c0308df0783 Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Prevent target switch on project that's to be removedChristian Kandeler2021-05-061-1/+71
|/ | | | | | | | | | | | Switching targets starts up a lot of machinery that is undesired for a project that's going away. The same goes for switching build configurations on a target that is being removed. Fixes: QTCREATORBUG-25655 Change-Id: I0cb6e395cca8f89bfeb70fcdf571bbcb64f94247 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QmakeProjectManager: Fix possible crash on project document reloadChristian Kandeler2021-04-131-0/+19
| | | | | | | | | ... while a parse is going on. Fixes: QTCREATORBUG-25137 Change-Id: I02a914332ef120caee044139581e1901b4537bff Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Aspects: Remove some more default valuesOrgad Shaneh2020-11-101-1/+2
| | | | | Change-Id: Iadee8b8f1eeb3ff009a667d45a51f6f5a94329ca Reviewed-by: hjk <hjk@qt.io>
* Project explorer: Fix UI textLeena Miettinen2020-11-091-1/+1
| | | | | | | | Fix punctuation. Task-number: QTCREATORBUG-24873 Change-Id: I5cc5e80915b891efa2cd2268e3302feb39b7a576 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* projectexplorer: avoid crash if recovery of kit failsFawzi Mohamed2020-09-291-0/+1
| | | | | Change-Id: I8bf3a24b1485da2bfd1eb13e61c2712b66b30a70 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmakeProjectManager: Fix crash on reparsingChristian Kandeler2020-09-281-1/+6
| | | | | | | | | | | | | After a re-parse, the existing IDocuments need to be updated with the new QmakePriFile object, as the old one may no longer be valid and thus cause a crash on the next re-parse. Amends f3bd07efd1. Fixes: QTCREATORBUG-24683 Change-Id: Ib03d3005cb7831f1e05cb116aa3cdfe6cf5e72ad Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Remove replacement kitsChristian Kandeler2020-09-211-0/+1
| | | | | | | | | ... for which the original kit has turned up again. Otherwise we'd have more than one kit with the same id. Fixes: QTCREATORBUG-24589 Change-Id: I7ce16615694d3d2c5a5441f676ecb7dc85c2239c Reviewed-by: David Schulz <david.schulz@qt.io>
* QmakeProjectManager: Restore incremental re-parsingChristian Kandeler2020-09-151-4/+23
| | | | | | | | | | | This was broken in commit 37aecdd112, where we overlooked that a special type of IDocument was used that triggers a re-parse of only the affected part of the project tree. As a result, all changes to a .pri or .pro file would trigger a re-parse of the entire project. Fixes: QTCREATORBUG-24572 Change-Id: I480cff4e53cf86a17e1eaac0eb9b32901bc87051 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/qds-1.59' into 4.13Tim Jenssen2020-08-131-0/+15
|\ | | | | | | Change-Id: Ic720f3adab305c5ef8cd10e713ccabf510eff0c0
| * projectexplorer: add availableQmlPreviewTranslations()Tim Jenssen2020-07-151-0/+15
| | | | | | | | | | | | | | Preparation for a test translations feature. Change-Id: I1a7ccecab803f5838cd765b7dca99bcf5bb9e8a1 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Core/Utils: Migrate further to Utils::Idhjk2020-07-061-11/+11
| | | | | | | | | | | | | | | | The coreplugin/id.h header is kept for downstream for now. Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66 (cherry picked from commit 430a33dcd9ac80ddb848e41f8f059102857c88aa) Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Fix plugin unit tests when using projectsChristian Stenger2020-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ClangTools and the AutoTest plugins use an internal mechanism to load and configure a project when performing their integrated unit tests. Both assumed to have exactly one kit present for these tests. Make it possible to have more kits present when starting with existing settings or if more kits get automatically generated when starting with clean settings. Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Use dialogParent() instead of mainWindow()Eike Ziller2020-06-021-6/+6
| | | | | | | | | | | | | | | | | | | | There are very few reasons to use mainWindow() directly. Especially for modal dialogs, using dialogParent() is important, since that guarantees the stacking order in case of other dialogs currently being open. Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6 Reviewed-by: hjk <hjk@qt.io>
* | ProjectExplorer: Try harder not to lose custom project settingsChristian Kandeler2020-03-191-2/+19
|/ | | | | | | | | | | | | | | | ... when a kit disappears. This can easily happen, for instance due to a Qt version update via the installer, and until now resulted in the disappearance of all user customizations of build and run configurations. We now store some additional data when serializing a target, and use it to recreate a kit of the same type upon restoring. While the resulting configurations are not guaranteed to be functional, they should contain all the customizations, which the user can then copy over to a proper kit. Fixes: QTCREATORBUG-23023 Change-Id: I659d52808b2f8a308e6aa094e8ef2ee60d586952 Reviewed-by: hjk <hjk@qt.io>
* QmakeProjectManager: Try harder not to access nodes of in-parse projectChristian Kandeler2020-03-051-1/+1
| | | | | | | | | | | For extra safety, do not touch the project nodes if any build system of any build configuration is currently parsing. This is a bit of a stab in the dark, as I cannot reproduce the crash described in the linked bug report. Task-number: QTCREATORBUG-23597 Change-Id: Ie62a94232e89d8fba5866ea3572535e2ab209924 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Pass extra project files as QSethjk2020-03-031-2/+2
| | | | | | | They are available in some cases as such, and consumed as such. Change-Id: I9866c7d7bd817fb19a8b11a0efbe583ed55fe393 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Fix Project::setExtraProjectFiles()Christian Kandeler2020-03-021-2/+2
| | | | | | | | This function was buggy and could erroneously un-watch all the project files after the first update. Change-Id: I528fd8da7f873598e08f4c0177757a052fbb97ef Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Replace a few foreach()hjk2020-03-021-3/+3
| | | | | Change-Id: I445cdfaac13ac894be3cd6fc8c20b4a09f460a01 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Simplify update logic after active target changehjk2020-03-021-0/+1
| | | | | Change-Id: Ia1d9366b1f2ff2b7ae02604bc43b38ca4b914c17 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Introduce BuildSystem::parsingStarted/Finishedhjk2020-02-121-4/+4
| | | | | | | | Some listeners are only interested in a particular build system instance, not all of one target. Change-Id: Id89bd96c1f7f68bac13886bdc31cb899978d76ac Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* TargetSetupPage: Improve reporting on invalid kitsTobias Hunger2020-02-061-27/+0
| | | | | | | | | | | | | Give the reason for a kit being disabled in the tooltip. E.g. for a CMake project you will now get "Kit is invalid: No CMake tool set." instead of a generic error message about the kit being invalid. Change-Id: Ic776dc24149d65ebf27163b605ec2e52a3a504a7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Use different build dir when copying build configChristian Kandeler2020-01-161-0/+7
| | | | | | | | | | ...into another target. Using the same build directory in two different targets will likely lead to errors. Fixes: QTCREATORBUG-23462 Change-Id: I7daa510b3128a344adb51772d44a79415419acc3 Reviewed-by: hjk <hjk@qt.io>
* ClangTools: Attach ClangToolsProjectSettings data to project itselfhjk2020-01-141-0/+12
| | | | | | | Easier to reason about life time. Change-Id: I2c61527532f6faa344fc59d858921e66daaf0b7e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Move some of the BuildInfo setup code to central placeshjk2020-01-141-2/+2
| | | | | Change-Id: I8893366acb187ea1a94a8ca272ded2c46cb521d1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename FilePathList to simply FilePathshjk2019-12-181-4/+4
| | | | | | | The exact storage type does not really matter here. Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ProjectExplorer: Let users provide project-specific environmentChristian Kandeler2019-12-121-0/+13
| | | | | | | | | Add a new project panel where users can set environment variables for the current project in all configurations. Fixes: QTCREATORBUG-21862 Change-Id: Id98c7f1cf579927a8004a63172f193f943556f44 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Settle on fixed set of build step listshjk2019-12-061-3/+1
| | | | | | | | | | | | Even if the implementation allowed different lists than 'build' and 'clean', that's the only set that has been used, ever. If really needed, this could be re-instated, but for now having them fixed removes part of the neeed for a two-phase construction and helps to simplify user code. Change-Id: I3df09a1829a7d020ef8963d358ea80f8d199ba13 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Move BuildSystem owership to BuildConfigurationhjk2019-11-191-97/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... or Target. This patch moves build system from conceptually "one per project" to "one per target (i.e. per project-and-kit)" or "per BuildConfigurations" for targets where the builds differ significantly. Building requires usually items from the kit (Qt version, compiler, ...) so a target-agnostic build is practically almost always wrong. Moving the build system to the target also has the potential to solve issues caused by switching targets while parsing, that used Project::activeTarget() regularly, with potentially different results before and after the switch. This patch might create performance/size regressions when several targets are set up per project as the build system implementation's internal data are duplicated in this case. The idea is to fix that by sharing per-project pieces again in the project implementation once these problems occur. Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Use a functor for BuildSystem creationhjk2019-10-251-3/+2
| | | | | | | | | | ... instead of creating the BuildSystem direct. This will help the shift of BuildSystem owner ship as a Project will have potentially multiple BuildSystem instances (one per BuildConfiguration), but still be responsible for creating them with the Targets. Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Do not return early on parsingFinished asserthjk2019-10-221-1/+3
| | | | | | | | | | | | | | | This is a hack, not a proper solution. In theory, this here should serve as a lock. We currently get start - start - finish - finish sequences when switching qmake targets quickly, keeping the run button disabled. The whole setup here is unfortunate. Parsing inherently depend on more than the project alone, it's roughly per-Target. So keeping track of it in the Project complicates it. Change-Id: I57d361ce21088d8e1ec53ce75f83ff3bd04851e1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>