Commit Graph

47434 Commits

Author SHA1 Message Date
Alessandro Portale
afc2fda8a9 ProjectExplorer: Use qAsConst w/ non-const Qt containers in range-loops
Change-Id: I6422b3e40a6925504a231be2d47b3214d86c6e06
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 11:19:21 +00:00
Alessandro Portale
e4f260d544 ClangTools: Use qAsConst with non-const Qt containers in range-loops
Change-Id: Id9df0a27c4bcba57ee76574e32ca53cb6c28a43d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 11:19:15 +00:00
Jarek Kobus
d6574a6e5f DiffEditor: Rely on compiler generated constructors
Change-Id: I16527f2f971fa110ceb0b35755a1f49663ccb460
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-17 11:07:22 +00:00
Jarek Kobus
406c3e3f99 There are people, who still work on linux :)
Amends 151184a609

Change-Id: Ibe868754b3822fc6e93fcfb847a17aa7c9242228
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-17 11:04:22 +00:00
Mahmoud Badri
151184a609 Implement new item library UI
- Create a new header qml widget.
- Move tabs and filtering search to the header widget.
- Add imports/assets using a new "+" button on the tabs.
- Remove import flow tag view (still some remainings to be removed in another commit).
- Change layout from grid to vbox.
- Rename some classes and variables to make them clearer.
- New "Add Library" view that replaces the QML imports view (older QML imports classes removed).
- Enable Search in the "add import" view.
- Hide category header if only 1 category is under an import.
- Assorted relevant fixes, tweaks, and clean ups.

Task-number: QDS-3589
Change-Id: I710aed50858b32e024200911c6a21fd963e1b692
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-17 09:38:20 +00:00
Christian Stenger
60f1e23ff2 AutoTest: Enable ubsan handling as well
Task-number: QTCREATORBUG-24328
Change-Id: Ibe1e3d55963139ff50f1ebc4a861d1be17f83322
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-02-17 08:52:16 +00:00
Tom Praschan
1085d6b508 FakeVim: Add emulation for vim-surround plugin
Change-Id: If450d04dd89a1707ab05806522fbf4cc987d454b
Reviewed-by: hjk <hjk@qt.io>
2021-02-17 08:50:21 +00:00
Alessandro Portale
b3686d410d Debugger: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I7bd27f8317b62fe448e037d5a25e78b4c88c648d
Reviewed-by: hjk <hjk@qt.io>
2021-02-17 08:03:09 +00:00
Christian Kandeler
dfa24f09ad ClangCodeModel: Show only valid applicable overloads when completing
libclang is smart enough to filter the overloads according to which
arguments have already been entered, so let's make use of that.

Fixes: QTCREATORBUG-650
Change-Id: Ic2711f460c908c6fd9c8efe28c3c63a0ce2d9205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 07:09:37 +00:00
Jarek Kobus
72f727b6ac ClassView: Delete Parser object from inside parser's thread
The Parser object is being moved to parser's thread inside
Manager constructor. However, when destructor of Manager
is being called, we delete the Parser from inside the main
thread. According to QThread documentation we should delete
object (which have been moved to another thread) from inside
the object's current thread. So in case of Parser, we should
delete it from the parser's thread. In order to fix it,
we create Parser object dynamically and connect finished
signal of the parser's thread to the parser's deleteLater().
Since now the parser is being deleted in parser's thread
we don't need a special handling for stopping the timer
object inside the parser's thread, as its destructor
will also be called from inside parser's thread.

Task-number: QTCREATORBUG-25317
Change-Id: I28dee2c3db5cf8329a9578e7a85952e8a85850d3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 19:53:14 +00:00
Jarek Kobus
8c5dc305ae ClassView: Use only const pointers to ParserTreeItems
There is no need to use non-const pointers anymore. This also
ensures, that after generating the tree data in the non-gui
thread no-one modifies already created items.

Task-number: QTCREATORBUG-25317
Change-Id: I91f63da8f57ae9798587265adc029ebd0c68504e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 16:58:00 +00:00
Jarek Kobus
d4fe3fdb15 ClassView: Fix a crash when switching sessions
Move a code that operates on QIcon instances out from non-GUI
thread into GUI thread. Instead of storing the QIcon directly
inside ParserTreeItem, store the path to the project. Set the
real icon when we are back on the main thread side.

Rename some fields to start with m_ prefix.

Task-number: QTCREATORBUG-25317
Task-number: QTCREATORBUG-25312
Change-Id: Iaff89c0995045b70c5378a2ff72c5deb74abf89e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 16:57:49 +00:00
Eike Ziller
c87284356c VCS: Do not write defaults to settings
Saves useless entries in settings file and makes it possible to change
defaults later.

