Commit Graph

6876 Commits

Author SHA1 Message Date
Christian Kandeler
7b9fec2aa8 Debugger: Remove CMAKE_INCLUDE_CURRENT_DIR from autotest project file
Not needed.

Change-Id: Ia75cd0b70f2976a03948e7d8569027f6c0242344
Reviewed-by: hjk <hjk@qt.io>
2022-09-26 15:03:44 +00:00
Marco Bubke
6659024dd3 QmlDesigner: Add sourceContextAndSourceId to SourcePathCache
Change-Id: I4f5eb784e80d3afc10aa007f3be1604f6e18e312
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-26 08:49:54 +00:00
Eike Ziller
4fd4b42f3d Fix FilePath::absoluteFilePath for default constructed file path
FilePath::absoluteFilePath() would consider an empty path to be
relative, and resolved it wrt the current working directory. That is
unexpected in the sense that QFileInfo::absoluteFilePath behaves
differently, and lead to a crash down the line when e.g. a diff editor
was opened when the current working directory is '/' (the default on
macOS when started with "open" or from Finder, Dock or Spotlight).

Make FilePath::absoluteFilePath() return and empty path if the input was
empty.

Change-Id: Ie0d4da50afa24134bd56505b2f4abcf382eee982
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-09-26 07:43:36 +00:00
Marcus Tillmanns
d97b2fd6f4 FSEngine: Add tests for reading/writing
Change-Id: If38d27933727d4af0b24758bdf1a58f5ea78fd1b
Reviewed-by: hjk <hjk@qt.io>
2022-09-23 11:19:35 +00:00
hjk
dd585c601c Utils: Make path cleaning platform agnostic
Unfortunately, QDir::cleanPath() only cleans according to the rules
of the host system, which can be wrong in remote setups.

As the implementation is not accessible/tweakable from the outside,
copy the relevant code and remove the platform #ifdef's.

Change-Id: Ife9a925412a12d3cef21ed3721a387c61c152ddf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-23 09:25:05 +00:00
hjk
815f3e87b8 Utils: Don't create FSEngineImpl::m_tempStorage on close()
It's too late, and apparently "close-without-open" is triggered:

QDEBUG: tst_fsengine::testRootPathContainsFakeDir() SOFT ASSERT: "m_tempStorage" in /data/dev/creator/src/libs/utils/fsengine/fsengine_impl.cpp:64
QDEBUG: tst_fsengine::testListDir() SOFT ASSERT: "m_tempStorage" in /data/dev/creator/src/libs/utils/fsengine/fsengine_impl.cpp:64

Change-Id: Ic7100d7abddfffca909b412ea7ea19e295c86729
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-23 05:37:59 +00:00
Marco Bubke
0be4de69d8 QmlDesigner: Remove parent from abstract view
We apply not very often the parent to views. So it can lead to dangling
pointer if the parent is used by other objects and does not handle the
null pointer case. It can lead to double deletion if the parent is
deleted before the object when it is on the stack or handled by smart
pointer.

If you really want to use it there is still setParent.

Change-Id: I1fc6b145a50f037a0e9d415fb36e7970ea7296ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-09-22 19:08:12 +00:00
Marco Bubke
4bb4e07ad8 QmlDesigner: Inline SynchronizeCommand
Change-Id: Id030fb6aba7f1ba61ce97ebebb5e91a809ab6d8d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-22 19:06:21 +00:00
Marcus Tillmanns
852ded54d0 DeviceShell: Test no-script fallback
Change-Id: I97f6df6face701b247b6be3320d89511a1310857
Reviewed-by: hjk <hjk@qt.io>
2022-09-22 13:36:03 +00:00
hjk
a35a19d165 Utils: Introduce FilePath::{root,schemeAndHost}Length(QStringView)
Intended as helpers for parentDir() to stop when cutting components.

