Commit Graph

62421 Commits

Author SHA1 Message Date
hjk
2ab2d96753 Utils: Use FilePath in copy helpers
Change-Id: I81b367a5851c0fbcdf45c63c5536c206845a8337
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-10 07:19:10 +00:00
Christian Stenger
af357c47fb QmlJS: Downgrade default log level
Avoid flooding logging messages by default and let the user enable
them explicitly.

Change-Id: I9f8fe044a460309e4462a5d88bd12a0ab6088731
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-08-10 07:05:02 +00:00
David Schulz
30981f5ba2 LanguageClient: fix typo
Change-Id: Icb04ed3f444b443ea97febeadd2766bb62fdbb85
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-10 06:20:27 +00:00
David Schulz
bbb06a72ec LanguageClient: reapply semantic highlight after font changed
Change-Id: I609e26b7f85744fdffb8399e0d651691b7c39900
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-10 06:20:20 +00:00
hjk
c179ce867c AutoTools: Some more FilePath use
Change-Id: I4833962abf72c09fa19977b88ae7ddc83303da95
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-10 06:20:07 +00:00
Christian Stenger
a5aef91411 ExtensionSystem: Add settingspath to system information
This information is re-used inside the System Information dialog.

Change-Id: I71d2b9a1574ea1cd3f68349d974555ec5625f185
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-10 06:12:48 +00:00
Tasuku Suzuki
5287142d91 Locator: elide middle of long text
When Locator shows long file paths, showing last part of path more can be
useful.

For example, if we search "qtcreator.png" in Qt Creator,
it shows eight QtProject-qtcreator.png paths in separate directries.

QtProject-qtcreator.png qt-creator/src/plugins/coreplugin/images/...
QtProject-qtcreator.png qt-creator/src/plugins/coreplugin/images/...
QtProject-qtcreator.png qt-creator/src/plugins/coreplugin/images/...
...

This patch improves as below.

QtProject-qtcreator.png qt-creator/src/.../128/QtProject-qtcreator.png
QtProject-qtcreator.png qt-creator/src/.../16/QtProject-qtcreator.png
QtProject-qtcreator.png qt-creator/src/.../24/QtProject-qtcreator.png
...

Change-Id: I2c796026f1ba123870000c28556e775831a438df
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-10 01:02:01 +00:00
Jarek Kobus
03c68e3840 Use QtcProcess inside CMakeBuildSystem::runCTest()
Change-Id: Ica83a8f43b34e21c379326e8dbd51d009dd2fd44
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 14:52:54 +00:00
Jarek Kobus
b80624611b Reuse ProcessHelper in process launcher
Handle lowPriority and unixTerminalDisabled inside
process launcher.

Change-Id: I7a8998e303da0e79186c1201fc6e1a76edb4e1b3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-09 14:38:43 +00:00
Jarek Kobus
4e06d3ac74 Handle setNativeArguments inside process launcher
Change-Id: I4b4db2e5cf6b3ad4d8a39614573564145f125520
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 13:31:24 +00:00
Jarek Kobus
8fa1a1f587 Handle belowNormalPriority inside process launcher on Windows
Remove setCreateProcessArgumentModifier() from the ProcessInterface
API and replace it with belowNormalPriority flag.

Change-Id: I6bcb92e56c3a68af7fa3e3a1c8b8eb13e3a2e5a7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 13:23:37 +00:00
Jarek Kobus
a2bc154ed0 Fix a crash when searching again for the last 12th item
Don't connect updateFilterButton() to the
QStackedWidget::currentChanged(). Call updateFilterButton()
explicitly by the end of setCurrentIndex().

Fixes: QTCREATORBUG-26099
Change-Id: I7cba97346e1f6c73171a9b83381e271750d50f25
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-09 11:55:31 +00:00
Christian Kandeler
6530a4fdc7 Fix some compiler warnings
Change-Id: I4eaf47bda086b83618f461ab19d1715c67e27ae1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-09 11:52:07 +00:00
hjk
d5eea3f994 Utils: Add Q_DECLARE_METATYPE for FileSearchResultList
Change-Id: Ibef1fc5d06405ee1c7a50a0d950ba3ac49625f53
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-09 11:30:51 +00:00
hjk
6615e67fbc Core: Proliferate FilePath use in FilePropertiesDialog a bit
Change-Id: Ifcb9df95052bcc504ffb867c71789ae268a92316
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-09 10:53:22 +00:00
hjk
ac1adc1ac0 Utils: De-noise BuildableLibrary a bit
Change-Id: Ia63fff31b55002d32fb20005c41df3db3b09f87c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-09 10:46:39 +00:00
Eike Ziller
7bae0b9d66 SilverSearcher: Fix crash in output parser
Neither parseFilePath nor parseText guarantee that index stays <
outputSize.