Task-number: QTCREATORBUG-24762
Change-Id: Iee7d39f2bf5d8de6903ca914ea533a678fad62f8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-02-16 16:10:30 +00:00
Eike Ziller
d2f7bea0b6 VCS: Remove reading of very old settings
Change-Id: Id75da5d764c0ea65942c49324c2db6d033cf62a1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-16 16:10:17 +00:00
Eike Ziller
502508d87d Welcome: Do not save default value to settings
Task-number: QTCREATORBUG-24762
Change-Id: I9a587c76dfabee1cd707e6861de5bbc0e3e7583e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-16 16:09:40 +00:00
Jarek Kobus
a513f25c39 ClassView: Move the GUI related code out of Parser
Don't create QStandardItem objects inside the non-gui thread,
as it was in case of requestCurrentState() which is always
called in parser's thread. As a result of parsing send a root's
ParserTreeItem::ConstPtr now instead. Store the generated
root inside Manager instead of inside Parser. Remove rootItemLocker
as it's not needed now anymore. Move the implementation of
canFetchMore(), fetchMore() and hasChildren() into Manager class.

Now all the API of Parser class is used only in parser's thread
(with the exception of constructor and destructor).

Task-number: QTCREATORBUG-25317
Change-Id: I2b3c49918bf58266e6bea8acf65c975e19f7d9cb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 15:13:31 +00:00
David Schulz
ab7560bec4 LanguageClient: remove dead code
All files that match the language filter are opened in the server
currently, no matter whether they belong to the project or not. We want
to track changes to files outside the project, because the project might
depend on those files.

Change-Id: If78142489ad22899f8bd899ae3a7ce3f58618fa3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-16 14:27:43 +00:00
hjk
2845427d46 ProjectExplorer: create provideAskPassEntry(Environment &) convenience
... to centrally set SUDO_ASKPASS unless present.

To be used for 'Run as root'

Change-Id: I85bac939e6a7fba0b2299fd17edfe73577bfa5ad
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 14:27:00 +00:00
David Schulz
166fce5036 LanguageClient: improve Server startup
Starting a client does not need to be done via
LanguageClientManager::startClient anymore but can be done via
Client::start()

Change-Id: I571e96b6ad7d64786a345edf5dbb38208b9a1d12
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-16 14:13:20 +00:00
Eike Ziller
9bd8dc41d2 Add signing options to CMake/iOS build configuration
Adds the signing settings to iOS configurations.
Adds placeholders for signing flags to the initial CMake arguments, and
updates the CMake configuration when signing settings change.

The new configuration doesn't get automatically applied. Only the "Apply
Configuration Changes" button gets enabled and the user has to press
that explicitly. This seems to be a more general issue affecting the QML
debugging setting too, though.

Task-number: QTCREATORBUG-23574
Change-Id: I3e8d45f565347e1ad2ac274a21b1552f1510e8f4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-16 14:04:08 +00:00
Christian Stenger
0cb6f07829 LanguageClient: Fix crash when language server dies
Do not remove items of a container while iterating over it
instead revert to old behavior of allocating a temporary.
Broke with cf010911f7.

Change-Id: Ie76974f1e74469f80ee28fb2011d66690dd9e917
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-16 11:55:39 +00:00
David Schulz
23611c3438 LanguageClient: export settings widgets
Change-Id: Ica348818955c7ef9173780c65e44ff48ead4b172
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-16 11:35:31 +00:00
David Schulz
8106a01e9c LanguageClient: Add generic way to provide specialized settings
Change-Id: Iab482220ec7fd73ecd4cbf3d8b1b121e93148059
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-16 11:35:24 +00:00
Erik Verbruggen
7dc82b1af9 MCU: Do not add fall-back path for QUL kits
Fixes: UL-3609
Change-Id: I9912c7476f3b45346835d60be61fed7399046162
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-16 10:33:52 +00:00
hjk
12a0934830 Utils: Add the ability to interrupt inferiors via the process stub
This will be handy once we want to debug processes running as root.

The mechanism is the same as for "killProcess", and currently unused.

Change-Id: I2c5e5b77577ca32ed1118fcc81c03c6320db8800
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-16 09:57:00 +00:00
Jarek Kobus
f200466066 ClassView: Stop the running timer in Parser thread on close
When we are going to delete Parser object, it may happen,
that its timer is still being active. A call to
parserThread.quit() won't stop the timer. When we quit the
thread and wait for it to finish, the thread's timer may
still be active. Then we delete the Parser in the main thread,
what cause the following warning to appear:
"QObject::killTimer: Timers cannot be stopped from another thread".
In order to fix it, we post a request to the parser's thread
for stopping the timer by a call to aboutToShutdown() with
Qt::BlockingQueuedConnection, just before quitting the thread,
as the thread's event loop should still be spinning and is
able to receive and handle our request. It's the only safe way
to stop the active timer that was started in another thread
- it must be stopped it the same thread it was started in.
Inside the call to aboutToShutdown() we mark that we don't want
to start the timer anymore with m_shuttingDown flag and we stop
the timer. After the blocking call returns to the main thread
we are sure that the timer is not active anymore and it won't
became active in the future, so we safely quit the thread and
delete the timer.

