Commit Graph

62421 Commits

Author SHA1 Message Date
hjk
1b6c212928 Android: Use FilePath operations in AndroidConfig::parseDependenciesJson()
Change-Id: I32bd5cbce4f486132be338c4318f499ce0b03325
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-25 05:38:02 +00:00
Jarek Kobus
1a5db9ca4e Refactor CallerHandle / LauncherHandle
Fix a race condition in the following scenario:

  QtcProcess proc(...)
  ...
  proc.start();
  proc.waitForStarted();
  if (!proc.waitForFinished()) {
      // handle failure here
      return;
  }
  // handle success

Move all the data into the caller's handle
and manage the QtcProcess state only from
inside caller's thread. This eliminates race
conditions when state changed from inside launcher's
thread while the caller's thread isn't notified
immediately.

For example: currently, when the launcher's thread receives
finished signal it doesn't change the process state
immediately, but posts a finished signal to be
dispatched in the caller's thread. When the caller's
thread dispatches the posted signal (inside flush() method)
it changes its state and posts the finished signal to the
outside world.

Don't flush all signals from waitForStarted(). Flush
only started signal in this case.

Change-Id: Ia39c4021bf43b8d0e8fcda789c367c096bfd032c
Reviewed-by: hjk <hjk@qt.io>
2021-08-24 18:24:18 +00:00
Mahmoud Badri
72536eb155 QmlDesigner: Fix assets library theming
Also define the themeUnimportedModuleColor value in the theme files.

Fixes: QDS-4935
Change-Id: I3fc0b2316ebc1b11e4de87c09e2136e768e5cbe2
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-24 18:09:23 +00:00
Henning Gruendl
88ee84c5b1 QmlDesigner: Fix splash screen check box color
Task-number: QDS-4934
Change-Id: Ia92675d7c83eb5a94892714fd7889f85182d2e13
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-24 17:57:23 +00:00
hjk
d932b8535a Qmake: Allow removing QMLJS from project languages
E.g. when the last use of the libraries was removed from .pro files.

This also makes the use more similar to the other build systems and
allows making Project::{add,remove}ProjectLanguage private.

Change-Id: Ib23d83f2fb5aab728b344c164a1331429b44e345
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-24 17:06:50 +00:00
hjk
22ecef0444 ProjectExplorer: Streamline access to buildDirectoryTemplate data
There's only one kind of use, in the context of BuildConfiguration.

Change-Id: I09628ff443ef08e28738125a614c17d5d979189b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-24 16:27:33 +00:00
hjk
cd3c2fdc5b SdkTool: Compile fix
Change-Id: Ie0c4cb968560bdd73b12a04cb6ebb4aefb75931b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-24 16:25:18 +00:00
Jarek Kobus
e2599b45ff Fix LauncherInterface's destruction
Change the lifetime of LauncherInterface. Now it's being
constructed when startLauncher() is called and
destructed on stopLauncher(). Before, we hold the
static LauncherInterface object and couldn't control when
it's being destructed, so in fact the destruction
started too late, after the QtSingleApplication's destructor
finished.

Simplify LauncherInterface::isStarted() method.

Change-Id: I91f38212177318746d2530a418eb3efd3d9258cb
Reviewed-by: hjk <hjk@qt.io>
2021-08-24 14:04:37 +00:00
Christian Stenger
1a25f356ff SdkTool: Fix build
Change-Id: I904e88da7ae4da26a559f8cdad207876b05f61f0
Reviewed-by: hjk <hjk@qt.io>
2021-08-24 13:54:46 +00:00
Thomas Hartmann
c7de2a224f QmlDesigner: Fix crash
There may exist components that do not belong to any project.

