This adds the ability to use macro's provided by various parts of
QtCreator inside the .includes or .files file. In particular the build
directory of the current build configuration or Qt variables of the
current kit (accessible through the active target's macro expander) can
be useful but I suspect its possible to find other use-cases as well.
Fall back to the project's own macro expander if there's no active
build target to allow this to happen some day, even if that expander does
not have many useful variables.
Change-Id: Ic3b7b744b5d0ae24247ad929b73d7c72abfb8bb3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This missing project files(*.files, *.includes, *.config) in "Project"
tree is a regression.
Change-Id: Ib7380b1627a0f31045a25bc152352f5d2c82342a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
toAdd is a QSet, so insert does nothing if directory is already
in the set.
Change-Id: Ic7d593414bef95a84f624c39208e29b0ec8c01f1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Use nullptr instead 0
* Remove QLatin1{String|Char} where possible
* Use C++11 list init and auto
* Add some const as drive-by-change
Change-Id: Ife4c9c7b0869bcf2c864b88b8061ac6b7c3f33c0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
The generic manager looked up entries from the .includes and .files
configuration files in the process (i.e. QtCreators) environment. In
particular for the .includes file this is a problem, since it makes it
impossible to use environment variables specific to a particular build
environment.
In my case I'd like to access the QTDIR variable added by QtCreator to the
build environment to provide the generic manager with the Qt include
directories. Of course this is different when working with two kits that
have different Qt versions associated and hence its not possible to
hardcode a particular path in the .includes file.
This will break existing files that use the generic-manager-specific
syntax for environment variables ($$(VARNAME)) as the BuildEnvironment
uses the platform's native way to refer to such variables.
Change-Id: I1a684db82fdbfd163b6a215f9591c8e4bb57b25c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
No need to require the project managers to do this. Also, it is easy to
forget.
Change-Id: I96f7a5e5547418678af9653e5753c372f0880e5a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Use class enum to shorten the FileType to quint16. This frees up a couple
of bytes per FileNode and we can have many of those.
Change-Id: I3a9ae25059690fefa15305a4268269647d6dc1c9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
We relied on the CppModelManager to tell us whether a project was reparsed
after a kit change. While this worked, it was not guaranteed that the project
is really finished (and ready for e.g. building) after pushing new ProjectInfos
to the CppModelManager.
Rely on the projects telling when they are finished with parsing. This is more
accurate and future-proof.
The introduced signals in Project and SessionManager are (at the moment)
only for tests.
Change-Id: I1b368ec4585ffa8755eb28fac6d187cce31243ee
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The methods are only relevant for documents without a filePath, and
there was a mix of different irrelevant implementations present in
subclasses.
Change-Id: I4f57d306e5ddd913974cfe6ed0b4db062eb907a1
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
To fallbackSaveAsPath and fallbackSaveAsFileName. That makes it clearer
what they are for, and that they actually belong to each other.
Change-Id: Ie5b83b9db77d39a7fe9e979cc8f22b7f5b9101a3
Reviewed-by: David Schulz <david.schulz@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>
The line is short enough to fit on one line.
Otherwise, curly braces would be necessary.
Change-Id: Iaab9ba5b45922a8d41fbdb43d4629863ea19db78
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
The generic project manager does not ask for a kit on opening a new
project, but uses the default kit.
Change-Id: I33371afb386c780ec8e3e9bbc7010ccfa4733d85
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>
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>
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>
So that recalculating the information is not O(n^2) but linear.
Change-Id: I69903e0b5ad321d071804d782ad634a3f300e71a
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This is in preparation for changes to the ProjectParts, where one part
can only hold files for 1 language.
Change-Id: I5e9a1a803ecc3ecbb36added0d0094df63922549
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>