Change-Id: I087858cf6c1027fd04a7608c8ef10f4ce88348ef
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-09 09:33:22 +00:00
Eike Ziller
6f69ee8b27 SilverSearcher: Use data driven testing for output parser
Change-Id: Ia5a312a3c55eb753820d45ffcd72763137856933
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
2021-08-09 09:33:08 +00:00
Christian Stenger
400426ed9f Utils: Handle resolving paths and validation more appropriate
Manually editing the path inside a PathChooser will trigger some
validation and may end up in constructing some invalid paths
but still marking them as valid.
Beside this it will make the cursor jump to different locations
while typing which ends up in creating even more incorrect paths.
So, avoid creating invalid paths and mark the resulting path
as invalid if it is.

Change-Id: I27f55ae03745474fc6b91c44cdbc307c581fb2f8
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 09:30:28 +00:00
David Schulz
c63d72a8e8 LanguageClient: default initialize log message member
Change-Id: Ife6e59a1ec391b58e1d3f19d25a7be81993b8868
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-09 09:27:06 +00:00
Orgad Shaneh
26be258bf9 Core: Fix crash on shutdown
ProcessReapers waits for all the processes to terminate, and in the mean
time, it processes events. This is done after Core has already been
terminated, but QObject dtor has not been called yet, so not all signal
connections are disconnected.