Task-number: QTCREATORBUG-25317
Change-Id: I3b95c062b5561588c45c223d8588b2b700ad4040
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:42:09 +00:00
Jarek Kobus
4a15f6d16b ClassView: Optimize operator== of internal data
Make all of the fields of SymbolLocation and SymbolInformation
const members. Optimize a bit operator== of these structures:
check first if hashes are non-equal - in this case return
false early. Fix hash type of SymbolInformation for porting
to Qt6 purpose.

Task-number: QTCREATORBUG-25317
Task-number: QTCREATORBUG-24098
Change-Id: I769f99ff3157093e9f10ee3929bc7f6eb83f34e3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:41:56 +00:00
Jarek Kobus
06f305265b ClassView: Minimize the mutating API of ParserTreeItem
Make the API of ParserTreeItem const only.
Reorganize the code a bit:

Transform ParserTreeItem::add() method into private
mergeWith() and add a static method
ParserTreeItem::mergeTrees().

Remove ParserTreeItem::copy(), as in case of adding
projects we may use directly the instance from cache.
Remove now unneeded Parser::addProject() and use
directly getCachedOrParseProjectTree().

Transform ParserTreeItem::copyTree() into private
cloneTree() and make it a const method.

Move document symbols parsing code from Parser into
ParserTreeItem and add a static method
ParserTreeItem::parseDocument().

Remove ParserTreeItem::addChild() and provide instead
an overloaded constructor.

Allocate QElapedTimer object only when debug is on.

Fix some const correctness.

Remove some ugly usings.

Added some TODOs.

Task-number: QTCREATORBUG-25317
Change-Id: I6e7c48bb118b0d826fbb463cae94d59bf43a6938
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:41:41 +00:00
Jarek Kobus
9c896aa291 ClassView: Remove unused ParserTreeItem::operator=
Task-number: QTCREATORBUG-25317
Change-Id: I43f1c87fb1340a4e70d3309aae0b40a0466c8f04
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:41:31 +00:00
Jarek Kobus
23047f16f7 ClassView: Get rid of project and document mutexes
In fact, all the methods inside Parser class are
called only in one thread (parser thread), which runs
his own event loop. The exception is 3 methods
(canFetchMore(), fetchMore() and hasChildren()),
which may be called concurrently from the main thread.
However, they are protected with another mutex.
So, project and document mutex were protecting
the access to internals only when called from
one, always the same thread, what is not needed at all.

Task-number: QTCREATORBUG-25317
Change-Id: I0b44b762b5d76d003035e9c3099c90568b7faf80
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:41:17 +00:00
Jarek Kobus
0907315f47 ClassView: Don't lock the mutex while parsing
When parsing is being done we are producing a new
ParserTreeItem structure from scratch. This includes
creating new ParserTreeItems or getting data from
caches. So, we are not interferring with the
data stored in the rootItem. After the rootItem
is set, Parser doesn't modify this structure
anymore. There is no need to protect the parsing
with the mutex, as only 3 methods which are called
concurrently operate only on the rootItem: fetchMore(),
canFetchMore() and hasChildren(). Instead, we
protect only the process of setting the rootItem
to the new value. Similarly, we protect only
the process of reading the rootItem inside
findItemByRoot().

Task-number: QTCREATORBUG-25317
Change-Id: Ieda10107137f5031a81d67f2d608a90f6e72902d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:40:49 +00:00
Jarek Kobus
cc6df4e707 ClassView: Clear the documentCache, too, when reset was requested
Otherwise when we switch session we still keep
the data about the old session in the cache, which is pointless.
Protect clearing both caches with both mutexes, so it comes
atomically.

Task-number: QTCREATORBUG-25317
Change-Id: Ic5bc7ae2b8640e9290024e00c394ca9608f88da9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:40:41 +00:00
Jarek Kobus
1364630d1f ClassView: Consolidate document caches into one
We had three different hashes that cached the document data.
Replace it with one cache. Provide a dedicated structure for it.

Task-number: QTCREATORBUG-25317
Change-Id: I6592de62b7c026a9236a295657c9c06f6e9e5b4c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-16 09:40:30 +00:00
Jarek Kobus
f6a194b7a7 ClassView: Consolidate project caches into one
We had three different hashes that cached the project data.
Replace it with one cache. Provide a dedicated structure for it.

