Commit Graph

50929 Commits

Author SHA1 Message Date
Ulf Hermann
7b5db5db90 Timeline: Fix and clarify index lookup
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>
2017-03-28 10:52:29 +00:00
Ulf Hermann
1f23c11a56 Timeline: Further optimize item selection
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>
2017-03-28 10:22:53 +00:00
Ulf Hermann
7432cd4fe6 Timeline: Add functions to find "best" and parent index in a model
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>
2017-03-28 10:22:48 +00:00
David Schulz
86edeb9722 Debugger: Use native value for pointer dereference
Change-Id: Ibde6ff382e7adc0c196837c9eba04391c0a2c3a0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-28 09:22:28 +00:00
hjk
3aa13958fd ProjectExplorer: De-virtualize Project::files()
It's never overloaded.

Change-Id: Ia733e7525a98c19060abbbfc2ae49c06be8b8d5d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-28 08:30:40 +00:00
hjk
2ee7967750 ProjectExplorer: Fix enabling state of main project nodes
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>
2017-03-28 07:10:54 +00:00
David Schulz
7f5b37ed14 Debugger: Disable QObject property dumper test on Windows
Change-Id: Iff91a41aae9328c6e935480c5cfc2fe3643ca743
Reviewed-by: hjk <hjk@qt.io>
2017-03-28 05:38:30 +00:00
Christian Stenger
0a3efc042d AutoTest: Fix warning for guessed configs
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>
2017-03-28 05:07:04 +00:00
Christian Stenger
124efb32f5 AutoTest: Re-do completeTestInformation()
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>
2017-03-28 05:06:55 +00:00
Christian Stenger
a65ce0fe5b CMakePM: Fix assignment of build system target
Additionally rename formerly used variable to better express
what it is for.

Change-Id: I6ecf6a5ac30bc411b41a1de3629a27f8882a0a28
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-28 05:06:43 +00:00
Orgad Shaneh
d2c3cff407 QmlDesigner: Re-add core-private also in qbs build
Change-Id: I197a4caafe984326778b6613957bbd3d327680d9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-03-27 17:36:59 +00:00
Tobias Hunger
fc5ce1e710 ProjectExplorer: Handle project file list globally
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>
2017-03-27 15:32:13 +00:00
Tobias Hunger
d1a5304564 CMake: Fix WS
Change-Id: Id06a9d8d831fcc0ce3fe38f852e34e144a79e0e9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-27 15:32:02 +00:00
Tobias Hunger
437af83c9a QmlJSModelManager: Avoid needless Mime database lookups
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>
2017-03-27 15:18:15 +00:00
David Schulz
767d988891 Debugger: Cache reference to an unresolvables type as struct
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>
2017-03-27 13:19:13 +00:00
David Schulz
bb04bbe9d4 Debugger: Add dumper for Utf8String
Change-Id: I0f9411a246d121e22c8b65bf188598c427993726
Reviewed-by: hjk <hjk@qt.io>
2017-03-27 12:01:16 +00:00
hjk
173186c31d ProjectExplorer: Show something during parsing again
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>
2017-03-27 11:57:49 +00:00
Tobias Hunger
7da1e233eb ProjectExplorer: Add missing breaks to switch in Abi class
Change-Id: I6c855d221e7a4d81f7338bc119c7ecff815e7ea6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-27 11:54:09 +00:00
Tobias Hunger
3a20cec60a CMake: Break loop in error handling
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>
2017-03-27 11:53:43 +00:00
Tobias Hunger
17b89cd422 CMake: Speed up server-mode reader
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>
2017-03-27 11:53:35 +00:00
Tobias Hunger
54be52a4fa ProjectNodes: Enable nested nodes outside of the top level node
Enable adding nested nodes not a child of the top level node.

Change-Id: Ia6bb4ed6e3e6649a98151c88133ff5ec7197573d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-27 11:53:29 +00:00
Ulf Hermann
2703d02db6 Timeline: Only search hovered events when !selectionLocked
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>
2017-03-27 09:25:42 +00:00
hjk
54fa601e5f ProjectExplorer: Remove unused Project::displayName() signal
Only ever emitted by the cmake project and never consumed

Change-Id: I689120a2ac2c77896eed72da9bd0be194ac1af86
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-27 08:51:40 +00:00
Nikolai Kosjar
b26143561a Clang: Make diagnostic display adapt to size of the info bar
Change-Id: Ibc7431234b8a68c8e2b0c3f25387de96b203c4c5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-27 08:13:10 +00:00
BogDan Vatra
48c17a1e07 Update only old gradle distributionUrl
Task-number: QTCREATORBUG-17814
Task-number: QTCREATORBUG-17672
Change-Id: I658e8edec5c231a30ef4e99bae5d15cb6f6497f5
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-27 08:00:42 +00:00
David Schulz
c73bcd32a8 Debugger: Prepend additional info to cdb exception task entry
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>
2017-03-27 07:58:15 +00:00
Andre Hartmann
cf40d98dc9 QMake: Prettify file lists in generated project files
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>
2017-03-26 20:38:19 +00:00
Orgad Shaneh
b30b4f8a11 Git: Fix inline nested branch rename
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>
2017-03-26 20:38:03 +00:00
Orgad Shaneh
5736ef2c54 Git: Improve detection of nested local branch
If the current branch was foo/bar it was not detected correctly.

