diff --git a/dist/changelog/changes-11.0.0.md b/dist/changelog/changes-11.0.0.md index 32860826363..a9811dbeafd 100644 --- a/dist/changelog/changes-11.0.0.md +++ b/dist/changelog/changes-11.0.0.md @@ -10,21 +10,83 @@ the public Git repository. For example: git clone git://code.qt.io/qt-creator/qt-creator.git git log --cherry-pick --pretty=oneline origin/10.0..v11.0.0 +What's new? +------------ + +* Markdown editor with preview + ([QTCREATORBUG-27883](https://bugreports.qt.io/browse/QTCREATORBUG-27883)) +* Internal terminal + ([QTCREATORBUG-8511](https://bugreports.qt.io/browse/QTCREATORBUG-8511)) +* Experimental support for GitHub Copilot +* Experimental support for the `vcpkg` C/C++ package manager +* Experimental support for the Axivion static analyzer + +### Markdown + +You can open markdown (.md) files for editing or select `File > New File > +General > Markdown File` to create a new file. + +([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-markdown-editor.html)) + +### Terminal + +When you select the `Run in Terminal` check box and run an application or the +`Open Terminal` button to open a terminal, the default terminal opens in the +`Terminal` output view. It supports multiple tabs, as well as various +shells, colors, and fonts. + +To use an external terminal, deselect the `Use internal terminal` check box in +`Preferences > Terminal`. + +([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-output-panes.html#terminal)) + +### Copilot + +The experimental Copilot plugin integrates +[GitHub Copilot](https://github.com/features/copilot), which uses OpenAI to +suggest code in the `Edit` mode. + +To set Copilot preferences, select `Preferences > Copilot`. + +([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-copilot.html)) + +### vcpkg + +The experimental vcpkg plugin integrates the [vcpgk](https://vcpkg.io) +package manager for downloading and managing libraries. + +Select the `vcpkg` installation location in `Preferences > CMake > Vcpkg > Path`. + +To create a new `vcpkg.json` package manifest file, select `File > New File > +vcpkg`. The file is automatically added to the CMakeLists.txt file for the +project. + +Edit manifest files in the manifest editor. To search for packages to add to the +file, select the `Search Package` button on the manifest editor toolbar. + +([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-vcpkg.html)) + +### Axivion + +After you configure access to the [Axivion](https://www.axivion.com) Dashboard +and link a project to an Axivion project in the project settings, Qt Creator +shows annotations of the latest run in the editors and allows you to view some +details on the issues. + +([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-axivion.html)) + General ------- -* Added a `Terminal` view (QTCREATORBUG-8511) - ([Documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-output-panes.html#terminal)) - * Opt-out via `Preferences` > `Terminal` preferences - * Added support for - * different shells, colors, fonts, and multiple tabs - * opening file paths in Qt Creator with `Ctrl+click` (`Cmd+click` on - macOS) -* Added a more spacious "relaxed" toolbar style `Environment > Interface` +* Added a more spacious `Relaxed` toolbar style to `Preferences > Environment > + Interface` * Added a pin button to progress details instead of automatically resetting - their position (QTCREATORBUG-28829) + their position + ([QTCREATORBUG-28829](https://bugreports.qt.io/browse/QTCREATORBUG-28829)) * Improved the selection and navigation in the `Issues` view - (QTCREATORBUG-26128, QTCREATORBUG-27006, QTCREATORBUG-27506) + ([QTCREATORBUG-26128](https://bugreports.qt.io/browse/QTCREATORBUG-26128), + [QTCREATORBUG-27006](https://bugreports.qt.io/browse/QTCREATORBUG-27006), + [QTCREATORBUG-27506](https://bugreports.qt.io/browse/QTCREATORBUG-27506)) * Locator * Improved performance * Added the creation of directories to the `Files in File System` filter @@ -35,78 +97,79 @@ Editing ------- * Improved the performance of the multi-cursor support -* Fixed the saving of hardlinked files (QTCREATORBUG-19651) -* Fixed an issue of copy and paste with multiple cursors (QTCREATORBUG-29117) +* Fixed the saving of hardlinked files + ([QTCREATORBUG-19651](https://bugreports.qt.io/browse/QTCREATORBUG-19651)) +* Fixed an issue of copy and paste with multiple cursors + ([QTCREATORBUG-29117](https://bugreports.qt.io/browse/QTCREATORBUG-29117)) ### C++ -* Improved the style of forward declarations in the outline (QTCREATORBUG-312) +* Improved the style of forward declarations in the outline + ([QTCREATORBUG-312](https://bugreports.qt.io/browse/QTCREATORBUG-312)) * Added highlighting for typed string literals and user-defined literals - (QTCREATORBUG-28869) -* Added the option to create class members from assignments (QTCREATORBUG-1918) + ([QTCREATORBUG-28869](https://bugreports.qt.io/browse/QTCREATORBUG-28869)) +* Added the option to create class members from assignments + ([QTCREATORBUG-1918](https://bugreports.qt.io/browse/QTCREATORBUG-1918)) * Fixed that locator showed both the declaration and the definition of symbols - (QTCREATORBUG-13894) + ([QTCREATORBUG-13894](https://bugreports.qt.io/browse/QTCREATORBUG-13894)) * Fixed the handling of C++20 keywords and concepts * Built-in - * Fixed support for `if`-statements with initializer (QTCREATORBUG-29182) + * Fixed support for `if`-statements with initializer + ([QTCREATORBUG-29182](https://bugreports.qt.io/browse/QTCREATORBUG-29182)) ### Language Server Protocol -* Added experimental support for GitHub Copilot - ([GitHub documentation](https://github.com/features/copilot)) - ([Qt Creator documentation](https://doc-snapshots.qt.io/qtcreator-11.0/creator-copilot.html)) -* Added missing actions for opening the `Call Hierarchy` (QTCREATORBUG-28839, - QTCREATORBUG-28842) +* Added missing actions for opening the `Call Hierarchy` + ([QTCREATORBUG-28839](https://bugreports.qt.io/browse/QTCREATORBUG-28839), + [QTCREATORBUG-28842](https://bugreports.qt.io/browse/QTCREATORBUG-28842)) ### QML * Fixed the reformatting in the presence of JavaScript directives and function - return type annotations (QTCREATORBUG-29001, QTCREATORBUG-29046) -* Fixed that reformatting changed `of` to `in` (QTCREATORBUG-29123) -* Fixed the completion for Qt Quick Controls (QTCREATORBUG-28648) + return type annotations + ([QTCREATORBUG-29001](https://bugreports.qt.io/browse/QTCREATORBUG-29001), + [QTCREATORBUG-29046](https://bugreports.qt.io/browse/QTCREATORBUG-29046)) +* Fixed that reformatting changed `of` to `in` + ([QTCREATORBUG-29123](https://bugreports.qt.io/browse/QTCREATORBUG-29123)) +* Fixed the completion for Qt Quick Controls + ([QTCREATORBUG-28648](https://bugreports.qt.io/browse/QTCREATORBUG-28648)) ### Python * Added the option to create a virtual environment (`venv`) to the Python - interpreter selector and the wizard (PYSIDE-2152) - -### Markdown - -* Added a Markdown editor with preview (QTCREATORBUG-27883) -* Added a wizard for Markdown files (QTCREATORBUG-29056) + interpreter selector and the wizard + ([PYSIDE-2152](https://bugreports.qt.io/browse/PYSIDE-2152)) Projects -------- * Made it possible to add devices without going through the wizard * Added support for moving files to a different directory when renaming - (QTCREATORBUG-15981) + ([QTCREATORBUG-15981](https://bugreports.qt.io/browse/QTCREATORBUG-15981)) ### CMake -* Implemented adding files to the project (QTCREATORBUG-25922, - QTCREATORBUG-26006, QTCREATORBUG-27213, QTCREATORBUG-27538, - QTCREATORBUG-28493, QTCREATORBUG-28904, QTCREATORBUG-28985, - QTCREATORBUG-29006) +* Implemented adding files to the project + ([QTCREATORBUG-25922](https://bugreports.qt.io/browse/QTCREATORBUG-25922), + [QTCREATORBUG-26006](https://bugreports.qt.io/browse/QTCREATORBUG-26006), + [QTCREATORBUG-27213](https://bugreports.qt.io/browse/QTCREATORBUG-27213), + [QTCREATORBUG-27538](https://bugreports.qt.io/browse/QTCREATORBUG-27538), + [QTCREATORBUG-28493](https://bugreports.qt.io/browse/QTCREATORBUG-28493), + [QTCREATORBUG-28904](https://bugreports.qt.io/browse/QTCREATORBUG-28904), + [QTCREATORBUG-28985](https://bugreports.qt.io/browse/QTCREATORBUG-28985), + [QTCREATORBUG-29006](https://bugreports.qt.io/browse/QTCREATORBUG-29006)) * Fixed issues with detecting a configured Qt version when importing a build - (QTCREATORBUG-29075) + ([QTCREATORBUG-29075](https://bugreports.qt.io/browse/QTCREATORBUG-29075)) ### Python * Added an option for the interpreter to the wizards -### vcpkg - -* Added experimental support for `vcpkg` - ([vcpgk documentation](https://vcpkg.io/en/)) -* Added an option for the `vcpkg` installation location -* Added a search dialog for packages -* Added a wizard and an editor for `vcpkg.json` files - Debugging --------- -* Improved the UI for enabling and disabling debuggers (QTCREATORBUG-28627) +* Improved the UI for enabling and disabling debuggers + ([QTCREATORBUG-28627](https://bugreports.qt.io/browse/QTCREATORBUG-28627)) ### C++ @@ -114,16 +177,20 @@ Debugging (`Preferences > Debugger > Locals & Expressions > Default array size`) * CDB * Added automatic source file mapping for Qt packages - * Fixed the variables view on remote Windows devices (QTCREATORBUG-29000) + * Fixed the variables view on remote Windows devices + ([QTCREATORBUG-29000](https://bugreports.qt.io/browse/QTCREATORBUG-29000)) * LLDB * Fixed that long lines in the application output were broken into multiple - lines (QTCREATORBUG-29098) + lines + ([QTCREATORBUG-29098](https://bugreports.qt.io/browse/QTCREATORBUG-29098)) ### Qt Quick -* Improved the auto-detection if QML debugging is required (QTCREATORBUG-28627) +* Improved the auto-detection if QML debugging is required + ([QTCREATORBUG-28627](https://bugreports.qt.io/browse/QTCREATORBUG-28627)) * Added an option for disabling static analyzer messages to - `Qt Quick > QML/JS Editing` (QTCREATORBUG-29095) + `Qt Quick > QML/JS Editing` + ([QTCREATORBUG-29095](https://bugreports.qt.io/browse/QTCREATORBUG-29095)) Analyzer -------- @@ -131,11 +198,8 @@ Analyzer ### Clang * Fixed that a `.clang-tidy` file in the project directory was not used by - default (QTCREATORBUG-28852) - -### Axivion - -* Added experimental support + default + ([QTCREATORBUG-28852](https://bugreports.qt.io/browse/QTCREATORBUG-28852)) Version Control Systems ----------------------- @@ -143,7 +207,8 @@ Version Control Systems ### Git * Instant Blame - * Improved the performance (QTCREATORBUG-29151) + * Improved the performance + ([QTCREATORBUG-29151](https://bugreports.qt.io/browse/QTCREATORBUG-29151)) * Fixed that it did not show at the end of the document Platforms @@ -151,7 +216,8 @@ Platforms ### Android -* Fixed an issue with building library targets (QTCREATORBUG-26980) +* Fixed an issue with building library targets + ([QTCREATORBUG-26980](https://bugreports.qt.io/browse/QTCREATORBUG-26980)) ### Remote Linux @@ -159,14 +225,16 @@ Platforms ### Docker -* Added support for `qmake` based projects (QTCREATORBUG-29140) +* Added support for `qmake` based projects + ([QTCREATORBUG-29140](https://bugreports.qt.io/browse/QTCREATORBUG-29140)) * Fixed issues after deleting the Docker image for a registered Docker device - (QTCREATORBUG-28880) + ([QTCREATORBUG-28880](https://bugreports.qt.io/browse/QTCREATORBUG-28880)) ### QNX * Added `slog2info` as a requirement for devices -* Fixed the support for remote working directories (QTCREATORBUG-28900) +* Fixed the support for remote working directories + ([QTCREATORBUG-28900](https://bugreports.qt.io/browse/QTCREATORBUG-28900)) Credits for these changes go to: -------------------------------- diff --git a/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.png b/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.png deleted file mode 100644 index 584c595dcb3..00000000000 Binary files a/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.webp b/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.webp new file mode 100644 index 00000000000..b2068f155e8 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-devices-remote-linux.webp b/doc/qtcreator/images/qtcreator-preferences-devices-remote-linux.webp index a7fcb124adf..4b97b88b7a2 100644 Binary files a/doc/qtcreator/images/qtcreator-preferences-devices-remote-linux.webp and b/doc/qtcreator/images/qtcreator-preferences-devices-remote-linux.webp differ diff --git a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc index dd3a884f8e3..789b090ed65 100644 --- a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc +++ b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc @@ -33,9 +33,15 @@ \section1 Adding Boot2Qt Devices - If \QC does not automatically detect a device you connected with USB, you can - use a wizard to create either a network connection or a USB connection to - it. + If \QC does not automatically detect a device you connected with USB, select + \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > + \uicontrol Devices > \uicontrol Add > \uicontrol {Boot2Qt Device} to create + either a network connection or a USB connection to it. + + \image qtcreator-boot2qt-device-configurations.webp {Devices tab in Preferences} + + To add a device without using a wizard, select \uicontrol {Boot2Qt Device} in + the pull-down menu of the \uicontrol Add button. \note On Ubuntu Linux, the development user account must have access to the plugged-in devices. To grant them access to the device via USB, create a new @@ -46,8 +52,6 @@ You can edit the settings later in \uicontrol Edit > \uicontrol Preferences > \uicontrol Devices > \uicontrol Devices. - \image qtcreator-boot2qt-device-configurations.png {Devices dialog} - To reboot the selected device, select \uicontrol {Reboot Device}. To restore the default application to the device, select @@ -122,6 +126,10 @@ parameters that have sensible default values. One of these is the SSH port number, which is available in the variable \c %{Device:SshPort}. + + To add a device without using the wizard, select + \uicontrol {Boot2Qt Device} in the pull-down menu of the + \uicontrol Add button. \endlist \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > \uicontrol Add to add a kit for building applications for the diff --git a/doc/qtcreator/src/linux-mobile/linuxdev.qdoc b/doc/qtcreator/src/linux-mobile/linuxdev.qdoc index 028619c7fad..41820632d36 100644 --- a/doc/qtcreator/src/linux-mobile/linuxdev.qdoc +++ b/doc/qtcreator/src/linux-mobile/linuxdev.qdoc @@ -107,6 +107,9 @@ All of these parameters can be edited later, as well as additional ones that the wizard does not show because there are sensible default values. + To add a device without using the wizard, select + \uicontrol {Add Remote Linux Device} in the pull-down + menu of the \uicontrol Add button. \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol Kits > \uicontrol Add to add a kit for building for the device. Select the diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main.pyproject b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main.pyproject index 5c790aa7453..a490f3bd45f 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main.pyproject +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main.pyproject @@ -1,3 +1,5 @@ { - "files": ["%{SrcFileName}"] + "files": [ + "%{SrcFileName}" + ] } diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/main.pyproject b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/main.pyproject index b7922c9fab9..896598fde5f 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/main.pyproject +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/main.pyproject @@ -1,3 +1,6 @@ { - "files": ["%{SrcFileName}", "%{QmlFileName}"] + "files": [ + "%{SrcFileName}", + "%{QmlFileName}" + ] } diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/main.pyproject b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/main.pyproject index 64c2987a8fb..af1f60f084c 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/main.pyproject +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/main.pyproject @@ -1,3 +1,6 @@ { - "files": ["%{SrcFileName}", "form.ui"] + "files": [ + "%{SrcFileName}", + "form.ui" + ] } diff --git a/src/libs/solutions/tasking/tasktree.cpp b/src/libs/solutions/tasking/tasktree.cpp index 43a47121b2a..9c14ec66091 100644 --- a/src/libs/solutions/tasking/tasktree.cpp +++ b/src/libs/solutions/tasking/tasktree.cpp @@ -252,7 +252,7 @@ private: The GroupSetupHandler is used when constructing the onGroupSetup element. Any function with the above signature, when passed as a group setup handler, - will be called by the running task tree when the group executions starts. + will be called by the running task tree when the group execution starts. The return value of the handler instructs the running group on how to proceed after the handler's invocation is finished. The default return value of TaskAction::Continue @@ -1123,7 +1123,7 @@ void TaskNode::invokeEndHandler(bool success) Use the Tasking namespace to build extensible, declarative task tree structures that contain possibly asynchronous tasks, such as Process, - FileTransfer, or Async. TaskTree structures enable you + FileTransfer, or ConcurrentCall. TaskTree structures enable you to create a sophisticated mixture of a parallel or sequential flow of tasks in the form of a tree and to run it any time later. @@ -1131,14 +1131,14 @@ void TaskNode::invokeEndHandler(bool success) The TaskTree has a mandatory Group root element, which may contain any number of tasks of various types, such as ProcessTask, FileTransferTask, - or AsyncTask: + or ConcurrentCallTask: \code using namespace Tasking; const Group root { ProcessTask(...), - AsyncTask(...), + ConcurrentCallTask(...), FileTransferTask(...) }; @@ -1149,10 +1149,10 @@ void TaskNode::invokeEndHandler(bool success) \endcode The task tree above has a top level element of the Group type that contains - tasks of the type ProcessTask, FileTransferTask, and AsyncTask. + tasks of the type ProcessTask, FileTransferTask, and ConcurrentCallTask. After taskTree->start() is called, the tasks are run in a chain, starting - with ProcessTask. When the ProcessTask finishes successfully, the AsyncTask task is - started. Finally, when the asynchronous task finishes successfully, the + with ProcessTask. When the ProcessTask finishes successfully, the ConcurrentCallTask + task is started. Finally, when the asynchronous task finishes successfully, the FileTransferTask task is started. When the last running task finishes with success, the task tree is considered @@ -1172,26 +1172,26 @@ void TaskNode::invokeEndHandler(bool success) Group { parallel, ProcessTask(...), - AsyncTask(...) + ConcurrentCallTask(...) }, FileTransferTask(...) }; \endcode The example above differs from the first example in that the root element has - a subgroup that contains the ProcessTask and AsyncTask. The subgroup is a + a subgroup that contains the ProcessTask and ConcurrentCallTask. The subgroup is a sibling element of the FileTransferTask in the root. The subgroup contains an additional \e parallel element that instructs its Group to execute its tasks in parallel. - So, when the tree above is started, the ProcessTask and AsyncTask start + So, when the tree above is started, the ProcessTask and ConcurrentCallTask start immediately and run in parallel. Since the root group doesn't contain a \e parallel element, its direct child tasks are run in sequence. Thus, the FileTransferTask starts when the whole subgroup finishes. The group is considered as finished when all its tasks have finished. The order in which the tasks finish is not relevant. - So, depending on which task lasts longer (ProcessTask or AsyncTask), the + So, depending on which task lasts longer (ProcessTask or ConcurrentCallTask), the following scenarios can take place: \table @@ -1208,19 +1208,19 @@ void TaskNode::invokeEndHandler(bool success) \li ProcessTask starts \li ProcessTask starts \row - \li AsyncTask starts - \li AsyncTask starts + \li ConcurrentCallTask starts + \li ConcurrentCallTask starts \row \li ... \li ... \row \li \b {ProcessTask finishes} - \li \b {AsyncTask finishes} + \li \b {ConcurrentCallTask finishes} \row \li ... \li ... \row - \li \b {AsyncTask finishes} + \li \b {ConcurrentCallTask finishes} \li \b {ProcessTask finishes} \row \li Sub Group finishes @@ -1246,8 +1246,8 @@ void TaskNode::invokeEndHandler(bool success) The presented scenarios assume that all tasks run successfully. If a task fails during execution, the task tree finishes with an error. In particular, - when ProcessTask finishes with an error while AsyncTask is still being executed, - the AsyncTask is automatically stopped, the subgroup finishes with an error, + when ProcessTask finishes with an error while ConcurrentCallTask is still being executed, + the ConcurrentCallTask is automatically stopped, the subgroup finishes with an error, the FileTransferTask is skipped, and the tree finishes with an error. \section1 Task Types @@ -1277,11 +1277,11 @@ void TaskNode::invokeEndHandler(bool success) \row \li ProcessTask \li Utils::Process - \li Starts processes. + \li Starts process. \row - \li AsyncTask - \li Utils::Async - \li Starts asynchronous tasks; run in separate thread. + \li ConcurrentCallTask + \li Tasking::ConcurrentCall + \li Starts asynchronous task, runs in separate thread. \row \li TaskTreeTask \li Utils::TaskTree @@ -1540,7 +1540,7 @@ void TaskNode::invokeEndHandler(bool success) static QByteArray load(const QString &fileName) { ... } static void save(const QString &fileName, const QByteArray &array) { ... } - static GroupItem copyRecipe(const QString &source, const QString &destination) + static Group copyRecipe(const QString &source, const QString &destination) { struct CopyStorage { // [1] custom inter-task struct QByteArray content; // [2] custom inter-task data @@ -1549,28 +1549,28 @@ void TaskNode::invokeEndHandler(bool success) // [3] instance of custom inter-task struct manageable by task tree const TreeStorage storage; - const auto onLoaderSetup = [source](Async &async) { + const auto onLoaderSetup = [source](ConcurrentCall &async) { async.setConcurrentCallData(&load, source); }; // [4] runtime: task tree activates the instance from [7] before invoking handler - const auto onLoaderDone = [storage](const Async &async) { + const auto onLoaderDone = [storage](const ConcurrentCall &async) { storage->content = async.result(); // [5] loader stores the result in storage }; // [4] runtime: task tree activates the instance from [7] before invoking handler - const auto onSaverSetup = [storage, destination](Async &async) { + const auto onSaverSetup = [storage, destination](ConcurrentCall &async) { const QByteArray content = storage->content; // [6] saver takes data from storage async.setConcurrentCallData(&save, destination, content); }; - const auto onSaverDone = [](const Async &async) { + const auto onSaverDone = [](const ConcurrentCall &async) { qDebug() << "Save done successfully"; }; const Group root { // [7] runtime: task tree creates an instance of CopyStorage when root is entered Storage(storage), - AsyncTask(onLoaderSetup, onLoaderDone), - AsyncTask(onSaverSetup, onSaverDone) + ConcurrentCallTask(onLoaderSetup, onLoaderDone), + ConcurrentCallTask(onSaverSetup, onSaverDone) }; return root; } @@ -1650,7 +1650,7 @@ void TaskNode::invokeEndHandler(bool success) \code TreeStorage storage; - Group root = ...; // storage placed inside root's group and inside handlers + const Group root = ...; // storage placed inside root's group and inside handlers TaskTree taskTree(root); auto initStorage = [](CopyStorage *storage){ storage->content = "initial content"; @@ -1670,7 +1670,7 @@ void TaskNode::invokeEndHandler(bool success) \code TreeStorage storage; - Group root = ...; // storage placed inside root's group and inside handlers + const Group root = ...; // storage placed inside root's group and inside handlers TaskTree taskTree(root); auto collectStorage = [](CopyStorage *storage){ qDebug() << "final content" << storage->content; @@ -1758,7 +1758,7 @@ TaskTree::TaskTree(const Group &recipe) : TaskTree() TaskTree::~TaskTree() { QTC_ASSERT(!d->m_guard.isLocked(), qWarning("Deleting TaskTree instance directly from " - "one of its handlers will lead to crash!")); + "one of its handlers will lead to a crash!")); // TODO: delete storages explicitly here? delete d; } diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 5ba4922d668..4c824df6015 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -2346,16 +2346,12 @@ void IntegersAspect::setDefaultValue(const QList &value) A text display does not have a real value. */ -TextDisplay::TextDisplay(AspectContainer *container) - : BaseAspect(container), d(new Internal::TextDisplayPrivate) -{} - /*! Constructs a text display showing the \a message with an icon representing type \a type. */ -TextDisplay::TextDisplay(const QString &message, InfoLabel::InfoType type) - : d(new Internal::TextDisplayPrivate) +TextDisplay::TextDisplay(AspectContainer *container, const QString &message, InfoLabel::InfoType type) + : BaseAspect(container), d(new Internal::TextDisplayPrivate) { d->m_message = message; d->m_type = type; diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index b99c28c0bef..297842b3787 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -610,9 +610,9 @@ class QTCREATOR_UTILS_EXPORT TextDisplay : public BaseAspect Q_OBJECT public: - explicit TextDisplay(AspectContainer *container); - TextDisplay(const QString &message = {}, - InfoLabel::InfoType type = InfoLabel::None); + explicit TextDisplay(AspectContainer *container, + const QString &message = {}, + InfoLabel::InfoType type = InfoLabel::None); ~TextDisplay() override; void addToLayout(Layouting::LayoutItem &parent) override; diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index 08b480c88cf..b06745c5066 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -545,11 +545,11 @@ IconButton::IconButton(QWidget *parent) void IconButton::paintEvent(QPaintEvent *) { - QWindow *window = this->window()->windowHandle(); - const QPixmap iconPixmap = icon().pixmap(window, sizeHint(), + const qreal pixelRatio = window()->windowHandle()->devicePixelRatio(); + const QPixmap iconPixmap = icon().pixmap(sizeHint(), pixelRatio, isEnabled() ? QIcon::Normal : QIcon::Disabled); QStylePainter painter(this); - QRect pixmapRect(QPoint(), iconPixmap.size() / window->devicePixelRatio()); + QRect pixmapRect(QPoint(), iconPixmap.size() / pixelRatio); pixmapRect.moveCenter(rect().center()); if (m_autoHide) diff --git a/src/libs/utils/json.cpp b/src/libs/utils/json.cpp index 70bbc90990a..5afd4a685b7 100644 --- a/src/libs/utils/json.cpp +++ b/src/libs/utils/json.cpp @@ -65,7 +65,7 @@ QString JsonValue::kindToString(JsonValue::Kind kind) JsonValue *JsonValue::build(const QVariant &variant, JsonMemoryPool *pool) { - switch (variant.type()) { + switch (variant.typeId()) { case QVariant::List: { auto newValue = new (pool) JsonArrayValue; diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 970b0b4a296..60efd93c586 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -216,6 +216,13 @@ void DefaultImpl::start() return; if (!ensureProgramExists(program)) return; + + if (m_setup.m_runAsRoot && !HostOsInfo::isWindowsHost()) { + arguments.prepend(program); + arguments.prepend("-A"); + program = "sudo"; + } + s_start.measureAndRun(&DefaultImpl::doDefaultStart, this, program, arguments); } @@ -766,15 +773,6 @@ public: m_blockingInterface->setParent(this); } - CommandLine fullCommandLine() const - { - if (!m_setup.m_runAsRoot || HostOsInfo::isWindowsHost()) - return m_setup.m_commandLine; - CommandLine rootCommand("sudo", {"-A"}); - rootCommand.addCommandLineAsArgs(m_setup.m_commandLine); - return rootCommand; - } - Process *q; std::unique_ptr m_blockingInterface; std::unique_ptr m_process; @@ -1217,7 +1215,6 @@ void Process::start() d->setProcessInterface(processImpl); d->m_state = QProcess::Starting; d->m_process->m_setup = d->m_setup; - d->m_process->m_setup.m_commandLine = d->fullCommandLine(); d->emitGuardedSignal(&Process::starting); d->m_process->start(); } diff --git a/src/libs/utils/styleanimator.h b/src/libs/utils/styleanimator.h index 08c4755cd1a..22ab0745b30 100644 --- a/src/libs/utils/styleanimator.h +++ b/src/libs/utils/styleanimator.h @@ -10,8 +10,10 @@ #include #include +QT_BEGIN_NAMESPACE class QPainter; class QStyleOption; +QT_END_NAMESPACE namespace Utils { /* diff --git a/src/libs/utils/terminalinterface.cpp b/src/libs/utils/terminalinterface.cpp index 6767c16c61f..7046d7855ca 100644 --- a/src/libs/utils/terminalinterface.cpp +++ b/src/libs/utils/terminalinterface.cpp @@ -385,6 +385,22 @@ void TerminalInterface::start() ProcessSetupData stubSetupData = m_setup; stubSetupData.m_commandLine = cmd; + if (m_setup.m_runAsRoot && !HostOsInfo::isWindowsHost()) { + CommandLine rootCommand(FilePath("sudo").searchInPath(), {"-A"}); + rootCommand.addCommandLineAsArgs(cmd); + + const FilePath askPassPath = FilePath::fromUserInput(QCoreApplication::applicationDirPath()) + .pathAppended(QLatin1String(RELATIVE_LIBEXEC_PATH)) + .pathAppended(QLatin1String("qtc-askpass")); + + if (askPassPath.exists()) + stubSetupData.m_environment.setFallback("SUDO_ASKPASS", askPassPath.toUserOutput()); + + stubSetupData.m_commandLine = rootCommand; + } else { + stubSetupData.m_commandLine = cmd; + } + QMetaObject::invokeMethod( d->stubCreator, [stubSetupData, this] { d->stubCreator->startStubProcess(stubSetupData); }, diff --git a/src/libs/utils/transientscroll.h b/src/libs/utils/transientscroll.h index 2042bbf0fb0..c48880caa78 100644 --- a/src/libs/utils/transientscroll.h +++ b/src/libs/utils/transientscroll.h @@ -7,9 +7,12 @@ #include +QT_BEGIN_NAMESPACE class QAbstractScrollArea; +QT_END_NAMESPACE namespace Utils { + class ScrollAreaPrivate; class ScrollBarPrivate; diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 9c444f6e756..82410682c60 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -191,7 +191,7 @@ void AndroidConfig::load(const QSettings &settings) { // user settings QVariant emulatorArgs = settings.value(EmulatorArgsKey, QString("-netdelay none -netspeed full")); - if (emulatorArgs.type() == QVariant::StringList) // Changed in 8.0 from QStringList to QString. + if (emulatorArgs.typeId() == QVariant::StringList) // Changed in 8.0 from QStringList to QString. emulatorArgs = ProcessArgs::joinArgs(emulatorArgs.toStringList()); m_emulatorArgs = emulatorArgs.toString(); m_sdkLocation = FilePath::fromUserInput(settings.value(SDKLocationKey).toString()).cleanPath(); diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 9c6a616abe3..cb7de5307e5 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -488,21 +488,40 @@ void AndroidManifestEditorWidget::focusInEvent(QFocusEvent *event) } } +static bool checkDocument(const QDomDocument &doc, QDomDocument::ParseResult *result) +{ + QDomElement manifest = doc.documentElement(); + if (manifest.tagName() != QLatin1String("manifest")) { + result->errorMessage = ::Android::Tr::tr("The structure of the Android manifest file " + "is corrupted. Expected a top level 'manifest' node."); + result->errorLine = -1; + result->errorColumn = -1; + return false; + } + if (manifest.firstChildElement(QLatin1String("application")).firstChildElement(QLatin1String("activity")).isNull()) { + // missing either application or activity element + result->errorMessage = ::Android::Tr::tr("The structure of the Android manifest file " + "is corrupted. Expected an 'application' and 'activity' sub node."); + result->errorLine = -1; + result->errorColumn = -1; + return false; + } + return true; +} + void AndroidManifestEditorWidget::updateAfterFileLoad() { - QString error; - int errorLine; - int errorColumn; QDomDocument doc; - if (doc.setContent(m_textEditorWidget->toPlainText(), &error, &errorLine, &errorColumn)) { - if (checkDocument(doc, &error, &errorLine, &errorColumn)) { + QDomDocument::ParseResult result = doc.setContent(m_textEditorWidget->toPlainText()); + if (result) { + if (checkDocument(doc, &result)) { if (activePage() != Source) syncToWidgets(doc); return; } } // some error occurred - updateInfoBar(error, errorLine, errorColumn); + updateInfoBar(result.errorMessage, result.errorLine, result.errorColumn); setActivePage(Source); } @@ -591,39 +610,19 @@ TextEditor::TextEditorWidget *AndroidManifestEditorWidget::textEditorWidget() co bool AndroidManifestEditorWidget::syncToWidgets() { QDomDocument doc; - QString errorMessage; - int errorLine, errorColumn; - if (doc.setContent(m_textEditorWidget->toPlainText(), &errorMessage, &errorLine, &errorColumn)) { - if (checkDocument(doc, &errorMessage, &errorLine, &errorColumn)) { + QDomDocument::ParseResult result = doc.setContent(m_textEditorWidget->toPlainText()); + if (result) { + if (checkDocument(doc, &result)) { hideInfoBar(); syncToWidgets(doc); return true; } } - updateInfoBar(errorMessage, errorLine, errorColumn); + updateInfoBar(result.errorMessage, result.errorLine, result.errorColumn); return false; } -bool AndroidManifestEditorWidget::checkDocument(const QDomDocument &doc, QString *errorMessage, - int *errorLine, int *errorColumn) -{ - QDomElement manifest = doc.documentElement(); - if (manifest.tagName() != QLatin1String("manifest")) { - *errorMessage = ::Android::Tr::tr("The structure of the Android manifest file is corrupted. Expected a top level 'manifest' node."); - *errorLine = -1; - *errorColumn = -1; - return false; - } else if (manifest.firstChildElement(QLatin1String("application")).firstChildElement(QLatin1String("activity")).isNull()) { - // missing either application or activity element - *errorMessage = ::Android::Tr::tr("The structure of the Android manifest file is corrupted. Expected an 'application' and 'activity' sub node."); - *errorLine = -1; - *errorColumn = -1; - return false; - } - return true; -} - void AndroidManifestEditorWidget::startParseCheck() { m_timerParseCheck.start(); @@ -641,16 +640,15 @@ void AndroidManifestEditorWidget::updateInfoBar() return; } QDomDocument doc; - int errorLine, errorColumn; - QString errorMessage; - if (doc.setContent(m_textEditorWidget->toPlainText(), &errorMessage, &errorLine, &errorColumn)) { - if (checkDocument(doc, &errorMessage, &errorLine, &errorColumn)) { + QDomDocument::ParseResult result = doc.setContent(m_textEditorWidget->toPlainText()); + if (result) { + if (checkDocument(doc, &result)) { hideInfoBar(); return; } } - updateInfoBar(errorMessage, errorLine, errorColumn); + updateInfoBar(result.errorMessage, result.errorLine, result.errorColumn); } void AndroidManifestEditorWidget::updateSdkVersions() @@ -888,9 +886,9 @@ void AndroidManifestEditorWidget::syncToEditor() m_dirty = false; } -namespace { -QXmlStreamAttributes modifyXmlStreamAttributes(const QXmlStreamAttributes &input, const QStringList &keys, - const QStringList &values, const QStringList &remove = QStringList()) +static QXmlStreamAttributes modifyXmlStreamAttributes( + const QXmlStreamAttributes &input, const QStringList &keys, + const QStringList &values, const QStringList &remove = {}) { Q_ASSERT(keys.size() == values.size()); QXmlStreamAttributes result; @@ -903,8 +901,7 @@ QXmlStreamAttributes modifyXmlStreamAttributes(const QXmlStreamAttributes &input if (index == -1) result.push_back(attribute); else - result.push_back(QXmlStreamAttribute(name, - values.at(index))); + result.push_back(QXmlStreamAttribute(name, values.at(index))); } for (int i = 0; i < keys.size(); ++i) { @@ -913,7 +910,6 @@ QXmlStreamAttributes modifyXmlStreamAttributes(const QXmlStreamAttributes &input } return result; } -} // end namespace void AndroidManifestEditorWidget::parseManifest(QXmlStreamReader &reader, QXmlStreamWriter &writer) { diff --git a/src/plugins/android/androidmanifesteditorwidget.h b/src/plugins/android/androidmanifesteditorwidget.h index 1cce7157e44..28c193f15fc 100644 --- a/src/plugins/android/androidmanifesteditorwidget.h +++ b/src/plugins/android/androidmanifesteditorwidget.h @@ -14,14 +14,11 @@ QT_BEGIN_NAMESPACE class QCheckBox; class QDomDocument; -class QDomElement; class QComboBox; class QPushButton; class QLabel; class QLineEdit; class QListView; -class QSpinBox; -class QToolButton; class QXmlStreamReader; class QXmlStreamWriter; QT_END_NAMESPACE @@ -108,9 +105,6 @@ private: void syncToEditor(); void updateAfterFileLoad(); - bool checkDocument(const QDomDocument &doc, QString *errorMessage, - int *errorLine, int *errorColumn); - void updateInfoBar(const QString &errorMessage, int line, int column); void hideInfoBar(); diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 529f7ab0ca7..2f52d694f3c 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -280,7 +280,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd)); if (auto aspect = runControl->aspect(Constants::ANDROID_POSTFINISHSHELLCMDLIST)) { - QTC_CHECK(aspect->value.type() == QVariant::String); + QTC_CHECK(aspect->value.typeId() == QVariant::String); const QStringList commands = aspect->value.toString().split('\n', Qt::SkipEmptyParts); for (const QString &shellCmd : commands) m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd)); diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index 23912f15d98..fee875f231c 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -455,7 +455,7 @@ void TestRunner::runTestsHelper() connect(m_taskTree.get(), &TaskTree::errorOccurred, this, &TestRunner::onFinished); auto progress = new TaskProgress(m_taskTree.get()); - progress->setDisplayName(tr("Running Tests")); + progress->setDisplayName(Tr::tr("Running Tests")); progress->setAutoStopOnCancel(false); progress->setHalfLifeTimePerTask(10000); // 10 seconds connect(progress, &TaskProgress::canceled, this, [this, progress] { diff --git a/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp b/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp index 415d4ab20d6..3117269f0fa 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp @@ -77,10 +77,10 @@ void ArtisticStyleSettings::createDocumentationFile() const if (process.result() != ProcessResult::FinishedWithSuccess) return; + if (!documentationFilePath.exists()) + documentationFilePath.parentDir().ensureWritableDir(); + QFile file(documentationFilePath.toFSPathString()); - const QFileInfo fi(file); - if (!fi.exists()) - fi.dir().mkpath(fi.absolutePath()); if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) return; diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index 1439dc315f2..7079d4665ba 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -33,6 +33,7 @@ #include using namespace TextEditor; +using namespace Utils; namespace Beautifier::Internal { @@ -72,7 +73,7 @@ void Uncrustify::updateActions(Core::IEditor *editor) void Uncrustify::formatFile() { - const QString cfgFileName = configurationFile(); + const FilePath cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) { BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile( Tr::tr(Constants::UNCRUSTIFY_DISPLAY_NAME))); @@ -83,7 +84,7 @@ void Uncrustify::formatFile() void Uncrustify::formatSelectedText() { - const QString cfgFileName = configurationFile(); + const FilePath cfgFileName = configurationFile(); if (cfgFileName.isEmpty()) { BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile( Tr::tr(Constants::UNCRUSTIFY_DISPLAY_NAME))); @@ -112,42 +113,41 @@ void Uncrustify::formatSelectedText() } } -QString Uncrustify::configurationFile() const +FilePath Uncrustify::configurationFile() const { if (m_settings.useCustomStyle()) - return m_settings.styleFileName(m_settings.customStyle()); + return FilePath::fromUserInput(m_settings.styleFileName(m_settings.customStyle())); if (m_settings.useOtherFiles()) { - if (const ProjectExplorer::Project *project - = ProjectExplorer::ProjectTree::currentProject()) { - const Utils::FilePaths files = project->files( - [](const ProjectExplorer::Node *n) { return n->filePath().endsWith("cfg"); }); - for (const Utils::FilePath &file : files) { - const QFileInfo fi = file.toFileInfo(); - if (fi.isReadable() && fi.fileName() == "uncrustify.cfg") - return file.toString(); - } + using namespace ProjectExplorer; + if (const Project *project = ProjectTree::currentProject()) { + const FilePaths files = project->files([](const Node *n) { + const FilePath fp = n->filePath(); + return fp.fileName() == "uncrustify.cfg" && fp.isReadableFile(); + }); + if (!files.isEmpty()) + return files.first(); } } if (m_settings.useSpecificConfigFile()) { - const Utils::FilePath file = m_settings.specificConfigFile(); + const FilePath file = m_settings.specificConfigFile(); if (file.exists()) - return file.toString(); - } - - if (m_settings.useHomeFile()) { - const QString file = QDir::home().filePath("uncrustify.cfg"); - if (QFile::exists(file)) return file; } - return QString(); + if (m_settings.useHomeFile()) { + const FilePath file = FileUtils::homePath() / "uncrustify.cfg"; + if (file.exists()) + return file; + } + + return {}; } Command Uncrustify::command() const { - const QString cfgFile = configurationFile(); + const FilePath cfgFile = configurationFile(); return cfgFile.isEmpty() ? Command() : command(cfgFile, false); } @@ -156,7 +156,7 @@ bool Uncrustify::isApplicable(const Core::IDocument *document) const return m_settings.isApplicable(document); } -Command Uncrustify::command(const QString &cfgFile, bool fragment) const +Command Uncrustify::command(const FilePath &cfgFile, bool fragment) const { Command command; command.setExecutable(m_settings.command()); @@ -173,7 +173,7 @@ Command Uncrustify::command(const QString &cfgFile, bool fragment) const if (fragment) command.addOption("--frag"); command.addOption("-c"); - command.addOption(cfgFile); + command.addOption(cfgFile.path()); return command; } diff --git a/src/plugins/beautifier/uncrustify/uncrustify.h b/src/plugins/beautifier/uncrustify/uncrustify.h index 685a29c25a1..774a400017e 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.h +++ b/src/plugins/beautifier/uncrustify/uncrustify.h @@ -22,8 +22,8 @@ public: private: void formatFile(); void formatSelectedText(); - QString configurationFile() const; - TextEditor::Command command(const QString &cfgFile, bool fragment = false) const; + Utils::FilePath configurationFile() const; + TextEditor::Command command(const Utils::FilePath &cfgFile, bool fragment = false) const; QAction *m_formatFile = nullptr; QAction *m_formatRange = nullptr; diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index e2f9272e146..cfc25544e57 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -207,7 +207,7 @@ void ClangFormatConfigWidget::createStyleFileIfNeeded(bool isGlobal) if (configFile.exists()) return; - QDir().mkpath(path.toString()); + path.ensureWritableDir(); if (!isGlobal) { FilePath possibleProjectConfig = d->project->rootProjectDirectory() / Constants::SETTINGS_FILE_NAME; @@ -218,11 +218,8 @@ void ClangFormatConfigWidget::createStyleFileIfNeeded(bool isGlobal) } } - std::fstream newStyleFile(configFile.toString().toStdString(), std::fstream::out); - if (newStyleFile.is_open()) { - newStyleFile << clang::format::configurationAsText(constructStyle()); - newStyleFile.close(); - } + const std::string config = clang::format::configurationAsText(constructStyle()); + configFile.writeFileContents(QByteArray::fromStdString(config)); } void ClangFormatConfigWidget::showOrHideWidgets() diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index c93710ff580..846b5d9dea2 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -1465,8 +1465,10 @@ void MainWindow::changeLog() return; const FilePath file = versionedFiles.at(index).second; QString contents = QString::fromUtf8(file.fileContents().value_or(QByteArray())); - static const QRegularExpression bugexpr("(QT(CREATOR)?BUG-[0-9]+)"); - contents.replace(bugexpr, "[\\1](https://bugreports.qt.io/browse/\\1)"); + // (? matches; for (const QRegularExpressionMatch &m : docexpr.globalMatch(contents)) diff --git a/src/plugins/cppeditor/cppprojectinfogenerator.cpp b/src/plugins/cppeditor/cppprojectinfogenerator.cpp index 5c4c03de4cc..2f1f4b7cd7f 100644 --- a/src/plugins/cppeditor/cppprojectinfogenerator.cpp +++ b/src/plugins/cppeditor/cppprojectinfogenerator.cpp @@ -42,14 +42,14 @@ ProjectInfo::ConstPtr ProjectInfoGenerator::generate(const QPromisearg("function", requested.functionName); cmd->arg("oneshot", requested.oneShot); cmd->arg("enabled", requested.enabled); - cmd->arg("file", requested.fileName.path()); cmd->arg("line", requested.textPosition.line); cmd->arg("address", requested.address); cmd->arg("expression", requested.expression); + + BreakpointPathUsage pathUsage = (requested.pathUsage + == BreakpointPathUsage::BreakpointPathUsageEngineDefault) + ? defaultPathUsage + : requested.pathUsage; + + cmd->arg("file", + pathUsage == BreakpointPathUsage::BreakpointUseFullPath + ? requested.fileName.path() + : requested.fileName.fileName()); } void BreakpointItem::updateFromGdbOutput(const GdbMi &bkpt, const FilePath &fileRoot) diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index e850151c3be..0132e2bcaf6 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -107,7 +107,9 @@ public: int markerLineNumber() const; const BreakpointParameters &requestedParameters() const; - void addToCommand(DebuggerCommand *cmd) const; + void addToCommand(DebuggerCommand *cmd, + BreakpointPathUsage defaultPathUsage + = BreakpointPathUsage::BreakpointUseFullPath) const; void updateFromGdbOutput(const GdbMi &bkpt, const Utils::FilePath &fileRoot); int modelId() const; diff --git a/src/plugins/debugger/terminal.cpp b/src/plugins/debugger/terminal.cpp index ac8a043df86..86531d0e0ad 100644 --- a/src/plugins/debugger/terminal.cpp +++ b/src/plugins/debugger/terminal.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -172,9 +173,18 @@ void TerminalRunner::start() QTC_ASSERT(!m_stubProc, reportFailure({}); return); Runnable stub = m_stubRunnable(); + bool runAsRoot = false; + if (auto runAsRootAspect = runControl()->aspect()) + runAsRoot = runAsRootAspect->value; + m_stubProc = new Process(this); m_stubProc->setTerminalMode(TerminalMode::Debug); + if (runAsRoot) { + m_stubProc->setRunAsRoot(runAsRoot); + RunControl::provideAskPassEntry(stub.environment); + } + connect(m_stubProc, &Process::started, this, &TerminalRunner::stubStarted); connect(m_stubProc, &Process::done, diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 96e65796500..ab2dd3ddd1e 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -647,7 +647,7 @@ ActionContainer *FormEditorData::createPreviewStyleMenu(QActionGroup *actionGrou QString name = menuId; name += dot; const QVariant data = a->data(); - const bool isDeviceProfile = data.type() == QVariant::Int; + const bool isDeviceProfile = data.typeId() == QVariant::Int; if (isDeviceProfile) { name += deviceProfilePrefix; name += dot; diff --git a/src/plugins/incredibuild/buildconsolebuildstep.cpp b/src/plugins/incredibuild/buildconsolebuildstep.cpp index c28c1cd6769..19ac73dd0cf 100644 --- a/src/plugins/incredibuild/buildconsolebuildstep.cpp +++ b/src/plugins/incredibuild/buildconsolebuildstep.cpp @@ -50,6 +50,39 @@ public: BuildConsoleBuildStep(BuildStepList *buildStepList, Id id); void setupOutputFormatter(OutputFormatter *formatter) final; + + TextDisplay t1{this, "" + Tr::tr("Target and Configuration")}; + CommandBuilderAspect commandBuilder{this}; + + TextDisplay t2{this, "" + Tr::tr("Enter the appropriate arguments to your build command.")}; + TextDisplay t3{this, "" + Tr::tr("Make sure the build command's multi-job " + "parameter value is large enough " + "(such as -j200 for the JOM or Make build tools)")}; + BoolAspect keepJobNum{this}; + + TextDisplay t4{this, "" + Tr::tr("IncrediBuild Distribution Control")}; + FilePathAspect profileXml{this}; + BoolAspect avoidLocal{this}; + IntegerAspect maxCpu{this}; + SelectionAspect maxWinVer{this}; + SelectionAspect minWinVer{this}; + + TextDisplay t5{this, "" + Tr::tr("Output and Logging")}; + StringAspect title{this}; + FilePathAspect monFile{this}; + BoolAspect suppressStdOut{this}; + FilePathAspect logFile{this}; + BoolAspect showCmd{this}; + BoolAspect showAgents{this}; + BoolAspect showTime{this}; + BoolAspect hideHeader{this}; + SelectionAspect logLevel{this}; + + TextDisplay t6{this, "" + Tr::tr("Miscellaneous")}; + StringAspect setEnv{this}; + BoolAspect stopOnError{this}; + StringAspect additionalArguments{this}; + BoolAspect openMonitor{this}; }; BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id) @@ -57,233 +90,198 @@ BuildConsoleBuildStep::BuildConsoleBuildStep(BuildStepList *buildStepList, Id id { setDisplayName(Tr::tr("IncrediBuild for Windows")); - addAspect("" + Tr::tr("Target and Configuration")); + commandBuilder.setSettingsKey("IncrediBuild.BuildConsole.CommandBuilder"); - auto commandBuilder = addAspect(this); - commandBuilder->setSettingsKey("IncrediBuild.BuildConsole.CommandBuilder"); + keepJobNum.setSettingsKey("IncrediBuild.BuildConsole.KeepJobNum"); + keepJobNum.setLabel(Tr::tr("Keep original jobs number:")); + keepJobNum.setToolTip(Tr::tr("Forces IncrediBuild to not override the -j command line switch, " + "that controls the number of parallel spawned tasks. The default " + "IncrediBuild behavior is to set it to 200.")); - addAspect("" + Tr::tr("Enter the appropriate arguments to your build command.")); - addAspect("" + Tr::tr("Make sure the build command's multi-job " - "parameter value is large enough " - "(such as -j200 for the JOM or Make build tools)")); + profileXml.setSettingsKey("IncrediBuild.BuildConsole.ProfileXml"); + profileXml.setLabelText(Tr::tr("Profile.xml:")); + profileXml.setExpectedKind(PathChooser::Kind::File); + profileXml.setBaseFileName(PathChooser::homePath()); + profileXml.setHistoryCompleter("IncrediBuild.BuildConsole.ProfileXml.History"); + profileXml.setToolTip(Tr::tr("Defines how Automatic " + "Interception Interface should handle the various processes " + "involved in a distributed job. It is not necessary for " + "\"Visual Studio\" or \"Make and Build tools\" builds, " + "but can be used to provide configuration options if those " + "builds use additional processes that are not included in " + "those packages. It is required to configure distributable " + "processes in \"Dev Tools\" builds.")); - auto keepJobNum = addAspect(); - keepJobNum->setSettingsKey("IncrediBuild.BuildConsole.KeepJobNum"); - keepJobNum->setLabel(Tr::tr("Keep original jobs number:")); - keepJobNum->setToolTip(Tr::tr("Forces IncrediBuild to not override the -j command line switch, " - "that controls the number of parallel spawned tasks. The default " - "IncrediBuild behavior is to set it to 200.")); + avoidLocal.setSettingsKey("IncrediBuild.BuildConsole.AvoidLocal"); + avoidLocal.setLabel(Tr::tr("Avoid local task execution:")); + avoidLocal.setToolTip(Tr::tr("Overrides the Agent Settings dialog Avoid task execution on local " + "machine when possible option. This allows to free more resources " + "on the initiator machine and could be beneficial to distribution " + "in scenarios where the initiating machine is bottlenecking the " + "build with High CPU usage.")); - addAspect("" + Tr::tr("IncrediBuild Distribution Control")); + maxCpu.setSettingsKey("IncrediBuild.BuildConsole.MaxCpu"); + maxCpu.setToolTip(Tr::tr("Determines the maximum number of CPU cores that can be used in a " + "build, regardless of the number of available Agents. " + "It takes into account both local and remote cores, even if the " + "Avoid Task Execution on Local Machine option is selected.")); + maxCpu.setLabel(Tr::tr("Maximum CPUs to utilize in the build:")); + maxCpu.setRange(0, 65536); - auto profileXml = addAspect(); - profileXml->setSettingsKey("IncrediBuild.BuildConsole.ProfileXml"); - profileXml->setLabelText(Tr::tr("Profile.xml:")); - profileXml->setExpectedKind(PathChooser::Kind::File); - profileXml->setBaseFileName(PathChooser::homePath()); - profileXml->setHistoryCompleter("IncrediBuild.BuildConsole.ProfileXml.History"); - profileXml->setToolTip(Tr::tr("Defines how Automatic " - "Interception Interface should handle the various processes " - "involved in a distributed job. It is not necessary for " - "\"Visual Studio\" or \"Make and Build tools\" builds, " - "but can be used to provide configuration options if those " - "builds use additional processes that are not included in " - "those packages. It is required to configure distributable " - "processes in \"Dev Tools\" builds.")); - - auto avoidLocal = addAspect(); - avoidLocal->setSettingsKey("IncrediBuild.BuildConsole.AvoidLocal"); - avoidLocal->setLabel(Tr::tr("Avoid local task execution:")); - avoidLocal->setToolTip(Tr::tr("Overrides the Agent Settings dialog Avoid task execution on local " - "machine when possible option. This allows to free more resources " - "on the initiator machine and could be beneficial to distribution " - "in scenarios where the initiating machine is bottlenecking the " - "build with High CPU usage.")); - - auto maxCpu = addAspect(); - maxCpu->setSettingsKey("IncrediBuild.BuildConsole.MaxCpu"); - maxCpu->setToolTip(Tr::tr("Determines the maximum number of CPU cores that can be used in a " - "build, regardless of the number of available Agents. " - "It takes into account both local and remote cores, even if the " - "Avoid Task Execution on Local Machine option is selected.")); - maxCpu->setLabel(Tr::tr("Maximum CPUs to utilize in the build:")); - maxCpu->setRange(0, 65536); - - auto maxWinVer = addAspect(); - maxWinVer->setSettingsKey("IncrediBuild.BuildConsole.MaxWinVer"); - maxWinVer->setDisplayName(Tr::tr("Newest allowed helper machine OS:")); - maxWinVer->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - maxWinVer->setToolTip(Tr::tr("Specifies the newest operating system installed on a helper " - "machine to be allowed to participate as helper in the build.")); + maxWinVer.setSettingsKey("IncrediBuild.BuildConsole.MaxWinVer"); + maxWinVer.setDisplayName(Tr::tr("Newest allowed helper machine OS:")); + maxWinVer.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + maxWinVer.setToolTip(Tr::tr("Specifies the newest operating system installed on a helper " + "machine to be allowed to participate as helper in the build.")); for (const QString &version : supportedWindowsVersions()) - maxWinVer->addOption(version); + maxWinVer.addOption(version); - auto minWinVer = addAspect(); - minWinVer->setSettingsKey("IncrediBuild.BuildConsole.MinWinVer"); - minWinVer->setDisplayName(Tr::tr("Oldest allowed helper machine OS:")); - minWinVer->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - minWinVer->setToolTip(Tr::tr("Specifies the oldest operating system installed on a helper " - "machine to be allowed to participate as helper in the build.")); + minWinVer.setSettingsKey("IncrediBuild.BuildConsole.MinWinVer"); + minWinVer.setDisplayName(Tr::tr("Oldest allowed helper machine OS:")); + minWinVer.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + minWinVer.setToolTip(Tr::tr("Specifies the oldest operating system installed on a helper " + "machine to be allowed to participate as helper in the build.")); for (const QString &version : supportedWindowsVersions()) - minWinVer->addOption(version); + minWinVer.addOption(version); - addAspect("" + Tr::tr("Output and Logging")); + title.setSettingsKey("IncrediBuild.BuildConsole.Title"); + title.setLabelText(Tr::tr("Build title:")); + title.setDisplayStyle(StringAspect::LineEditDisplay); + title.setToolTip(Tr::tr("Specifies a custom header line which will be displayed in the " + "beginning of the build output text. This title will also be used " + "for the Build History and Build Monitor displays.")); - auto title = addAspect(); - title->setSettingsKey("IncrediBuild.BuildConsole.Title"); - title->setLabelText(Tr::tr("Build title:")); - title->setDisplayStyle(StringAspect::LineEditDisplay); - title->setToolTip(Tr::tr("Specifies a custom header line which will be displayed in the " - "beginning of the build output text. This title will also be used " - "for the Build History and Build Monitor displays.")); + monFile.setSettingsKey("IncrediBuild.BuildConsole.MonFile"); + monFile.setLabelText(Tr::tr("Save IncrediBuild monitor file:")); + monFile.setExpectedKind(PathChooser::Kind::Any); + monFile.setBaseFileName(PathChooser::homePath()); + monFile.setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.MonFile.History")); + monFile.setToolTip(Tr::tr("Writes a copy of the build progress file (.ib_mon) to the specified " + "location. If only a folder name is given, a generated GUID will serve " + "as the file name. The full path of the saved Build Monitor will be " + "written to the end of the build output.")); - auto monFile = addAspect(); - monFile->setSettingsKey("IncrediBuild.BuildConsole.MonFile"); - monFile->setLabelText(Tr::tr("Save IncrediBuild monitor file:")); - monFile->setExpectedKind(PathChooser::Kind::Any); - monFile->setBaseFileName(PathChooser::homePath()); - monFile->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.MonFile.History")); - monFile->setToolTip(Tr::tr("Writes a copy of the build progress file (.ib_mon) to the specified " - "location. If only a folder name is given, a generated GUID will serve " - "as the file name. The full path of the saved Build Monitor will be " - "written to the end of the build output.")); + suppressStdOut.setSettingsKey("IncrediBuild.BuildConsole.SuppressStdOut"); + suppressStdOut.setLabel(Tr::tr("Suppress STDOUT:")); + suppressStdOut.setToolTip(Tr::tr("Does not write anything to the standard output.")); - auto suppressStdOut = addAspect(); - suppressStdOut->setSettingsKey("IncrediBuild.BuildConsole.SuppressStdOut"); - suppressStdOut->setLabel(Tr::tr("Suppress STDOUT:")); - suppressStdOut->setToolTip(Tr::tr("Does not write anything to the standard output.")); + logFile.setSettingsKey("IncrediBuild.BuildConsole.LogFile"); + logFile.setLabelText(Tr::tr("Output Log file:")); + logFile.setExpectedKind(PathChooser::Kind::SaveFile); + logFile.setBaseFileName(PathChooser::homePath()); + logFile.setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History")); + logFile.setToolTip(Tr::tr("Writes build output to a file.")); - auto logFile = addAspect(); - logFile->setSettingsKey("IncrediBuild.BuildConsole.LogFile"); - logFile->setLabelText(Tr::tr("Output Log file:")); - logFile->setExpectedKind(PathChooser::Kind::SaveFile); - logFile->setBaseFileName(PathChooser::homePath()); - logFile->setHistoryCompleter(QLatin1String("IncrediBuild.BuildConsole.LogFile.History")); - logFile->setToolTip(Tr::tr("Writes build output to a file.")); + showCmd.setSettingsKey("IncrediBuild.BuildConsole.ShowCmd"); + showCmd.setLabel(Tr::tr("Show Commands in output:")); + showCmd.setToolTip(Tr::tr("Shows, for each file built, the command-line used by IncrediBuild " + "to build the file.")); - auto showCmd = addAspect(); - showCmd->setSettingsKey("IncrediBuild.BuildConsole.ShowCmd"); - showCmd->setLabel(Tr::tr("Show Commands in output:")); - showCmd->setToolTip(Tr::tr("Shows, for each file built, the command-line used by IncrediBuild " - "to build the file.")); + showAgents.setSettingsKey("IncrediBuild.BuildConsole.ShowAgents"); + showAgents.setLabel(Tr::tr("Show Agents in output:")); + showAgents.setToolTip(Tr::tr("Shows the Agent used to build each file.")); - auto showAgents = addAspect(); - showAgents->setSettingsKey("IncrediBuild.BuildConsole.ShowAgents"); - showAgents->setLabel(Tr::tr("Show Agents in output:")); - showAgents->setToolTip(Tr::tr("Shows the Agent used to build each file.")); + showTime.setSettingsKey("IncrediBuild.BuildConsole.ShowTime"); + showTime.setLabel(Tr::tr("Show Time in output:")); + showTime.setToolTip(Tr::tr("Shows the Start and Finish time for each file built.")); - auto showTime = addAspect(); - showTime->setSettingsKey("IncrediBuild.BuildConsole.ShowTime"); - showTime->setLabel(Tr::tr("Show Time in output:")); - showTime->setToolTip(Tr::tr("Shows the Start and Finish time for each file built.")); + hideHeader.setSettingsKey("IncrediBuild.BuildConsole.HideHeader"); + hideHeader.setLabel(Tr::tr("Hide IncrediBuild Header in output:")); + hideHeader.setToolTip(Tr::tr("Suppresses IncrediBuild's header in the build output")); - auto hideHeader = addAspect(); - hideHeader->setSettingsKey("IncrediBuild.BuildConsole.HideHeader"); - hideHeader->setLabel(Tr::tr("Hide IncrediBuild Header in output:")); - hideHeader->setToolTip(Tr::tr("Suppresses IncrediBuild's header in the build output")); + logLevel.setSettingsKey("IncrediBuild.BuildConsole.LogLevel"); + logLevel.setDisplayName(Tr::tr("Internal IncrediBuild logging level:")); + logLevel.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); + logLevel.addOption(QString()); + logLevel.addOption("Minimal"); + logLevel.addOption("Extended"); + logLevel.addOption("Detailed"); + logLevel.setToolTip(Tr::tr("Overrides the internal Incredibuild logging level for this build. " + "Does not affect output or any user accessible logging. Used mainly " + "to troubleshoot issues with the help of IncrediBuild support")); - auto logLevel = addAspect(); - logLevel->setSettingsKey("IncrediBuild.BuildConsole.LogLevel"); - logLevel->setDisplayName(Tr::tr("Internal IncrediBuild logging level:")); - logLevel->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - logLevel->addOption(QString()); - logLevel->addOption("Minimal"); - logLevel->addOption("Extended"); - logLevel->addOption("Detailed"); - logLevel->setToolTip(Tr::tr("Overrides the internal Incredibuild logging level for this build. " - "Does not affect output or any user accessible logging. Used mainly " - "to troubleshoot issues with the help of IncrediBuild support")); + setEnv.setSettingsKey("IncrediBuild.BuildConsole.SetEnv"); + setEnv.setLabelText(Tr::tr("Set an Environment Variable:")); + setEnv.setDisplayStyle(StringAspect::LineEditDisplay); + setEnv.setToolTip(Tr::tr("Sets or overrides environment variables for the context of the build.")); - addAspect("" + Tr::tr("Miscellaneous")); + stopOnError.setSettingsKey("IncrediBuild.BuildConsole.StopOnError"); + stopOnError.setLabel(Tr::tr("Stop on errors:")); + stopOnError.setToolTip(Tr::tr("When specified, the execution will stop as soon as an error " + "is encountered. This is the default behavior in " + "\"Visual Studio\" builds, but not the default for " + "\"Make and Build tools\" or \"Dev Tools\" builds")); - auto setEnv = addAspect(); - setEnv->setSettingsKey("IncrediBuild.BuildConsole.SetEnv"); - setEnv->setLabelText(Tr::tr("Set an Environment Variable:")); - setEnv->setDisplayStyle(StringAspect::LineEditDisplay); - setEnv->setToolTip(Tr::tr("Sets or overrides environment variables for the context of the build.")); + additionalArguments.setSettingsKey("IncrediBuild.BuildConsole.AdditionalArguments"); + additionalArguments.setLabelText(Tr::tr("Additional Arguments:")); + additionalArguments.setDisplayStyle(StringAspect::LineEditDisplay); + additionalArguments.setToolTip(Tr::tr("Add additional buildconsole arguments manually. " + "The value of this field will be concatenated to the " + "final buildconsole command line")); - auto stopOnError = addAspect(); - stopOnError->setSettingsKey("IncrediBuild.BuildConsole.StopOnError"); - stopOnError->setLabel(Tr::tr("Stop on errors:")); - stopOnError->setToolTip(Tr::tr("When specified, the execution will stop as soon as an error " - "is encountered. This is the default behavior in " - "\"Visual Studio\" builds, but not the default for " - "\"Make and Build tools\" or \"Dev Tools\" builds")); + openMonitor.setSettingsKey("IncrediBuild.BuildConsole.OpenMonitor"); + openMonitor.setLabel(Tr::tr("Open Build Monitor:")); + openMonitor.setToolTip(Tr::tr("Opens Build Monitor once the build starts.")); - auto additionalArguments = addAspect(); - additionalArguments->setSettingsKey("IncrediBuild.BuildConsole.AdditionalArguments"); - additionalArguments->setLabelText(Tr::tr("Additional Arguments:")); - additionalArguments->setDisplayStyle(StringAspect::LineEditDisplay); - additionalArguments->setToolTip(Tr::tr("Add additional buildconsole arguments manually. " - "The value of this field will be concatenated to the " - "final buildconsole command line")); + setCommandLineProvider([this] { + CommandLine cmd("BuildConsole.exe"); - auto openMonitor = addAspect(); - openMonitor->setSettingsKey("IncrediBuild.BuildConsole.OpenMonitor"); - openMonitor->setLabel(Tr::tr("Open Build Monitor:")); - openMonitor->setToolTip(Tr::tr("Opens Build Monitor once the build starts.")); + cmd.addArgs(QString("/Command=%1").arg(commandBuilder.fullCommandFlag(keepJobNum())), CommandLine::Raw); - setCommandLineProvider([=] { - QStringList args; + if (!profileXml().isEmpty()) + cmd.addArg(QString("/Profile=%1").arg(profileXml().path())); - QString cmd("/Command= %1"); - cmd = cmd.arg(commandBuilder->fullCommandFlag(keepJobNum->value())); - args.append(cmd); + cmd.addArg(QString("/AvoidLocal=%1").arg(avoidLocal() ? QString("ON") : QString("OFF"))); - if (!profileXml->value().isEmpty()) - args.append("/Profile=" + profileXml->value()); + if (maxCpu() > 0) + cmd.addArg(QString("/MaxCPUs=%1").arg(maxCpu())); - args.append(QString("/AvoidLocal=%1").arg(avoidLocal->value() ? QString("ON") : QString("OFF"))); + if (!maxWinVer.stringValue().isEmpty()) + cmd.addArg(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(maxWinVer.stringValue()))); - if (maxCpu->value() > 0) - args.append(QString("/MaxCPUs=%1").arg(maxCpu->value())); + if (!minWinVer.stringValue().isEmpty()) + cmd.addArg(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(minWinVer.stringValue()))); - if (!maxWinVer->stringValue().isEmpty()) - args.append(QString("/MaxWinVer=%1").arg(normalizeWinVerArgument(maxWinVer->stringValue()))); + if (!title().isEmpty()) + cmd.addArg("/Title=" + title()); - if (!minWinVer->stringValue().isEmpty()) - args.append(QString("/MinWinVer=%1").arg(normalizeWinVerArgument(minWinVer->stringValue()))); + if (!monFile().isEmpty()) + cmd.addArg("/Mon=" + monFile().path()); - if (!title->value().isEmpty()) - args.append(QString("/Title=" + title->value())); + if (suppressStdOut()) + cmd.addArg("/Silent"); - if (!monFile->value().isEmpty()) - args.append(QString("/Mon=" + monFile->value())); + if (!logFile().isEmpty()) + cmd.addArg("/Log=" + logFile().path()); - if (suppressStdOut->value()) - args.append("/Silent"); + if (showCmd()) + cmd.addArg("/ShowCmd"); - if (!logFile->value().isEmpty()) - args.append(QString("/Log=" + logFile->value())); + if (showAgents()) + cmd.addArg("/ShowAgent"); - if (showCmd->value()) - args.append("/ShowCmd"); + if (showAgents()) + cmd.addArg("/ShowTime"); - if (showAgents->value()) - args.append("/ShowAgent"); + if (hideHeader()) + cmd.addArg("/NoLogo"); - if (showAgents->value()) - args.append("/ShowTime"); + if (!logLevel.stringValue().isEmpty()) + cmd.addArg("/LogLevel=" + logLevel.stringValue()); - if (hideHeader->value()) - args.append("/NoLogo"); + if (!setEnv().isEmpty()) + cmd.addArg("/SetEnv=" + setEnv()); - if (!logLevel->stringValue().isEmpty()) - args.append(QString("/LogLevel=" + logLevel->stringValue())); + if (stopOnError()) + cmd.addArg("/StopOnErrors"); - if (!setEnv->value().isEmpty()) - args.append(QString("/SetEnv=" + setEnv->value())); + if (!additionalArguments().isEmpty()) + cmd.addArgs(additionalArguments(), CommandLine::Raw); - if (stopOnError->value()) - args.append("/StopOnErrors"); + if (openMonitor()) + cmd.addArg("/OpenMonitor"); - if (!additionalArguments->value().isEmpty()) - args.append(additionalArguments->value()); - - if (openMonitor->value()) - args.append("/OpenMonitor"); - - return CommandLine("BuildConsole.exe", args); + return cmd; }); } diff --git a/src/plugins/incredibuild/ibconsolebuildstep.cpp b/src/plugins/incredibuild/ibconsolebuildstep.cpp index 3bd453fdb8c..c53ffad4552 100644 --- a/src/plugins/incredibuild/ibconsolebuildstep.cpp +++ b/src/plugins/incredibuild/ibconsolebuildstep.cpp @@ -28,6 +28,21 @@ public: IBConsoleBuildStep(BuildStepList *buildStepList, Id id); void setupOutputFormatter(OutputFormatter *formatter) final; + + TextDisplay t1{this, "" + Tr::tr("Target and Configuration")}; + CommandBuilderAspect commandBuilder{this}; + BoolAspect keepJobNum{this}; + + TextDisplay t2{this, "" + Tr::tr("Enter the appropriate arguments to your build command.")}; + TextDisplay t3{this, "" + Tr::tr("Make sure the build command's " + "multi-job parameter value is large enough (such as " + "-j200 for the JOM or Make build tools)")}; + + TextDisplay t4{this, "" + Tr::tr("IncrediBuild Distribution Control")}; + + IntegerAspect nice{this}; + BoolAspect forceRemote{this}; + BoolAspect alternate{this}; }; IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id) @@ -35,52 +50,38 @@ IBConsoleBuildStep::IBConsoleBuildStep(BuildStepList *buildStepList, Id id) { setDisplayName(Tr::tr("IncrediBuild for Linux")); - addAspect("" + Tr::tr("Target and Configuration")); + commandBuilder.setSettingsKey("IncrediBuild.IBConsole.CommandBuilder"); - auto commandBuilder = addAspect(this); - commandBuilder->setSettingsKey("IncrediBuild.IBConsole.CommandBuilder"); + keepJobNum.setSettingsKey("IncrediBuild.IBConsole.KeepJobNum"); + keepJobNum.setLabel(Tr::tr("Keep original jobs number:")); + keepJobNum.setToolTip(Tr::tr("Forces IncrediBuild to not override the -j command line switch, " + "that controls the number of parallel spawned tasks. The default " + "IncrediBuild behavior is to set it to 200.")); - addAspect("" + Tr::tr("Enter the appropriate arguments to your build command.")); - addAspect("" + Tr::tr("Make sure the build command's " - "multi-job parameter value is large enough (such as " - "-j200 for the JOM or Make build tools)")); + nice.setSettingsKey("IncrediBuild.IBConsole.Nice"); + nice.setToolTip(Tr::tr("Specify nice value. Nice Value should be numeric and between -20 and 19")); + nice.setLabel(Tr::tr("Nice value:")); + nice.setRange(-20, 19); - auto keepJobNum = addAspect(); - keepJobNum->setSettingsKey("IncrediBuild.IBConsole.KeepJobNum"); - keepJobNum->setLabel(Tr::tr("Keep original jobs number:")); - keepJobNum->setToolTip(Tr::tr("Forces IncrediBuild to not override the -j command line switch, " - "that controls the number of parallel spawned tasks. The default " - "IncrediBuild behavior is to set it to 200.")); + forceRemote.setSettingsKey("IncrediBuild.IBConsole.Alternate"); + forceRemote.setLabel(Tr::tr("Force remote:")); - addAspect("" + Tr::tr("IncrediBuild Distribution Control")); + alternate.setSettingsKey("IncrediBuild.IBConsole.ForceRemote"); + alternate.setLabel(Tr::tr("Alternate tasks preference:")); - auto nice = addAspect(); - nice->setSettingsKey("IncrediBuild.IBConsole.Nice"); - nice->setToolTip(Tr::tr("Specify nice value. Nice Value should be numeric and between -20 and 19")); - nice->setLabel(Tr::tr("Nice value:")); - nice->setRange(-20, 19); - - auto forceRemote = addAspect(); - forceRemote->setSettingsKey("IncrediBuild.IBConsole.Alternate"); - forceRemote->setLabel(Tr::tr("Force remote:")); - - auto alternate = addAspect(); - alternate->setSettingsKey("IncrediBuild.IBConsole.ForceRemote"); - alternate->setLabel(Tr::tr("Alternate tasks preference:")); - - setCommandLineProvider([=] { + setCommandLineProvider([this] { QStringList args; - if (nice->value() != 0) - args.append(QString("--nice %1 ").arg(nice->value())); + if (nice() != 0) + args.append(QString("--nice %1 ").arg(nice())); - if (alternate->value()) + if (alternate()) args.append("--alternate"); - if (forceRemote->value()) + if (forceRemote()) args.append("--force-remote"); - args.append(commandBuilder->fullCommandFlag(keepJobNum->value())); + args.append(commandBuilder.fullCommandFlag(keepJobNum())); return CommandLine("ib_console", args); }); diff --git a/src/plugins/languageclient/lspinspector.cpp b/src/plugins/languageclient/lspinspector.cpp index 09307a06c3e..31a353c2787 100644 --- a/src/plugins/languageclient/lspinspector.cpp +++ b/src/plugins/languageclient/lspinspector.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -334,7 +335,7 @@ private: QTabWidget * const m_tabWidget; enum class TabIndex { Log, Capabilities, Custom }; - QListWidget *m_clients = nullptr; + QComboBox *m_clients = nullptr; }; void LspInspector::show(const QString &defaultClient) @@ -401,34 +402,34 @@ LspInspectorWidget::LspInspectorWidget(LspInspector *inspector) this, &LspInspectorWidget::updateCapabilities); connect(Core::ICore::instance(), &Core::ICore::coreAboutToClose, this, &QWidget::close); - m_clients = new QListWidget; - m_clients->addItems(inspector->clients()); - m_clients->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding); - auto mainLayout = new QVBoxLayout; - auto mainSplitter = new Core::MiniSplitter; - mainSplitter->setOrientation(Qt::Horizontal); - mainSplitter->addWidget(m_clients); - mainSplitter->addWidget(m_tabWidget); - mainSplitter->setStretchFactor(0, 0); - mainSplitter->setStretchFactor(1, 1); + + m_clients = new QComboBox; + m_clients->addItem(Tr::tr("