Task-number: QTCREATORBUG-26166
Change-Id: I77f5ec9c5d718300a38db203f9b5d1b1a4e96d1f
Reviewed-by: Tapani Mattila <tapani.mattila@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-24 13:53:48 +00:00
hjk
67e2db4bcb Debugger: Use QtcProcess in CoreUnpacker
Change-Id: I0eeaaf0c6f5d49f92de35a59c5e777e73a6abc66
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-24 13:08:37 +00:00
hjk
aec0b31904 Android: Use FileUtils in AndroidManifestEditor
Also fix an untimely translation and its context.

Change-Id: I9859216a458d5cff93bc9caa93164435b86d8383
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-24 13:06:16 +00:00
Aleksei German
c129ecfc3c QmlDesigner: Fix for styles ComboBox
- New styles;
 - Rework to be more reliable with complex names.

Task-number: QDS-4750
Change-Id: I63d89575540a463e8b6786c82a28effa185f10c5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Aleksei German <aleksei.german@qt.io>
2021-08-24 13:06:11 +00:00
hjk
062006b07f Android: Use FileUtils in AndroidDeployQtStep::createConfigWidget
Change-Id: Ib2ca0dbcdc811a6c130bf921845484b95039d076
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-24 11:45:58 +00:00
Eike Ziller
6feed6e656 QmlPreview: Fix socket connection on macOS
With Design Studio branding the temporary path got just too long (107
chars). Make the file name shorter, and add a warning for future
reference.

Change-Id: Id5ff448d55a8b109234b7c113695ea54b1836a2f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-24 11:08:16 +00:00
Alessandro Portale
bf2088075d Android: Don't crash in AndroidAvdManager
cancelChecker is an optional parameter.

Change-Id: Ie47ae834a34f8ebf8c901e4dcaf7a9c3af5c0ce4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-24 09:21:20 +00:00
Thomas Hartmann
8c8519853c QmlDesigner: Do not set literals as bindings
Literals like 'true' or '1' are no bindings and should be set
as variant properties. This requires special handling for QVariant.

Task-number: QDS-4684
Change-Id: Ib831fb78e76fbd7563fe3897b8a2c5379ee9a9db
Reviewed-by: Tony Leinonen <tony.leinonen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-08-24 08:55:04 +00:00
Thomas Hartmann
c0c3920a11 QmlDesigner: Allow bindings in default properties
Task-number: QDS-4704
Change-Id: I7138fb268e52252215f4fde358a9ea43451c0eef
Reviewed-by: Tony Leinonen <tony.leinonen@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-08-24 08:54:55 +00:00
Christian Kandeler
5c6ebf7434 CppEditor: Fix race condition in test
Opening an editor starts a new parser, so we must do that before we wait
for the parsing to finish.

Change-Id: Iee9da8da1fb60bf496a093d8efd878101d91f53f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-24 08:19:54 +00:00
hjk
d119c717c1 Core: Use Utils::CommandLine in ExecuteFilter
... using a new CommandLine::fromUserInput convenience function.

Change-Id: Ic786530af89ec80f4211e66f36caa22cb705effe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-24 07:53:29 +00:00
hjk
20a63d6c7e Utils: Drop OsType parameter from CommandLine functions
The type is implicitly given by the command's executble FilePath.

Also, rename the rarely used addArgs(const CommandLine &) overload
to addCommandLineAsArgs() and make it strip scheme and host from
the wrapped executable as there are no uses expected where keeping
them would be the right thing.

Change-Id: Id0b76778e7e01ac16e477f36bf30bb28d96bb177
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-24 07:36:04 +00:00
hjk
d735d3238f Core: Use more FilePath in ShortCutSettings and ActionManager
Change-Id: I0ef1afd554cf7785bb80417651f2bcf54d9cf6be
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-24 05:24:18 +00:00
hjk
d19a77c12a Nim: Proliferate FilePath use in NimbleBuildSystem
Change-Id: I1c5d5a6fed96ba189cd5e9f4f45cf103f991df46
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com>
2021-08-24 05:15:23 +00:00
Tapani Mattila
4c50ec85b7 QmlDesigner: Show warning icons for each file
Task-number: QDS-3797
Change-Id: Ibcbed1a221e762e0e6a3b4f9f538b8e4b1f144d3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-23 16:21:41 +00:00
Henning Gruendl
7d7ca4fd89 QmlDesigner: Allow hot reload for shadow builds
In shadow builds copies of the QML files are loaded.
When setting LOAD_QML_FROM_SOURCE the QML source files will be loaded
from the source directory instead.
Works only for cmake and qmake

