Commit Graph

12 Commits

Author SHA1 Message Date
Eike Ziller
9109a6895e CMake: Do not create file system node in main thread
The file system scanning was already in a thread, but creating a tree
from the flat list of file nodes was still done in the main thread.
Creating the tree looks for and creates folder nodes as needed for each
file node, which is not that big of a deal but still takes 1/3 of a
second for the Qt Creator source tree.

Task-number: QTCREATORBUG-25783
Change-Id: I28948ed3ff5233f6fc4b86e93da94d882b81e231
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-23 14:25:08 +00:00
Eike Ziller
bce81fd992 Projects: Create QIcons in the UI thread
Creating QIcons elsewhere is not safe because of image reader plugin
loading and the pixmap cache.

Fixes: QTCREATORBUG-25301
Change-Id: Ia22a0cd571f808d7f5c639353fdf2e548743f8ca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-04-09 13:34:55 +00:00
Eike Ziller
f348e952b8 CMake: Make sure file node from project is selected
instead of node in file system tree, if it is available in the project.
For that, the nodes in the file system tree must have a higher priority
value than also the project file node.

Fixes: QTCREATORBUG-25493
Change-Id: I984adc0d205b2bac27782135772e49a6df2bbd0f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-18 07:51:42 +00:00
Eike Ziller
d204065660 Fix that file from project is selected in file system node
The new file system node in CMake projects leads to funny selections in
the project tree when "Synchronize with Editor" is turned on.
Since the file system items are less deep in the tree than the files in
the "regular" CMake project tree, they were selected instead of the
regular project nodes.

Reduce the selection priority for the nodes in the file system sub-tree.
For this remove the hard-coded priorities when selecting nodes for
"Synchronize with Editor" and use the existing node priorities.

Amends 53115259ba

Fixes: QTCREATORBUG-25208
Change-Id: I69c08c4f0e7afa305141a0c475af515d9db1363b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-12 14:43:26 +00:00
Dmitriy Purgin
53115259ba CMakeProjectManager: Add File System virtual folder
If a CMake project cannot be parsed by CMake, it is practically unusable in
Qt Creator. According to discussion in QTCREATORBUG-24677, a virtual
folder with the project's file system view is added to the project
manager as a convenience feature.

Fixes: QTCREATORBUG-24677
Change-Id: I48775bb89c704d3f7e5bb21ec6481bd5cc0f4b6c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-09 10:48:14 +00:00
Tobias Hunger
494b9f5287 CMake: Remove servermode support
Task-number: QTCREATORBUG-23915
Change-Id: I2a58e1d6d95c28e25787722fa37448d86c4aebc9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-29 14:30:16 +00:00
Tobias Hunger
eb2f49c398 CMake: Fix race/crash on project open
When the filesystem scan takes longer than the cmake parsing, then
resetData() was called on BuildDirManager by the CMakeBuildConfiguration
before the CMakeProject had requested its data.

Move some code back into CMakeProject to resolve this issue.

Change-Id: Ib21bdd63fdca79c2ad39a7e060df438b456700b4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-09 13:08:11 +00:00
Christian Kandeler
939df1c493 CmakeProjectManager: Fix warning about redundant std::move()
Change-Id: If456698d62c0bdcd51992d62510e07d00a4b3fdf
Reviewed-by: hjk <hjk@qt.io>
2019-07-25 12:45:11 +00:00
Tobias Hunger
5bcd59c94f CMake: Simplify buildkey generation
Just use the target name as buildkey. This is unique in cmake projects, so
there is no need to mangle the source directory into the whole thing.

This is a problem since different readers might report different source
directories. That will then result in RunConfigurations getting duplicated
after switching the reader types.

Task-number: QTCREATORBUG-22129
Change-Id: I849ab68f221d732341e98faa9a4e757d3a495b2a
Reviewed-by: hjk <hjk@qt.io>
2019-06-20 14:41:04 +00:00
Tobias Hunger
add60c0148 CMake: Avoid a bit of useless processing when updating the project tree
Do not pass around a list of filenodes with all the known header files.
That list gets converted into a QSet<FilePath> and then that is used.

Just generate the QSet<FilePath> directly and avoid that conversion.

Change-Id: I2444a2a6b4a1600fe476e66673a1a2e9c8900764
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-06-20 14:40:55 +00:00
Tobias Hunger
a95eb53d3b CMake: Add initial fileapireader class
Change-Id: I620cba7cc1c2a5ac56789fa9770dce573c6b19cd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-20 12:25:36 +00:00
Tobias Hunger
023d995460 CMake: Move some code out of the ServerModeReader
... so that it can get re-used in the to-be-written fileapi reader.

Change-Id: I2693e6bb102d910eb505882bf3468c34272a5d04
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-06-13 12:27:44 +00:00