Crash trace:
1  QWidget::actions                                            Qt5Widgets               0x7ff93a662fe9
2  Core::Internal::MenuActionContainer::updateInternal         actioncontainer.cpp 482  0x7ff93158be03
3  Core::Internal::ActionContainerPrivate::update              actioncontainer.cpp 417  0x7ff93158bd72
4  QMetaCallEvent::placeMetaCall                               Qt5Core                  0x7ff939b9ac34
5  QObject::event                                              Qt5Core                  0x7ff939b995c1
6  QApplicationPrivate::notify_helper                          Qt5Widgets               0x7ff93a644990
7  QApplication::notify                                        Qt5Widgets               0x7ff93a643a13
8  QCoreApplication::notifyInternal2                           Qt5Core                  0x7ff939b72aca
9  QCoreApplicationPrivate::sendPostedEvents                   Qt5Core                  0x7ff939b74845
10 qt_plugin_query_metadata                                    qwindows                 0x7ff960422dff
11 QEventDispatcherWin32::processEvents                        Qt5Core                  0x7ff939bbba5a
12 qt_plugin_query_metadata                                    qwindows                 0x7ff960422dd9
13 Core::Internal::ProcessReapers::~ProcessReapers             reaper.cpp          134  0x7ff9317b54ee
14 Core::Internal::CorePlugin::~CorePlugin                     coreplugin.cpp      114  0x7ff9315a705c
15 Core::Internal::CorePlugin::`scalar deleting destructor'    Core                     0x7ff9315a8584
16 ExtensionSystem::Internal::PluginSpecPrivate::kill          pluginspec.cpp      1125 0x7ff95299a160
17 ExtensionSystem::Internal::PluginManagerPrivate::loadPlugin pluginmanager.cpp   1608 0x7ff95298e2ad
18 ExtensionSystem::Internal::PluginManagerPrivate::deleteAll  pluginmanager.cpp   1061 0x7ff9529885f5
19 ExtensionSystem::Internal::PluginManagerPrivate::shutdown   pluginmanager.cpp   1397 0x7ff95299463f
20 QObject::qt_static_metacall                                 Qt5Core                  0x7ff939b91d49
21 QCoreApplicationPrivate::execCleanup                        Qt5Core                  0x7ff939b71b25
22 QCoreApplication::exec                                      Qt5Core                  0x7ff939b71aaf
23 main                                                        main.cpp            762  0x7ff734b31bf7
24 WinMain                                                     qtcreator                0x7ff734b38407
25 __scrt_common_main_seh                                      exe_common.inl      288  0x7ff734b3716a
26 BaseThreadInitThunk                                         KERNEL32                 0x7ff9a8806fd4
27 RtlUserThreadStart                                          ntdll                    0x7ff9a8adcec1

Change-Id: I7cf32f57354ee9e2507a2883078f0818fc5d6116
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-09 08:34:50 +00:00
Jarek Kobus
d22505c41f Use refactored ProcessMode
This patch needs to be applied together with the parent change.

There are 3 basic cases:
1. The user doesn't write anything to the write channel:
   You don't need to call closeWriteChannel manually anymore.
   By default the QtcProcess you create is in ProcessMode::Reader mode.
   Internally it opens the process in ReadOnly mode and
   closes the write channel just after starting.
2. The user writes some initial data (after being started)
   and then closes the write channel:
   All what is needed now it to set the write data
   (QtcProcess::setWriteData) before calling start.
   You also use the default ProcessMode::Reader mode.
   Internally it opens the process in ReadWrite mode
   and writes the writeData asynchonously when the process
   already started. After writing the data it closes the
   write channel automatically.
3. The user writes the data also after calling start.
   All you need now is to create a process with
   ProcessMode::Writer mode. In this mode the write
   channel is not closed.
   Internally it opens the process in ReadWrite mode
   as some writers also read the data from the process.

All the code base is adapted here to the above rules.

Change-Id: Id103019d1d71a3012fd1eade226fe96b9aaa48c2
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 07:51:31 +00:00
Jarek Kobus
25f585227f Refactor openMode/keepWriteChannelOpen/closeWriteChannel
Change-Id: I4090533875ce1da864b6f8554ce59dbc1392a142
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 07:51:26 +00:00
hjk
2b820cc42d Utils: Fix Coverty complaint
Change-Id: I69067a24e8c739f3e2241d06a3b4344a37b409c6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-09 06:22:14 +00:00
Christian Stenger
9cd71eb17b Utils: Fix compile on Windows
Amends 0567f35e21.

Change-Id: I337d4de98533aa408d404d1e6f49fa90cf757ee5
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 06:07:24 +00:00
Christian Stenger
3560d98cc1 PE: Be more restrictive in fixupDir()
Only modify device letter if it appears to be one.
Do not touch capitilization when fixing.
Amends b6dd53d4ed.

Change-Id: I55203eb14bc78d551dd4d88cd2a4e3efac3d816e
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 04:29:30 +00:00
Petar Perisin
fe9a1f52c1 Compile: add ability to parse standard output in build
When working with make wrapper scripts, sometimes they forward
everything to stdout. When this happens failures are not parsed,
and the are not "clickable" in QtC.
This patch adds an option to enable parsing of standard output.

Change-Id: I44b283dbdf6286f90c546898d496bff41de0d5ed
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-07 21:07:20 +00:00
Jarek Kobus
81cbb0a33c Return the write size
Amends 535d312e93

Change-Id: Icdc0eec0d017a65b64b6c20233c67caf2e81c16a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-07 00:04:49 +00:00
Aleksei German
a9f90eea03 QmlDesigner: Fix for crash in puppet creation
Task-number: QDS-4811
Change-Id: Ib1f0b2a76d539e709bea821f4cf950f9b2e94e83
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-08-06 15:40:18 +00:00
Jarek Kobus
535d312e93 Implement writing to process inside process launcher
Change-Id: I7321a941024d431cc52b3f6ae0b1ef38d851db8c
Reviewed-by: hjk <hjk@qt.io>
2021-08-06 14:32:21 +00:00
Jarek Kobus
7696f4f37c Remove bytesAvailable from ProcessInterface
It looks like in meantime it became unused.

Change-Id: I03ae4887e4af41e84e3b31ea7ce13ee302e2708e
Reviewed-by: hjk <hjk@qt.io>
2021-08-06 12:54:02 +00:00
hjk
c3077fde55 Utils: Rename cmd parameter to args in prepareArgs
That's what it is.

Change-Id: I45fa1de000cdd25990d3e292bc129a8a12af65c6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-06 12:51:59 +00:00
hjk
0567f35e21 Utils: Use Utils::CommandLine as input for ProcessArgs::prepareCommand
Change-Id: Ib5878a159bda0e6b6253f1f4e1abc1acb5ecb573
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-06 12:51:52 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +00:00
Christian Stenger
fec3ef202f AutoTest: Prevent potential nullptr access
Change-Id: I78eb4a5113d23273e9383c86fdefcffea05e0123
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-06 12:24:44 +00:00
hjk
4652ef286b Debugger: Show output of debugger detection
... in tooltip of debugger path lineedit.

Helps with cases where necessary libraries are missing.

The tooltip is a bit hard to recognize, but as such cases now also
are marked in red text there's at least some direct hint that something
is not ok.

Change-Id: Ic5da8dcb1921a98f91f6eed755fa87ce5feed698
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-06 11:12:12 +00:00
hjk
b8f369c436 Use the new file dialog wrappers in some places
Change-Id: I326c883f2f76593e6fcb0f3e376d387273312982
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 08:56:51 +00:00
hjk
ef1653698e ProjectExplorer: Use FilePath for ProjectNode::{path,directory}
... and let the fallout trickle down a bit.

Change-Id: I1a2f79e281725c4a121cc2fbbc0377e881616ce5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 08:09:26 +00:00
Jarek Kobus
f53d993d95 Move m_keepStdInOpen into the QtcProcessPrivate
In this way it may work transparently when using process launcher.

Change-Id: Idf42500650157b17bbefe5934515ca977adecf57
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 18:53:56 +00:00
Jarek Kobus
e41b6a0a29 Make process reusable when killing the running one
Try to mimic the behavior of QProcess inside process launcher
as much as possible. After calling QtcProcess::kill() we send
StopProcessPacket to the process launcher - when we receive
it there we start reaping of the process itself and report
back the finished packet with a failure.

Remove canceled state from the LanucherHandle, as after
canceling the process we still need to handle the finished
(or others) signals - like in case of QProcess.

Change-Id: Id66b06449de06675a0ab6778e93e9782afea09d4
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 18:53:41 +00:00
Jarek Kobus
d09f2c52c6 Cleanup the finished / unused processes
Change-Id: Ia29e51b7591338cf757ce3a6ddccfcc39fde086b
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 18:53:32 +00:00
Jarek Kobus
ba037a707e Implement readyRead inside process launcher
Change-Id: I3a27edef2307053b8c4c7d8f1dbf7e0400e27416
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 18:53:22 +00:00
Jarek Kobus
82340dbf73 Fix the astyle version matching
In my case astyle returns "Artistic Style Version 3.1" and
it didn't want to match.

Change-Id: Ie3bee186cb39d29f11fa1add2f99c87d5fd67842
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 18:52:59 +00:00
Cristian Adam
614c9a6cb6 CMakePM: Reference more CMake variables in auto-setup
This will remove the warnings for examples that setup only
the C++ compiler, or when configuring QML debugging.

Amends 1bf9900aed

Change-Id: Ica9361114be420b81f611f5d498d87949399e8b4
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 16:24:50 +00:00
Christian Kandeler
11da66f768 ClangCodeModel: Adapt to new "virtual" modifier
... in clangd's semantic tokens.
See https://reviews.llvm.org/D107145.

Change-Id: Idf9fe327df3fb806697ab5b806e89bb62d43e706
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-05 15:00:42 +00:00
Jarek Kobus
48c1f56ebe Refactor waiting for logic
Instead of waiting for certain state we wait for
certain signal to be placed into the buffer.
No need for m_finished flag anymore, since we are
only interesting if the buffer contains the finished
signal. This will enable to implement waiting for
ready read properly, since no state is changed
in this case.

Change-Id: I4209da385b2e37de6f1897357e35c0ed0c9e4096
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-05 14:50:49 +00:00
hjk
8e41a401b0 Utils: Fix pathchooser auto-search-in-path for remote cases
Amends 11a40e02f2.

Environment::searchInPath only works for local setups, the
remote replacement is FilePath::searchOnDevice.

Change-Id: I8a2ba51903d3308ca9198fbf1154779c78e69e63
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-05 13:58:00 +00:00
Christian Stenger
bf93998fb4 Docker: Fix filtering without a filter
If there is no filter accept all instead of nothing.
Fixes e.g. ABI detection on docker image running
on Windows.

Change-Id: I17588f71018952b1087b5b8f700b6c158bf5b89d
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 13:35:26 +00:00
Christian Stenger
b039013d9a QtSupport: Fix display of non-local Qt version info
Paths should be displayed with their os-specific separators.

Change-Id: I7d60b3ba29ee990d3317791c46701d41614fbdca
Reviewed-by: hjk <hjk@qt.io>
2021-08-05 13:35:17 +00:00
Thomas Hartmann
da2ebada18 QmlDesigner: Fix error message
A negative index was ignored before, but ::slide
now throws more aggressive.
In any case -1 means there is no item and that no slide is required.

Task-number: QDS-4796
Task-number: QDS-4601
Change-Id: Ief7f597e4d430652c2b18e6af3bc187c4c4e28a6
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-08-05 13:11:22 +00:00