Task-number: QDS-4317
Change-Id: I6e82864f073cb2fdf1111daf74a133c556e8721b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-23 15:09:14 +00:00
Thomas Hartmann
777efce0e6 QmlDesigner: Fix assert
Task-number: QDS-4875
Change-Id: I16ec87b8fdf6353b6ec3947d4905dc4d057a49b7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-23 15:08:52 +00:00
Marco Bubke
070cb5e09d Projects: Fix deprecated iterator
std::iterator is deprecated in C++ 17. The aliases should be set directly.
The aliases are public too.

Change-Id: Ib4dc259b03bd9386ba9d177340b89cc7208c8643
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-08-23 12:03:45 +00:00
hjk
57a90b019f Utils: Introduce a FilePath::searchInPath() convenience function
Diverts to searchInDirectory(). Use it in some places.

Change-Id: I9e5642f0ae0ed4dd9fb9f34bcaa11a25bd26c690
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 11:56:24 +00:00
Jarek Kobus
59c0e5480a Compile fix
Amends 53050255de

Change-Id: I3e4ff447885dbb46b7c8165ab0b4160f0d176cf1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-23 11:54:38 +00:00
hjk
4ceeeca715 Debugger: Remove some uses of FilePath::toFileInfo()
Change-Id: I78037741084630fc6852f5805595ec2943db64d2
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 11:46:08 +00:00
hjk
94141aecb4 EditorManager: Allow remote files in skipOpeningBigTextFile()
Change-Id: I8de8ee2bc2e2a8294e0f751700102a99488d4e1b
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 11:40:38 +00:00
hjk
53050255de Utils: Rename FilePath::normalizePathName to normalizedPathName
Change-Id: Idf5faab1cf55d6f7cca493c8ad451825310f5d66
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-23 11:15:01 +00:00
Christian Kandeler
303b554543 CppTools: Make sure there's only one C++ parsing thread per project
Switching back and forth between targets or build configurations could
result in an arbitrary amount of C++ parser threads running at the same
time, wasting valuable resources.
We now cancel a currently running parser thread when starting a new one
for the same project.

Fixes: QTCREATORBUG-24890
Change-Id: Ie1afc4971515fcad01dae182578fd77daa642cec
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-23 11:13:45 +00:00
hjk
db014de91c Utils: Introduce FilePath::normalizePathName()
... as wrapper around FileUtils::normalizePathName, and use it
in some places.

Change-Id: I42792e1f175b8119c8db930eae80a9f822ac70fa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-23 10:37:26 +00:00
hjk
04c1d29828 Valgrind: some more FilePath in heob code
Change-Id: I53603b1a984bedd0a9d04aab9f6fbc38d9feee21
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 10:21:27 +00:00
Christian Kandeler
49d8f1ad37 CppTools: Remove unused additional indexing support object
Its presence is confusing.

Change-Id: I61986e970e0f58cded5b97dae2cd28abcdb3ecff
Reviewed-by: hjk <hjk@qt.io>
2021-08-23 09:59:06 +00:00
hjk
0d7f357294 Utils: Use more FilePath in PathChooser
Change-Id: I0a59cb7b8c613a5533e02ad29088f58de02ff578
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 09:49:50 +00:00
Christian Kandeler
e5eee745ea CppEditor: Fix tests
Amends 35fcd96b85.

