There was a subtle bug in firstIndexNoParents(): If the model had
exactly one range with an endtime <= the given start time, it would
return 0, rather than -1.
Also, add some comments, and don't check for count == 1. The check for
count == 1 is redundant as that case is already covered by the endTime
and startTime checks for the first and last elements. As count == 1 is
really rare and this is a very hot code path, we drop it.
Change-Id: Ic21318cf82d2aea4c70d96989c56c2870dc871f7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We start from an event in the middle, rather than at the edge of the
permissible range. Then we work our way to the edges, cutting the search
short when we find that we cannot get better anymore. This reduces the
number of events that have to be checked.
Change-Id: Iba4591aa5ef71a769f26e7ee003701ffc68d3340
Task-number: QTCREATORBUG-14983
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This is useful if you have a timestamp and are looking for a range that
is "close" to that timestamp. It's hard to determine a range that
actually covers the timestamp, but the "best" index gives a pretty good
starting point for a subsequent linear search.
In order to determine if there cannot be any earlier range that touches
a given timestamp we need to check the parent range. Add a function that
retrieves it.
Change-Id: I2a3cad006ff8449620c56899ab8166d1b62d6747
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Since the rootProjectNode() containing the parsed files is now nested
under a new project node the main node needs to delegate enable/disable
decisions.
Task-number: QTCREATORBUG-17922
Change-Id: Ie7bb6d6802072a2127b32c0fe51fb25fc1c9c6cc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The check whether to emit a warning regarding guessed
configurations must get evaluated after the configuration
has been completed otherwise the guessed flag would be
always false.
Change-Id: I20e6dcdfff5110d4d9128ffcc97cba1a70f44fe9
Reviewed-by: David Schulz <david.schulz@qt.io>
Use information provided by the codemodel and the run configurations
as much as possible to avoid guessing.
This also fixes running CMake based tests from within the
AutoTest plugin.
Task-number: QTCREATORBUG-17882
Change-Id: I5639fa947fa602b76faf50e9b58d7a74af4e1f9c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Additionally rename formerly used variable to better express
what it is for.
Change-Id: I6ecf6a5ac30bc411b41a1de3629a27f8882a0a28
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Handle the generation of the list of files in a project globally, based
on the project tree.
Creator now has the concept of TreeManagers which can enrich the project
tree with additional data (e.g. the files found in a resource file), which
the project does not necessarily know about. So use that tree to find
the files that belong to a project instead of implementing similar features
in each project.
Change-Id: Ia375a914a1f2c0adaa427f9eda834eec2db07f68
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This speeds up processing of a cmake project without any QML files by a
factor of 16 on my machine.
Task-number: QTCREATORBUG-17884
Change-Id: I823d4a051451adbca10a8b73c17d288e03387378
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This fixes throwing an uncaught exception if local variables contain
arrays or pointer to a type that can not be looked up.
Change-Id: If9407e5cf5d86bb89594266d4122a53dd65a80bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This partially reverts 5ac13620. Looks like "soon enough" is not
soon enough for non-trivial projects.
Change-Id: Ib0d317c36e78f1af12b6c1f2a2aab48922517e98
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Block access to the BuildDirManager while one of its errors is
processed. This prevents more errors being raised as part of
error handling, which can trigger a loop.
Task-number: QTCREATORBUG-17869
Change-Id: Ic6f8d9a3c3b4e63f27260c40f27ab09d20b62b3e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This patch reduces the time to generate a project tree by 15% in
my test project.
Change-Id: Ie5956cdd2108873118654857dc299bdb0b6d3636
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Enable adding nested nodes not a child of the top level node.
Change-Id: Ia6bb4ed6e3e6649a98151c88133ff5ec7197573d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Otherwise we are not going to do anything with the result. The
searching can be very expensive would happen whenever the mouse moves.
This also makes the q_ptr in TimelineRendererPrivate obsolete.
Change-Id: I582d0e85b63925f3f329e9a7463f2abee7947c5b
Task-number: QTCREATORBUG-14983
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Only ever emitted by the cmake project and never consumed
Change-Id: I689120a2ac2c77896eed72da9bd0be194ac1af86
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Most users expect build related entries in the Issues pane, so prepend
debugger related exception entries with a prefix making clear that these
entries are not build related.
Task-number: QTCREATORBUG-17806
Change-Id: I8a78c1eff3a4386f108997954329b694c223400f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Having each source/header/form file on its own line
makes further moving around (e.g. sorting) much easier.
Also make sure there is a space between file name and
trailing backslash.
Change-Id: I54fccf7b6249c86034b8f41f58391ffcc63a0a27
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
We can't just change the node name. A branch named foo/bar can be
renamed to baz/yyy. We have to refresh the model after rename.
Change-Id: Id9dfaa15b9e0384668223ae746376025267f89a3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
If the current branch was foo/bar it was not detected correctly.
Change-Id: Ic030a6f4659801c6da2716c272a418c89585e22f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Use member initialization
* Use nullptr
* Remove unneeded local var
Change-Id: Ibca6c3bc5caf9e028166b833ba1ed9fc165e290b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Seems to be needed explicitly at least on linux due to the use of
sharedmemory_unix.cpp.
Change-Id: I59e5b5c6dabbe05afa26c4367cce62286986b069
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Do not compress foldernodes that differ on their type. This makes it
possible to use FolderNode::compress() in one more place in CMake.
Change-Id: I4721d5d12e3032ee70a1c3d9e87df49d59751f04
Reviewed-by: hjk <hjk@qt.io>
Checking for qtquick is not sufficient in some distributions that
install the development packages for the real thing but not *-private.
Change-Id: I5e6959f92b0da0a7a1b7770ed6e591a3ed1dae29
Reviewed-by: hjk <hjk@qt.io>
Checking for qtquick is not sufficient in some distributions that
install the development packages for the real thing but not *-private.
Change-Id: I866539c54c845cecb37df8761f006046b28aec80
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Visible in e.g. the C++ Symbols search. The icon returns a higher
resolution pixmap, and QItemDelegate::drawDecoration does not position
pixmaps with higher devicePixelRatio correctly. Just draw the icon
ourselves with similar code as QItemDelegate draws icons.
Change-Id: Ia412de026c3fb38d91cb87381475b6884005a231
Reviewed-by: Serhii Moroz <frost.asm@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Got disabled in 16944277d2 during
refactoring.
Delegates and models are not the right places for registering commands,
since there can be multiple instances. Do registration in project
welcome page, and let delegates retrieve shortcut string from the
models.
Task-number: QTCREATORBUG-17881
Change-Id: I06e3c29e57ee893865bf108a2f13bdb385c26d70
Reviewed-by: hjk <hjk@qt.io>
As we are using this as a queue, with many calls to takeFirst(), a
QVector is prohibitively expensive here.
Change-Id: I151452ae1299ab520a3aceae7ff3da0e29fe9bf9
Reviewed-by: hjk <hjk@qt.io>
We get called back soon enough when projects are parsed.
Also, mark the container node for initial expansion not
the project's root which typically does not exist yet.
Change-Id: I49100f83f8c57d5ef80d0f6f369330b646707260
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
And inline the filtering to avoid the duplicated type check
and save a few cycles.
Change-Id: I0dae5e51b05b0a4e581359e7ad7d3b9d4f684141
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The release mouse event does not come through if we start a drag.
There was already a workaround that stopped working with 5.8 and
did rely on private API.
I removed all usage of private API and added a simple workaround
that synthesises a mouse release event.
The actual execution of the drag is now asynchronous to
ensure the release event is delivered properly.
I removed all dependencies on private API in the designer.
In Qt 5.9 the issue seems to be fixed in Qt.
The workaround does not seem to get in the way of the fix.
Eventually, the workaround can be removed.
Change-Id: I9b45b255da5e44c26aba2acf4a42f88537126f75
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Do not set up empty root project nodes and fall back to the default
project tree instead. A project can not ever be empty: It should at
least include the project file itself so that the user can fix
breakages when project parsing fails.
Change-Id: I692e299f56727305120777cdc532607d5b0be99e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
A "diagnostic row" is displayed in two columns with the help of table,
one cell being the location, the other cell the diagnostic text. At
times, the location is wrapped too, which makes the whole diagnostic
display look fragmented/broken.
It looks like there is no way to avoid the wrapping of the location
column because Qt's CSS does not support the needed
style='white-space:nowrap'
Avoid the columns for a consistent display at all times.
Change-Id: I35e4a1c831f18e2bce6a4c9ed891fcae439d1a1b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>