The possibly intented flexibility e.g. to have different project types
share the same idea of a common context was never used, in all cases
we had a 1:1 relation ship between project ids and ids that were used
as context. This led to oversights like the one fixed in 60fb35a2.
This patch here uses the project id unconditionally as context and
drops all context ids. If we'll ever have the situation where the
original flexibility was needed, Project::projectContext() could be
made virtual and overridden were needed.
Also, the context was never modified for any given project, so the
updating machinery is not needed.
Change-Id: I3f7fac0ed5e4704e126558987c48577f26082dfd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This builds on top of 08677c0b01 and
fixes one more code path to go through a common entry/exit point.
Change-Id: I1d00fa9242f247028e5d3b0ef3b5fe1d3f4cb03d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
The directory tree scanner and the project parsing work independently of
each other. Add logic to combine these two sets of results into one
parsing state.
Change-Id: I46e94f0e866b40ee7225235c536c742cecf11b45
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
That's the only error that was ever checked for, in all nine
project manager. In the hypothetical case that we'll need something
else than the name of a file to identify a "project file", we'd
probably need to touch the signature anyway. Until then, remove
the duplication.
Change-Id: Iba00b8f71309a908e2d29c0a58c50b685eca0cae
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Can be done generically when creating projects. The only wart is
the use from BaseQmakeProjectWizardDialog::writeUserFile.
Change-Id: Ie98c9f88ec142e82443e204a0075e3ae9e163752
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Project source tree is a same for all build configurations so it is
a good idea to keep it persistent between CMake runs, configurations
switches and so on. It safes a lot of time for big projects.
Move more operations to the scanner thread:
- Nodes filtering: skip .user files on top level of the project, skip
well-known extensions and octet-streams: In most cases these are not
required to be shown in the project tree.
- Nodes sorting
Fix small memory leak: we have .user in the scanner result. After this
node filtered out, but is not feed (old code at the
BuildDirManager::generateProjectTree()). Now .user file skips during scan
without memory allocation at all.
Allow user manually rescan project tree by call Build -> Rescan project
tree. It runs CMake and Tree Scanner together: in most cases only CMake
run requires but time to time (VCS update) full rescan also required.
Change-Id: I4a6e6c897202da557509291c79932dd7751860e5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This will make it easier to introduce a new type of BuildDirManager
to accommodate cmake server-mode.
Change-Id: I989aab9df44dff1cfdff226ef97bb30bb092ffdd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Setting CMake configuration to the provided by the Kit, drops all users
settings to the default one. CMAKE_BUILD_TYPE too.
Change-Id: I8be556f553376273933872a74e47937df5a74f30
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Some CMake parameters changes requires to clear cache and run CMake
from scratch. Add ability to force it from the CMake configuration
dialog.
This change based on the work of Alexander Drozdov.
Change-Id: I21d8e12eec7e1f7bca560f44c43f25e4f333fcf0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This is no longer needed now that the generator is a property of the
Kit.
Change-Id: Ife35fd9207c805a4ead1e067603df1bfc77e6855
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Do not push the cmake running straight into the face of the user. Do it
in the background instead.
This needs some follow-up patches to become really useful.
Change-Id: I3457178b33e3f14bdeac25005a773d17abb73b65
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Do not leave out -Csomething (set by the kit) or the generator used
(set by the wizard).
Change-Id: I41cfb935da2877deaa26ae84bfdd96948fa20763
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Shorten header guards
* Use override and auto where possible
* Remove useless destructors, etc.
* Remove private slots sections, unify private: sections
* Use member initialization where it makes sense
Change-Id: I00eaf6d706adc16859176d1b68c631d3336bb39f
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
The information is contained in the BuildInfo, so there is no
need to provide it a second time.
Change-Id: I512d148e36996130fab6d8e007dd16d5acebaebb
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* Make it work at all again for cmake configurations without a
preloadCache file
* Fix the KitInformation to provide the getters/setters like all
the other KitInformation do
* Use those setters consistently
* Remove useless conversion from QString to QByteArray and back
Change-Id: I8fc43b3531da2c04034c89b29915a29c331fe064
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Some time ago the all the wizards for the Plain C++ were coalesced into one wizard.
Since then the wizard asks first for the targets via a targetsetuppage and then
in the CMakeOpenProjectWizard asked for the kit again.
This patch clean thats up, by always using the TargetSetupPage for kit
selection and removing code from the CMakeOpenProjectWizard for kit selection.
It also adds more types of buildconfigurations
Offer: Debug, Release, ReleaseWithDebugInfo, MinSizeRelease with the
corresponding -DCMAKE_BUILD_TYPE parameters. That argument is saved
in the build configuration and used once for the first cmake run. (Subsequent
runs of cmake don't require passing that to cmake again.)
Also do not require running cmake on creating the buildconfiguraiton, instead
postpone that until the buildconfiguration is made active. With the current
cmake wizard, selecting multiple kits would show a dialog per buildconfiguration.
Change-Id: I3bb806113f4f529f8e291830647d2515a6c4df8a
Task-number: QTCREATORBUG-12219
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
The correct pattern is this: The actions in the build menu are supposed
to be for the startup project. They should use the global context and be
manually hidden/shown if the startup project changes.
This fixes a crash on assigning keyboard shortcut to the edit files
context menu action.
The slot connected assumed that the action could only be triggered via
the context menu. By using ProjectTree;:currentProject() the code now
works even if the project tree is not actually focused.
It also fixes that the "Run CMake" action was shown even in the build menu,
even though a non cmake project was the startup project.
Change-Id: I0bb8086d8b1078b4c71c3b5ba9d7f8596757e724
Task-number: QTCREATORBUG-14728
Task-number: QTCREATORBUG-14768
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This patch adds support for binding a specific CMakeTool to a Kit.
When creating a new Kit or loading a existing one without a valid
CMakeTool, the default CMakeTool will be set.
Change-Id: I28d0843a01c583c4b31fc680a0ec556b40cd9c0d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This patch add the CMakeToolManager, a central repository for cmake instances.
One instance is always the currently used "default". By that its possible to
switch between different cmake installations. The next step will be adding
it to the Kits.
Change-Id: I310fdd805e0ed239077a5632303e891dbd1d9ea1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Opening the context menu would move the focus, which then would
reset the current node/project to come from the DocumentManager.
So move the context menu handling code to the ProjectTree class
and ensure that while it is open, the corresponding ProjectTree
is considered the focused widget.
Task-number: QTCREATORBUG-13684
Change-Id: I8b3dc410f5f5bc5e9a2dd663421b22cf3f147190
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Centralize the handling inside a new class ProjectTree.
React to moving focus and remove most special handling.
This properly fixes the linked task.
Task-number: QTCREATORBUG-13357
Change-Id: I6b06aa32b1e4305ec8a6d432857b302585d8734b
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Since we want to treat them differently.
Task-number: QTCREATORBUG-12461
Change-Id: Ia72b8045390ceec693fa416f65010a4c4dbecce1
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
There are no plans to create our own generator anymore.
Change-Id: I1e74f6ed90ccffbc3837574637ba42c40f375118
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Move CMakeSettingsPage and GeneratorInfo into extra files
to prepare for refactoring
Change-Id: Idee2e9f807a961c0eee9c15198ee0966ecc16e83
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
The default "matches" method now takes the widget and looks for all
child labels, checkboxes, push buttons and group boxes.
Because of that, the former "createWidget" method
can be called multiple times without creating a new widget
(-->widget()), and the "finished" method must ensure that the created
widget gets deleted, since not all widgets that were created are added
to the UI anymore.
Change-Id: Ia231c7c78dd8819146668e6447d36d22e7836904
Reviewed-by: Eike Ziller <eike.ziller@digia.com>