Change-Id: Ic030a6f4659801c6da2716c272a418c89585e22f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-26 20:37:58 +00:00
Orgad Shaneh
07921dee77 Git: Expand branches also on internal model refresh
Change-Id: I91e3b875be1a2c3b5da9ae7720709b34a7d83232
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-26 20:37:53 +00:00
Orgad Shaneh
8478e35384 Git: Minor cleanup in BranchModel
* Use member initialization
* Use nullptr
* Remove unneeded local var

Change-Id: Ibca6c3bc5caf9e028166b833ba1ed9fc165e290b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-26 20:37:49 +00:00
hjk
ad8b797860 QmlDesigner: Add core-private dependencies
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>
2017-03-26 05:48:13 +00:00
Tobias Hunger
e8498acde0 ProjectNodes: Be less enthusiastic about compression opportunities
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>
2017-03-24 17:41:07 +00:00
Tobias Hunger
b302eb2d0f ProjectNodes: Avoid QFileInfo
Avoid creating an unnecessary QFileInfo object.

Change-Id: Ibd85ccdf948872c2505085aa04cc5525d25c4d29
Reviewed-by: hjk <hjk@qt.io>
2017-03-24 17:40:58 +00:00
Cristian Adam
87f7725b5a Prevent compilation of the QmlDesigner if qtquick-private is not present
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>
2017-03-24 17:11:45 +00:00
Tobias Hunger
55a4a62797 CMake: Speed up server-mode
Use a QSet to avoid having to search in a QList.

Change-Id: I2261a83acd3924a8483495e1f03322c7574a78a8
Reviewed-by: hjk <hjk@qt.io>
2017-03-24 15:55:10 +00:00
hjk
5a13a2b5b4 Prevent compilation of the QmlPuppet if qtquick-private is not present
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>
2017-03-24 15:28:29 +00:00
Eike Ziller
ad869ba7c7 SearchResultDelegate: Fix display of icons on HiDPI screens
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>
2017-03-24 15:22:07 +00:00
Alessandro Portale
3729500740 WelcomeMode: Remove screenDependHeightDistance()
That function always returns 16.

Change-Id: I65cb0c62c5e553791f25e964de9eaf23a0f65687
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-24 15:11:07 +00:00
Thomas Hartmann
5f28650c23 QmlDesigner: Remove private Qt dependencies from qbs
We have no private Qt dependencies anymore.

Change-Id: I7f6b33b593e9493920c59945cf451c1c66f0a46d
Reviewed-by: hjk <hjk@qt.io>
2017-03-24 15:04:36 +00:00
Eike Ziller
7da34ce33a Welcome: Reimplement session and project shortcuts
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>
2017-03-24 14:46:52 +00:00
Ulf Hermann
551efd9199 QmlProfiler: Use QList for QmlRange container when loading .qtd
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>
2017-03-24 14:25:06 +00:00
hjk
5ac136204e ProjectExplorer: Don't update flat model on projectAdd
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>
2017-03-24 13:25:47 +00:00
hjk
9c18e718a7 ProjectExplorer: Merge the two loops in FlatModel::addFolderNode
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>
2017-03-24 13:24:54 +00:00
hjk
a63998f55b ProjectExplorer: Avoid some needless intermediate lists
... when creating folder nodes in the flat model.

Change-Id: I28f95589d774fc83e1a30c8328707bd1db6be03e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
(cherry picked from commit 1a416d3f98)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-24 13:13:56 +00:00
Thomas Hartmann
2df18ec34f QmlDesigner: Fix drag and drop
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>
2017-03-24 11:21:42 +00:00
Thomas Hartmann
975c283ec7 QmlDesigner: Use the same usage pattern for sidebars as edit mode
Change-Id: Ia1ec631b8b486e98e957b5dbcccbc7b91baecb0f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-24 11:21:33 +00:00
Tobias Hunger
b021660c1e ProjectExplorer: Treat empty root project nodes better
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>
2017-03-24 11:16:19 +00:00
Tobias Hunger
3492da1246 ResourceEditor: Prevent possible nullptr access
Change-Id: Iad958d26272f471530a8494bee0e326ce9835aa9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-24 11:16:12 +00:00
Nikolai Kosjar
1074d97432 Clang: Avoid fragmentation in diagnostic display
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>
2017-03-24 10:52:12 +00:00