Change-Id: I7615803743351a733d6f3cc9813e9de85973dc61
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2022-09-22 09:19:42 +00:00
Marcus Tillmanns
fb7f91ad79 Android: Document the android-in-docker hackathon
Change-Id: Idb6ad65538ede75b687307d24d00a36b338f4c5e
Reviewed-by: hjk <hjk@qt.io>
2022-09-20 14:22:09 +00:00
David Schulz
85c5edcb6b FuzzyMatcher: add option to match text with spaces
Change-Id: I0480b57d27f3625933005ca2233e9612df53072d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-20 10:31:39 +00:00
Christian Stenger
215b2ce09b Tests: Fix expectation and remove os limitation
Change-Id: I6007c25ec4167083134b0cd03fdff8a9ff34355d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-20 10:12:34 +00:00
hjk
3dff69979b Utils: "Fix" UNC file path parsing
... by adapting the expectations.

Change-Id: If3a3fe2def370440f1edbbcb5a1c2646f1239f67
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-19 13:24:43 +00:00
hjk
3522097a8b Utils: Normalize backslashes on FilePath parsing again
Change-Id: I8ee0bc53244785d78acfad406664a907ab088301
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-19 13:24:20 +00:00
hjk
b3200b7730 Utils: Move 'isWindowsHost' test to startsWithDriveLetter callers
"Fixes" one Q_SKIP and makes the implementation OS-agnostic.