Change-Id: I0fe016f0d801922d847858de374e1a95f7a2bb0c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 09:10:31 +00:00
Christian Kandeler
e0e8fda580 ClangCodeModel: Use clangd for completion and function hint
Change-Id: I80160f3a40da18ac178682afe6caba5e5af6e3eb
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-23 09:06:31 +00:00
hjk
67d2a4186b Utils: Remove some unused code from BuildableLibrary
Change-Id: I2d720faf57d644bd3b734383df5c4bdcaa7af961
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 07:20:25 +00:00
Orgad Shaneh
c3c592eed4 Utils: Add missing emits in ShellCommand
Change-Id: Ibfdcad6baaf05e47bec1c13647fa301a777a8346
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-22 06:37:30 +00:00
Artur Shepilko
eb69ecd3c7 EditorManager: Do not add Watcher for documents with no file name
Currently EditorManagerPrivate::addEditor() adds a Watcher for any
document unless it's set as temporary.

However some documents may have no associated file name (for example, VCS
editors content), yet not explicitly created as temporary. This
eventually leads to an empty file name in the list of paths to watch.
Thus this triggers a check-warning:

    QFileSystemWatcher::addPaths: list is empty

Since IDocument::filePath() in general is not guaranteed to be non-empty,
then it makes sense to add a Watcher only for documents with an
associated file name.

Change-Id: Ie7eacb7f90af399e6b1a837e1644bd5a1fe99212
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-20 18:22:25 +00:00
Cristian Adam
54c5322322 CppTools: Code model fix for C++20, MSVC, and newer CMake versions
Starting with version 3.20 CMake adds -std:c++20, which breaks the
code model when using MSVC.

Clang-cl 12 doesn't know about -std:c++20, but clang driver knows
about -std=c++20.

Fixes: QTCREATORBUG-26146
Change-Id: I696842e11b0a9ba8849455d2f81f8dde6dd95a27
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-20 15:28:57 +00:00
hjk
652aa041b3 CppTools: Some code cosmetics
Namespaces, foreach.

Change-Id: I0129ee1ed1f5d1625869e8b5cb6173e3f71166e1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-20 15:28:14 +00:00
hjk
a9f5a9c6a4 Bazaar: Simplify BazaarPluginPrivate::isConfigured() check
Change-Id: If3e940c38149f5ae75d99582593918f4847c8c3e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-20 15:09:00 +00:00
Mahmoud Badri
dc8801e495 QmlDesigner: Fix form editor broken render
...when creating a new project on first launch of the QDS using Qt6.

Task-number: QDS-4474
Change-Id: I486ecde9306bcacb3619e291d2967b411a362d5b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-20 15:08:00 +00:00
hjk
4bf6008158 Vcs: Use FilePath for working directory in DiffEditorController
Change-Id: I7b5e1349bc679bd90b7781fbe0b40485ec653473
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-20 15:06:26 +00:00
hjk
6d3659bef4 Debugger: Be a bit more explicit about why debugging fails
Ignoring python, pure Qml debugging is fine without debugger in the kit,
everything else not.

Fixes: QTCREATORBUG-26152
Change-Id: If6ebb50968ede85e8210e191dbabd51cf61e177b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-20 14:21:02 +00:00
Cristian Adam
c1c70d339d CMakePM: Fix build library search path with CMake 3.20+
CMake 3.20 has changed the relative path to dependent libraries
from current binary directory to main binary directory.

See https://gitlab.kitware.com/cmake/cmake/-/issues/22556

Fixes: QTCREATORBUG-26110
Change-Id: I39c1d6b2998ebb079e7017e8d349881752d80354
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-20 13:58:15 +00:00
Cristian Adam
19fded6a6a CMakePM: Add variables to skip Qt Creator's package manager to cache
This way you will get the variables in the variables list and you only
need to change them from OFF to ON.

This won't fix the tasks below, but it will remove the lookup of the
special variable names.

Task-number: QTCREATORBUG-25680
Task-number: QTCREATORBUG-25891
Task-number: QTCREATORBUG-25972
Change-Id: I8ed1d5c4275516b10f4f10ad63b3de0f6b2ffbc8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-20 12:40:37 +00:00