When a project is opened, delayParsing() is called several times:
* activeTargetChanged -> buildConfigurationChanged
* environmentChanged
* startupProjectChanged -> ... -> buildDirectoryChanged
delayParsing starts a 1s timer for aggregating all the relevant changes
before starting the actual parse.
This makes sense also when the user makes changes (like switching build
configurations fast, or editing the build directory).
When the project is opened initially, there's no reason to wait before
parsing.
Change-Id: I4eb0c7d3419465bc01e8f9febc9ee808684adb6e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Allow for different extra compilers which may get called to generate
additional code for the code model. The build system is expected to
know what files are generated from which source file and the extra
compilers know how to generate the content of those files, without
touching the build directory. the uic adapter is refactored to be
the first such extra compiler.
The extra compiler is run when an editor for its source document
loses focus, or after a timeout of 1s when the source document has
been changed.
Change-Id: I13c110c61120c812f02639a3684144daf8979b37
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Add setRootProjectNode method and a default implementation of
rootProjectNode to Project. Use that in all derived classes.
Change-Id: Id28cde04457a20a8963d43020785ef9d77fea57c
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Implement default projectManager method in Project and use
these two everywhere.
Change-Id: I27e011e6fdc17b36aff1b8b931527307320e347c
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Add setDocument method, implement document method, use this in all
projects.
Change-Id: I5018bf7c2739665c13eee340184ce7c41fd319bb
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Fix fallout of this in KitInformation/Kit/KitManager and the wizards.
Change-Id: I5cb88cc381dc04409401909b810940ab6dccf86a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This is far from perfect but seems to work. Further work could add more
fine grained control over which projects are affected by the automatic
synchronize. Also there might be a few cases where the switching is
over zealous or missing.
Change-Id: I26ad3d59431251564917e4b408c66695dc454823
Task-number: QTCREATORBUG-5823
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Project::fromMap() does not fail anymore, and thus the errorMessage
parameter is unused.
Change-Id: Icc73a4b5725ea37e5ba14263ac3bd30eedf4cf64
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Use-case:
pro.user has 5 targets, while pro.shared has 6.
It is better to have only 5 targets than not opening the project at all.
Change-Id: Ic169a2180aafd0b1ed60a7f6d8903b47e7f1c34e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Instead of just a bool, return a tristate of: Ok, Error and UserAbort.
Also add a out parameter errorMessgge.
Change-Id: Icb076de49998e9372839d0631c2776e905e4a0f6
Task-number: QTCREATORBUG-13223
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Project::generatedUiHeader was still taking QString instead of FileName
Change-Id: I582ddccd679a35fb2533ff1eb3d3010342cd4edd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Provide Project:Name there by default, and make it accessible
from the target.
Change-Id: I2faa52dc8c0703f3245cac2ca15b942e3006993a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
ProjectExplorerPrivate::m_editorConfiguration has the same lifespan
as the Private itself.
Change-Id: I8037528bec44109b9cf076fa5daafcfab280b459
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This fixes some crashes in the TargetSetupPage and other places.
Also remove isValid method again. It was introduced to fix the same
crash that this patch also addresses, but introduces a bit more
complexity than this approach.
Change-Id: Iee80a2baffb2854b6fad8931d23a1da6d218f919
Reviewed-by: hjk <hjk121@nokiamail.com>
Takes a member (function) pointer and a value and returns a functor,
that takes a instance of the mfp's class and returns whether it's equal
to value. Sounds complicated, but is a common pattern that is easy to
understand.
Change-Id: Iaaeb90488d34ddfd6940dadd4c66705381198fee
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Add Utils::transform and anyOf that take a member function pointer.
Remove bestElementOr it's unused.
Use declval<T> in transform's return type, because msvc does evaluate
T() and for types that don't have simple constructor this fails.
Add std::remove_reference since decltype returns a reference for
lvalues.
Change-Id: I22248b226748eeb27af0d300182d574438d7f756
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Currently we pass in some places by value, elsewhere by const ref and
for some weird reason also by const value in a lot of places. The latter
is particularly annoying, as it is also used in interfaces and therefore
forces all implementors to do the same, since leaving the "const" off is
causing compiler warnings with MSVC.
Change-Id: I65b87dc3cce0986b8a55ff6119cb752361027803
Reviewed-by: hjk <hjk121@nokiamail.com>
This avoids having .user files when pressing cancel on the Project Mode's
TargetSetupPage.
Change-Id: I09fc8e78c929d6f09a50ee57ef4f59555491c649
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Instead of hardcoding Core::ICore::mainWindow()
Change-Id: Iec7747945cbcb335ae552a0277a1527f598f1ff7
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
The PersistentSettings::writeFile needs it, and SettingsAccessor
should not hardcode it to Core::ICore::mainWindow()
Change-Id: I6ca99e9cd861fd81337028055fe0ed4d158b152f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
So far only instantiates the .user file specific upgraders.
Change-Id: I9a16dfe4c3c61093ea1231413495eec2e8fe648e
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Change the preprocessor popup to a dialog.
Save the additional preprocessor directives to the session instead of the
.pro.user file.
Change-Id: I0d08c5684cfb21e822cde0a965c9cf14e5d6d47d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Only methods as programming functions are affected. Besides renaming
some actions like "Switch Between Function Declaration/Definition" this
mostly touches (api) code comments.
This is a follow-up patch to commit 872bfb7.
Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92
Reviewed-by: hjk <hjk121@nokiamail.com>
Introducing a Widget with a SnippetEditor and a C++ Highlighter which
should provide additional information to the C++ preprocessor for a
specific file.
Change-Id: I27f9498c7e52d1493d6ea92a02a2c6d26130fe07
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Generalize the target setup page and move it into projectexplorer
Move the qmake specific code into a projectimporter class with
a specialization for qmake projects in the qt4projectmanager.
This change depends heavily on the BuildConfigurationFactory cleanups
done earlier and completes that change in such a way that generic
build configuration factories are now in theory possible. The
remaining problem is how to select the best factory of several that
claim to be able to handle a kit and that is left for the next patch.
Change-Id: I47134cb1938c52adebcdc1ddfe8dbf26abbbbeee
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Refactor the code of the build configuration factories. The idea is to
generalize the code so much that we can allow plugins to install
custom build configuration factories for the platforms they support.
To support this use case the following changes where done here:
* BuildInfo class was introduced to describe one build configuration that
can be created by a factory.
* Factories report a list of BuildInfo to describe what they can produce.
This fixes the need for factories to implicitly create one buildconfiguration
and then create another one 'officially' to support debug and release build
configurations to be set up for projects.
* Do no longer work around factories to create build configurations.
Change-Id: Ic372e4a9b5c582633b467d130538948472b89d91
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Fix grammar, punctuation, and style issues. Use standard wording for
QDoc commands. Remove \brief commands from function descriptions.
Move some function descriptions directly above the functions, so
that the \fn command can be removed.
Change-Id: Iedf4f0041af24541a982241f99bd4906e86af916
Reviewed-by: Daniel Teske <daniel.teske@digia.com>