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>
qbs::Project::generatedFiles() without tags retrieves all generated
files recursively. That is not what ExtraCompiler expects.
This way it should do the same as the other project types. It should
only retrieve the first level of generated files. However, as
filesGeneratedFrom() is currently unimplemented in QbsProject, in fact
it doesn't retrieve anything and the feature is disabled for now.
Change-Id: I8ba0b5e9310a55fcd348b3547d8ff87d97a1b498
Task-number: QTCREATORBUG-15796
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>
Like qmake does. Otherwise, since the unique product names contain the
associated profile, inactive targets get run configurations for products
with the wrong id. These get removed and re-inserted on the next target
switch. The user-visible effect is a suffix "2" alternately appearing
and disappearing on switching kits.
Task-number: QTCREATORBUG-15372
Change-Id: Ib57859103786988d273733680a373a8283295a35
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Also extracting inline HeaderPath class and change projects list in vector
because the size is larger than a pointer.
Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@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>
Only send the fileListChanged signal at a point where the files()
method will actually return a non-empty list of files.
This fixes one reported issue with the Qbs project, but should
actually fix more than that: The files() list is used in several
places.
Task-number: QTCREATORBUG-15112
Change-Id: I2c8207dccfb70d79f50eb65caba88b1a6a11a071
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
To HEAD of 1.4 branch. Also do the necessary adaptation in
QbsProjectManager.
Change-Id: I810502c5be14ff8e93c886dae931cd4bceb81d13
Reviewed-by: Joerg Bornemann <joerg.bornemann@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>
This is the right thing to do. For instance, without this patch, after
removing all files from a project the code model still believes they are
there.
Change-Id: I848dbeca865b495aa26483460a0547c8215055f9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
... after adding and removing files. We need to do this for qbs because
in contrast to other build system managers, we have optimized away the
re-parse step.
Change-Id: Iec217819621696081d6e8b87ef48be0be681372c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
At the moment, all source files get the type "unknown",
so certain code in other plugins that looks for e.g.
Qt resource files never finds any.
Task-number: QBS-762
Change-Id: I71b798980b7ca318f2b4e7871148ba72703f8d83
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I919da493d0629b719d328e5e71c96a29d230dfd1
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
...instead of going through CppModelManager::projectInfo().
Now CppModelManager::projectInfo() returns an invalid ProjectInfo in
case there is no valid data for the given Project.
Change-Id: I11908bf2ddf865b1d3d71ff176eaf4139292b21c
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
We now use it in contexts that do not have access to a Project.
Change-Id: I96ebad60f5fc354b004092748033d83c766a305d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This fixes triggering the QTC_ASSERT in updateCppCompilerCallData() if
the user opens and builds the following qbs project:
import qbs
Product {}
Conceptually the initial ProjectInfo should stay invalid, but this would
result in a bigger / more risky change. Will be addressed in master
properly.
Change-Id: I74d3374b438884f38947f551915a80ec836a85c1
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
- Setting the QFuture result is not enough, we also need to emit the
finished() signal.
- Never fail silently; use soft asserts for things that shouldn't happen
and compile pane output for things that can.
Task-number: QBS-705
Change-Id: I4dad18c2ad573a92f2a0c5aa92b596851c56541e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
When passing -DFOO to the compiler it will treat that as similar
to "#define FOO 1". Do the same when passing FOO on to the code
model.
Task-number: QTCREATORBUG-13384
Change-Id: I236d4731435e0559f75a3435dad9a8d935d42042
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Setting up a qbs profile, particularly for Qt, can take a measurable
amount of time, so we should not do bulk changes via the kitsChanged()
signal. Instead:
- For the initial kit loading, delay the profile setup until
the kit is needed for the first time, i.e. the user attaches it
to a project.
- Handle adding, removing and updating a kit separately; in
particular, do not do anything to other kits.
Change-Id: If09d3c40b21e9a1356dc96089b92a60186a9bcdb
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
To HEAD of master branch.
Also do the necessary adaptations.
Change-Id: I51830dee41341c9be294caf69fdb0459ed8c8bfe
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
...otherwise we might end up having multiple indexer running for
different (build) configurations.
Reproduce e.g. with:
(1) Open a project (adds "Parsing C/C++ files" progress notification)
(2) Trigger build of project
(3) While it is still building, switch between e.g. Release and Debug
build configuration
(4) Once the build is finished, a new code model update is pushed but
the indexer for the old configuration might still run
Change-Id: I685d0b3eeeb43ba5923c6af0e6b16aee6609419b
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
All static functions, can live closer to related code.
Change-Id: I54c5680256c78f1d09b4bee3e8843b2f4350b75a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
- Identify products by the name/profile tuple instead of just the name.
- If the product's profile differs from that of the overall
project, add it to the visual representation.
Change-Id: I4a89db60911277977458370157e435472bbe428f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Replace the CppModelManagerInterface/derived CppModelManager
combo by a more common CppModelManager/CppModelManagerPrivate
pimpl pattern.
Change-Id: Ia4582845ed94d5ef60b8571bab9b2260c6290287
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>