FilePath::osType() actually depends on the host system for not fully
qualified file paths, and that doesn't seem to be the right thing to do
in all cases. The caller may actually have more context to decide
whether this is needed (e.g. in pathchooser.cpp in the context of
"return value from a GUI element, i.e. 'host' implied).

Change-Id: Iff80c17094d2deec79d34d0527223fbcf8294935
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-19 13:14:58 +00:00
Marcus Tillmanns
cc6a7b113a fileutils: Fix tests
Change-Id: Iafeab41b0e6f7cdb10802e48c3bc7fe5548c064c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-19 11:01:30 +00:00
The Qt Project
f2c57db69f Merge "Merge remote-tracking branch 'origin/8.0'" 2022-09-19 08:56:50 +00:00
hjk
85c899de63 Utils: Make root recognition in FilePath::fromString host agnostic
Fixes a few XFAILS and a QSKIP

Change-Id: I012d873097dfa0ea565adc4e9a2b34f6c21db9dc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-19 08:51:20 +00:00
hjk
b133197258 Docker/Android: Add Dockerfile for manual test
Done-by: Alessandro, Cristian, Marcus
Change-Id: I3806bb7386f5e7db28489f9f7e685648bfc20110
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 08:33:19 +00:00
Eike Ziller
5d55cfdae5 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf
	src/libs/utils/fileutils.cpp
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/qmldesigner/designercore/include/abstractview.h
	src/plugins/qmldesigner/designercore/include/nodemetainfo.h
	src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
	src/plugins/qmldesigner/designercore/model/model_p.h
	src/plugins/remotelinux/linuxdevice.cpp
	tests/auto/utils/fileutils/tst_fileutils.cpp

Change-Id: I26a21e2523d3d725fdb8c548a531cdbdaeaeca20
2022-09-19 09:54:06 +02:00
hjk
2f2e266fdf Utils: Make FilePath::toString() output OS-independent again
Change-Id: Ica7c09ea39a38e3425b28c63b6001ad7ad641a4f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 07:44:26 +00:00
hjk
31556332f5 Utils: Make FilePath::toFSPathString a full copy of toString
Changing the toString() to prepend system-specific prefixes
to cater for the remote filesystem model handling had unintended
sideeffects.

This here is the first step to split both paths.

Change-Id: I66cdd9a87802408e2ba95c2e29b9d7cce7fe2553
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-16 08:24:20 +00:00
Robert Löhning
a35ebe2753 Squish: Update and improve isMsvcConfig()
Change-Id: Icff3a8178e89623097e2da7ff8f1e72197f1a4dc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-16 08:09:53 +00:00
hjk
2369dcc324 Utils: More cross-platform fileutils/root() tests
Don't hardcode a single type of OS (Windows/Non-Windows) via
QDir::rootPath(), actually check both, independent of the host OS.

Most of the new tests are actually failing, as the parsing code uses
the host OS. Mark those tests as "Expexted fail" for now.

Change-Id: Ic907582ad3959ef95b9618826d987d4eab463b49
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-15 14:09:06 +00:00
Eike Ziller
e7ddd8a5b7 FilePath: Return optional bytearray from device hooks
For differentiating between "error" and "empty file".

Change-Id: I1806bb7386f5e7db28489f9f7e685648bfc20110
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-15 11:28:18 +00:00
Marcus Tillmanns
b573250a8a FSEngine: Disable tests on Windows
Recent changes in FilePath made it incompatible with windows targets
(by design). Therefore we disable the tests here.

Change-Id: I2182c64f36268f5ab6282d149930653a79cc9aa1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-15 07:44:27 +00:00
Marcus Tillmanns
ed46f1f002 linuxdevice: Fix ::bytesAvailable
DeviceShell does not support piping commands at the moment.

To continue to support ::bytesAvailable the parsing of the
output from "df" is moved to FileUtils::bytesAvailableFromDFOutput.

Change-Id: Ia229208748aa6c572b99899e6ae042bdd5654f4a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-09-15 05:21:52 +00:00
Marco Bubke
e4b8e78ca2 QmlDesigner: Refactor validation checks
Origanally my idea was that there can be no invalid model nodes created.
Because it was practically to return invalid nodes we added a default
constructor. So now we have invalid nodes because we explicitly created
them and invalid nodes because we destroyed them(except the root node
which has to be always valid). To remove all the isValid test two new
approches are introduced.

Instead of throwing an exception a reasonable return value is provided
or the function is simply doing nothing.
For example if you try to remove an non existing property nothing is
happen. If you try to get an non existing property you get an invalid
property. If you then try to get an value from that property you get an
null(false) value.

All object can now be tested for true or false. So you can write:

if (auto property = getnode().property("foo"))
    // do something with if node and property are positive

Task-number: QDS-7454
Change-Id: I9ebb0bae45354cedc0b6cfe610d1a71435ee1f38
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-14 13:08:31 +00:00
Cristian Adam
2ab1e76ca9 CMakePM: Add support for configure CMake presets
This patchset will add support for version 1 of the CMakePresets
feature that has been implemented in CMake 3.19

https://cmake.org/cmake/help/v3.19/manual/cmake-presets.7.html

The tests/manual/cmakepresets contains a manual test example for this
feature.

Task-number: QTCREATORBUG-24555
Change-Id: I93aba1ab4f090613d0b21d970b5b651d12c922af
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-14 11:50:49 +00:00
Christian Stenger
a484f3fef5 Tests: Add fsengine related tests to qbs build
Change-Id: I05d6c1da01c972cfcfc15d2d09b57f29e248fad1
Reviewed-by: hjk <hjk@qt.io>
2022-09-14 10:38:19 +00:00
Marco Bubke
40aa1eee06 QmlDesigner: Reactivate coretests
Change-Id: Ia4b6b4b6cd25ad4bb5ff0e0a7c5629af2f5ed6db
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-13 14:13:12 +00:00
Marcus Tillmanns
2f0a26c1f5 Filepath: Revert "root"
Change-Id: I3f8e8d8eb32f4e3246942aad2f1205034bfafc07
Reviewed-by: hjk <hjk@qt.io>
2022-09-13 07:58:04 +00:00
Eike Ziller
2456f8f568 Convert file search API to FilePath
Fixes: QTCREATORBUG-28135
Change-Id: Iec8fcbae40adcccbe775de5719a657f5aa30a941
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-12 12:24:48 +00:00
Eike Ziller
2c51e4bc17 FilePath: Return optional bytearray for file contents
For differentiating between "error" and "empty file".

Change-Id: I2c019ceac625e7be3180afa4d47ae3a24df91c1d
Reviewed-by: hjk <hjk@qt.io>
2022-09-12 11:57:04 +00:00
hjk
e197acd97b Utils: Make tst_fileutils::fromString() independent of host os
Also, add checks for the resulting root() bits

Change-Id: I3f82b5be95ab89c65d904fc941d537582bd54876
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-09-08 11:49:47 +00:00
David Schulz
662528675c Docker: add dockerfile for pyside image
Change-Id: Ibfb61f78d7a91e22d6f76747b19eeaf092468ae6
Reviewed-by: hjk <hjk@qt.io>
2022-09-08 04:55:44 +00:00
Marcus Tillmanns
58b8005f03 Process Test: Skip unix only test on windows
Change-Id: Ie019af53a6b41784275d4b64b57a9c3bd493a24c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-09-06 14:33:36 +00:00
hjk
b94d4f75d0 Utils: Code cosmetics in tst_fileutils.cpp
Change-Id: I2afc6e96f53d8bc2a7c9a8125bdd8ba9b6510baa
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-06 10:56:07 +00:00
Jarek Kobus
a9eb732ce6 FileSearchResult: Use FilePath for fileName
This saves about 2 seconds out of 5 seconds spent in
displayResult() for converting from QString into
FilePath in main thread (use case: gitgrep with
2 million hits).

Change-Id: I6334e8559986501c34c90a5c7c6b4acc9a6953e0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-06 07:02:15 +00:00
hjk
56a8c59845 Utils: Make OsType addition less visible
Change-Id: I092930ef6b0ed6876e32ed6b0c78d6bd58becddc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-02 08:25:27 +00:00
Marcus Tillmanns
d4e385de06 Deviceshell: Base64 not found fallback
If no base64 is installed on the target, the shell script
cannot work. Previously this would lead to the shell functions
being unavailable.

This change adds a fallback path. In case no base64 is found,
the shell will create a process for each run request instead.

This is much slower than the shell script, but acceptable as
a fallback.

Change-Id: I70591d7e610c4e1c3c258a8e4bef354221d05cb9
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 13:30:46 +00:00
hjk
7cfc3d26bc Utils: Replace FilePath part setters
... by a combined version. This will make it easier to store the parts
in one QString object.

Change-Id: Ie85a77e3957c78a30e49998fe2e617af35a8ad17
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-01 07:59:29 +00:00
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +00:00
Marcus Tillmanns
1af0eb3504 FilePath: Fix setFromString for short urls
FilePath::setFromString failed previously for URLs
without a path, e.g. "http://qt.io" as it would add
the scheme and host to its path.

Also added a test for various URLs

Change-Id: I6c22489c0af7154734390aa1e5e12693864210b1
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 06:19:01 +00:00
Eike Ziller
a2f21d40f5 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/debugger/debuggerdialogs.cpp
	src/plugins/qmldesigner/components/materialeditor/materialeditorview.cpp
	src/plugins/texteditor/fontsettingspage.cpp

Change-Id: I5a6accd2065e0d8320045b57ade7b54a9a09aae0
2022-08-31 11:03:13 +02:00
Sona Kurazyan
60a045299d Prepare for moving qVersion() from qglobal.h to qlibraryinfo.h
Include qlibraryinfo.h where it's used.

Change-Id: I31afbca9c69e39eb05175704487ade1e8ae42eee
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-08-30 13:56:41 +00:00
Marco Bubke
da36459759 QmlDesigner: Refactor isSubClass
IsSubClass is renamed to isBasedOn and takes now NodeMetaInfo as a
parameter. But for most cases there are is... functions as short cut.
The model is providing shortcut NodeMetaInfos too. This is done in the
sake of caching.

Task-number: QDS-7445
Change-Id: Iff2dea66e253b412105427134bd49cb16ed76193
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-26 15:02:24 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Marco Bubke
0982e668e7 QmlDesigner: Add isBaseOf to project storage
It return true if it is the same or a derived type. You can use multiple
base types.

Task-number: QDS-7424
Change-Id: I965a7c5b87ef0eb0183be1c705ebc18dee1943c3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-26 12:15:58 +00:00