Task-number: QTCREATORBUG-25317
Change-Id: Ib6bafd38ee3c48f3e4960be1650709af777f255a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-15 20:29:48 +00:00
Eike Ziller
a0500f5b9a Use qlitehtml from separate repository
qlitehtml moved into its own playground repository,
get it from there instead of carrying our copy around.

Change-Id: I0e267344e5ccf95f579e4fb239e6789d177d7b78
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-15 16:31:49 +00:00
David Schulz
b865fa5571 LanguageClient: Rename logger -> inspector
... to be able to add more features to this dialog.

Change-Id: If8692bee484e25c1ba5e4ea629a77d14ff5d92ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 14:33:15 +00:00
Eike Ziller
27300c66fe Improve plugin install wizard on macOS
Downloaded files get a quarantine flag on macOS, which prevents loading
them as a plugin in Qt Creator. Remove the quarantine flag when copying
the plugin.

Change-Id: I3edef3ddfbab299be750e728a9fac0536634ba1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 14:10:17 +00:00
hjk
5168af3144 Debugger: Always switch on central widget when entering debug mode
This is not exactly what the linked task complained about, but
solves the issue. Disabling the central editor is rarely useful
(it can be limited to three lines in height) but still temporarily
possible with this patch.

Task-number: QTCREATORBUG-25315
Change-Id: I18182e11d7d3e2167a24a340ab1ae7222009b8c9
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-15 13:25:16 +00:00
hjk
ade5b44297 Debugger: Show central widget by default when resetting view layout
Fixes: QTCREATORBUG-25314
Change-Id: Id827c71159b4d23de2ab5adf14521c758f8489ef
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-15 13:25:10 +00:00
David Schulz
7521334261 LSP: support WorkDoneProgressOptions in server capabilities
These options indicate whether a server provides extra messages to track
the status of specific requests.

Change-Id: I3fb78f7fa7144a5a9418b32cb5b33d55b668c484
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 13:19:56 +00:00
Miikka Heikkinen
b42fa1fb9b QmlPreview: Don't force explicit restart on shader change
Shader changes seem to be reflected to preview even without explicit
restart, and the explicit restart will cause preview to crash when
shader files are modified in QDS.

Fixes: QDS-3741
Change-Id: Iacba712bcfe38831d76febd8074c683e2124223a
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-15 08:36:55 +00:00
Eike Ziller
2197eeb4aa Fix installation directory in plugin install wizard
Correctly initialize the bool variable that decides where the plugin is
installed.
Fix creation of installation directory: QDir::cdUp does not do anything
for directories that do not exist.

Change-Id: I5ee559a663380f293046eded7a2c3efbb1023776
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-15 08:30:47 +00:00
David Schulz
26e540e73d LanguageClient: Add expand all action to the log context menu
Change-Id: I7418f6ab4c0c92287d2e9d9652f609b652c06e26
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-15 06:13:27 +00:00
hjk
a174dda862 CMake: Move CMakeBuildSettingswidget closer to CMakeBuildConfiguration
The next baby step towards full aspectification. Ultimate goal is
to dissolve CMakeBuildSettingswidget completely.

Change-Id: Idb2bb852d1010f69f11ec8ca87c4695361a38b83
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-12 18:21:09 +00:00
Bernhard Beschow
06dd646370 AutoTest: Only expose ITestTreeItem in TestTreeModel's public methods
Change-Id: Ide2513c838178b841763fe781478748a852a258c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 16:44:16 +00:00
Bernhard Beschow
cba4d5de5c AutoTest: Mark method as static
Change-Id: I14f2f0acf266a0fb4f88e26f50cfbe2257e3ab9a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 16:43:54 +00:00
Jarek Kobus
784de5fb6c ClassView: don't clear project's file list cache when files removed
Instead of clearing the project's file list completely,
remove just a project (in case a removed file was a project)
and remove from all project's lists the removed file (in case
a removed file was contained in any project).

Task-number: QTCREATORBUG-25317
Change-Id: I63a5f9eb1043bd0d9b835d55f4a16f7f6af7bc6e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-12 14:50:03 +00:00
Christian Kandeler
8dc4cb17c1 Designer: Re-use CppTools functionality
... for slot insertion logic.

Fixes: QTCREATORBUG-8220
Change-Id: I3516a62d62174b64d557c82ce38a9cc334790efc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 14:16:14 +00:00
David Schulz
29f1aca1c8 LanguageClient: remove unused formatting functions
The formatting functionality was moved into languageclientformatter.cpp

Change-Id: Ieeafd49c297a854e478a11d4fcb81062b9cfcf19
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 14:15:13 +00:00
David Schulz
e6d0ed3160 LanguageClient: support versioned diagnostics
Change-Id: Id182431f371201c7266fe0683e78fe56a8a9735b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 12:40:07 +00:00