diff --git a/doc/qtcreator/images/qtcreator-options-text-editor-display.png b/doc/qtcreator/images/qtcreator-options-text-editor-display.png index c00104e3b6f..17d085931ec 100644 Binary files a/doc/qtcreator/images/qtcreator-options-text-editor-display.png and b/doc/qtcreator/images/qtcreator-options-text-editor-display.png differ diff --git a/doc/qtcreator/src/editors/creator-code-indentation.qdoc b/doc/qtcreator/src/editors/creator-code-indentation.qdoc index 2eb833bb463..11cae3c5b3f 100644 --- a/doc/qtcreator/src/editors/creator-code-indentation.qdoc +++ b/doc/qtcreator/src/editors/creator-code-indentation.qdoc @@ -64,13 +64,18 @@ To visualize whitespace in the editor, select \uicontrol Edit > \uicontrol Preferences > \uicontrol {Text Editor} > \uicontrol Display > - \uicontrol {Visualize whitespace}. + \uicontrol {Visualize whitespace}. To visualize indentation, select + \uicontrol {Visualize Indent}. \image qtcreator-options-text-editor-display.png "Text Editor Display preferences" To help you keep line length at a particular number of characters, set the number of characters in the \uicontrol {Display right margin at column} - field. To use a context-specific margin when available, select the + field. To use a different color for the margin area, select the + \uicontrol {Tint whole margin area} check box. Deselect the check box to show + the margin as a vertical line. + + To use a context-specific margin when available, select the \uicontrol {Use context-specific margin} check box. \if defined(qtcreator) For example, the margin could be set by the \c ColumnLimit option of the diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index 06f0be6c1a5..83bb4ff131a 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -8,7 +8,9 @@ \title Searching with the Locator - You can find the locator in the bottom left of the \QC window. + By default, you can find the locator in the bottom left of the \QC window. + To open it as a centered popup, click \inlineimage icons/magnifier.png + (\uicontrol Options) in it and select \uicontrol {Open as Centered Popup}. \image qtcreator-locator.png "List of locator filters" @@ -57,8 +59,8 @@ It is also possible to enter only a part of a search string. As you type, the locator shows the occurrences of that string regardless of where in the - name of an component it appears. Some locator filters, such as colon and - \c m, support \e fuzzy matching, which means that you can enter the + name of an component it appears. Some locator filters, such as colon, \c m, + and \c t, support \e fuzzy matching, which means that you can enter the uppercase letters to locate a symbol when using camel case or the letters after the underscore when using snake case. @@ -125,7 +127,7 @@ (\c {git}). For more information, see \l{Using Git}. \endif - \li Triggering menu items from the main menu (\c {t}) + \li Triggering actions (\c {t}) \li Searching for issues from the \l{https://bugreports.qt.io/} {Qt Project Bug Tracker} (\c bug). diff --git a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc index 49b658e003c..2be1ed05ef0 100644 --- a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc +++ b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc @@ -15,9 +15,9 @@ \section1 Credits - We would like to thank our contributors, who are listed in the \QC - \l{https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/dist}{change logs} - for each release. + We would like to thank our contributors, who are listed in the \QC change + logs for each release. To view the change logs, select \uicontrol Help > + \uicontrol {Change Log}. \section1 Qbs diff --git a/doc/qtcreator/src/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index 8e966759d46..bd9285df447 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -86,6 +86,11 @@ QML code by debugging or profiling it. \endif + \section1 What's New? + + For information about new features and bug fixes in each \QC release, + select \uicontrol Help > \uicontrol {Change Log}. + \section1 For \macos Users \QC uses standard names and locations for standard features, such as diff --git a/doc/qtdesignstudio/examples/doc/animationTutorial.qdoc b/doc/qtdesignstudio/examples/doc/animationTutorial.qdoc new file mode 100644 index 00000000000..d5b71b91bdb --- /dev/null +++ b/doc/qtdesignstudio/examples/doc/animationTutorial.qdoc @@ -0,0 +1,245 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Design Studio documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! + \page animation-tutorial.html + \ingroup gstutorials + \sa {Creating Timeline Animations} + + \title Timeline Animation Tutorial + \brief Illustrates how to create timeline animations and bind them to + properties in \QDS. + + \image animation-tutorial.gif + + The \e{Timeline Animation} tutorial illustrates how to create timeline animations + and bind them to properties in \QDS. First you create a keyframe animation + which you control the running state of with a switch in the UI. Next, you + create another keyframe animation where you use a slider in the UI to + control the position of the playhead. + + The starting point of this tutorial is the Animation Tutorial project, + you can download it from + \l{https://git.qt.io/public-demos/qtdesign-studio/-/tree/master/tutorial%20projects/animation-tutorial/AnimationTutorial/Start} + {here}. + + You can download the completed project from + \l{https://git.qt.io/public-demos/qtdesign-studio/-/tree/master/tutorial%20projects/animation-tutorial/AnimationTutorial/Completed} + {here}. + + This tutorial requires that you know the basics of \QDS, see + \l{Getting Started}. + + \section1 Creating a Timeline Animation + + First, you create an animation where the ball bearing continuously rotates + around its Y axis. + + \section2 Adding a Timeline and an Animation + + To add a timeline to your project: + + \list 1 + \li In the \uicontrol Timeline view, select + \inlineimage icons/plus.png + . + This creates a timeline and one animation. + \li On the \uicontrol {Animation Settings} tab in the + \uicontrol {Timeline Settings} dialog: + \list + \li Set \uicontrol Duration to 7500. + This sets the duration of the animation in milliseconds. + \li Select \uicontrol {Contiunous}. + This sets the animation to start over again when it reaches the + end. + \endlist + \image animation-tutorial-timeline-1.png + \li Select \uicontrol {Close}. + \endlist + + You can see the timeline in the \uicontrol Timeline and + \uicontrol Navigator views. + + \section2 Adding Keyframes + + Next, you add keyframes to animate the rotation of the ball bearing: + + \list 1 + \li In the \uicontrol Navigator view, select \e {ballbearing1}. + \li In the \uicontrol Properties view, select + \inlineimage icons/action-icon.png (Actions) + next to \uicontrol Rotation > \uicontrol {Y}. + \li Select \uicontrol {Insert Keyframe}. + \image animation-tutorial-insert-keyframe.png + \li In the \uicontrol Timeline view, select the + \uicontrol {Per Property Recording} button to start recording property + changes. + \image animation-tutorial-per-property-recording.png + \li In the \uicontrol Timeline view, move the playhead to the end of the + animation (frame 1000). + \li In the \uicontrol Properties view, set \uicontrol Rotation > + \uicontrol Z to 360. + This creates a second keyframe. + \li Select the \uicontrol {Per Property Recording} button to end the per + property recording. To preview the animation, drag the playhead along the + timeline. + \endlist + + \section2 Controlling the Running State of the Animation + + There is a toggle switch in the UI of this project. To use this switch to + control the running state of the animation: + + \list 1 + \li In the \uicontrol Navigator view, select \e {timelineAnimation}. + \li In the \uicontrol Connections view, go to the \uicontrol Bindings tab. + \li Select \inlineimage icons/plus.png + to create a binding. + \li For the binding you created, set: + \list + \li \uicontrol Property to \e {paused}. + \li \uicontrol {Source Item} to \e {switch1}. + \li \uicontrol {Source Property} to \e {checked}. + \endlist + \image animation-tutorial-binding.png + \endlist + + You can preview the animation and try the toggle switch in the live preview. + To run the live preview, select \key Alt + \key{P}. + + \section1 Creating a Timeline and Binding it to a Property + + Next, you create the exploded view animation of the ball bearing. You don't + want this animation to run automatically but instead you want to control it + with a slider in the UI. + + \section2 Adding a Timeline Inside a Component + + You create this animation inside the ball bearing component, to do this: + + \list 1 + \li In the \uicontrol Navigator view, select \e {ballBearing1}. + \li Select \key {F2} to go into the component. + \li In the \uicontrol Timeline view, select + \inlineimage icons/plus.png + to add a timeline and open the \uicontrol {Timeline Settings} dialog. + \li Select \inlineimage icons/minus.png + next to the \uicontrol {Animation Settings} tab to remove the animation + in this timeline. + You do not need an animation when you bind the timeline to a property. + \li Select \uicontrol {Close}. + \endlist + + \image animation-tutorial-timeline-2.png + + \section2 Adding Keyframes + + Now, you add keyframes for the different parts of the ball bearing: + + \list 1 + \li In the \uicontrol{Navigator} view, select \e{inner_race}. + \li In the \uicontrol Properties view, select + \inlineimage icons/action-icon.png (Actions) + next to \uicontrol Translation > \uicontrol Y. + \li Select \uicontrol {Insert Keyframe}. + \li In the \uicontrol Timeline view, select the + \uicontrol {Per Property Recording} button to start recording property + changes. + \li In the \uicontrol Timeline view, move the playhead to the end of the + animation (frame 1000). + \li In the \uicontrol Properties view, set \uicontrol Translation > + \uicontrol Y to 0,50. + \li Select the \uicontrol {Per Property Recording} button to end the per + property recording. + \li Next, you set the keyframe values for the other parts of the ball + bearing. For the following parts, set the \uicontrol Translation > + \uicontrol Y value for frame 1000: + \list + \li \e balls to 1,00. + \li \e retainer to 1,50. + \li \e shield_left to 1,80. + \li \e shield_right to -0,30. + \endlist + \image animation-tutorial-ballbearing-animation.png + \endlist + + You can preview the animation by dragging the playhead in the + \uicontrol Timeline view. + + \section2 Controlling the Animation with a Slider + + Now, you use the slider on the main screen to control the exploded + view animation that you created. + + To do this, you first need to define a property for the slider: + + \list 1 + \li In the \uicontrol Navigator view, select \e Node. + \li On the \uicontrol Properties tab in the \uicontrol Connections view, + select \inlineimage icons/plus.png + . + \li In the \uicontrol {Property Type} field, enter \e {Item}. + This field is a drop-down list, but you can also type text. + \li In the \uicontrol {Property Value} field, enter \e {null}. + \endlist + \image animation-tutorial-property.png + + Next, you set the property you just created to control the timeline + animation: + + \list 1 + \li In the \uicontrol {Timeline} view, select + \inlineimage icons/animation.png + . + \li In the \uicontrol {Expression binding field}, enter + \c {property0.value}. + \li Select \uicontrol {Close}. + \endlist + + Next, you go out from the component back to the main project and bind the + property to the slider: + + \list 1 + \li In the toolbar, select the \e {Screen01.ui.qml} breadcrumb. + \image animation-tutorial-breadcrumb.png + \li In the \uicontrol {Navigator} view, select \e {ballbearing1}. + \li In the \uicontrol {Connections} view, go to the + \uicontrol {Bindings} tab. + \li Select \inlineimage icons/plus.png + . + \li For the binding you just created: + \list + \li Set \uicontrol {Source Item} to \e {slider}. + \li Remove the value from \uicontrol {Source Property}. + \endlist + \image animation-tutorial-binding-2.png + \endlist + + \section1 Previewing + + Now, the animations are done. To preview and test your application, + select \key Alt + \key{P}. + +*/ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-ballbearing-animation.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-ballbearing-animation.png new file mode 100644 index 00000000000..916b2c97c7e Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-ballbearing-animation.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-binding-2.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-binding-2.png new file mode 100644 index 00000000000..d32c5be3d9f Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-binding-2.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-binding.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-binding.png new file mode 100644 index 00000000000..06648e66281 Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-binding.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-breadcrumb.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-breadcrumb.png new file mode 100644 index 00000000000..10f266e67ea Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-breadcrumb.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-insert-keyframe.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-insert-keyframe.png new file mode 100644 index 00000000000..511bab86420 Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-insert-keyframe.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-per-property-recording.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-per-property-recording.png new file mode 100644 index 00000000000..2f89cc584b4 Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-per-property-recording.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-property.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-property.png new file mode 100644 index 00000000000..78d66e63ba6 Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-property.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-timeline-1.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-timeline-1.png new file mode 100644 index 00000000000..f369fe746ff Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-timeline-1.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial-timeline-2.png b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-timeline-2.png new file mode 100644 index 00000000000..93eac2e2de2 Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial-timeline-2.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/animation-tutorial.gif b/doc/qtdesignstudio/examples/doc/images/animation-tutorial.gif new file mode 100644 index 00000000000..e663c6b685d Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/animation-tutorial.gif differ diff --git a/doc/qtdesignstudio/images/add-local-custom-property.png b/doc/qtdesignstudio/images/add-local-custom-property.png new file mode 100644 index 00000000000..68b848f5aa8 Binary files /dev/null and b/doc/qtdesignstudio/images/add-local-custom-property.png differ diff --git a/doc/qtdesignstudio/images/add-new-property-dialog.png b/doc/qtdesignstudio/images/add-new-property-dialog.png new file mode 100644 index 00000000000..6aac047855b Binary files /dev/null and b/doc/qtdesignstudio/images/add-new-property-dialog.png differ diff --git a/doc/qtdesignstudio/images/custom-properties.png b/doc/qtdesignstudio/images/custom-properties.png new file mode 100644 index 00000000000..531e62f9039 Binary files /dev/null and b/doc/qtdesignstudio/images/custom-properties.png differ diff --git a/doc/qtdesignstudio/src/components/qtquick-component-instances.qdoc b/doc/qtdesignstudio/src/components/qtquick-component-instances.qdoc index a6c84c74288..09f8d2e28b2 100644 --- a/doc/qtdesignstudio/src/components/qtquick-component-instances.qdoc +++ b/doc/qtdesignstudio/src/components/qtquick-component-instances.qdoc @@ -29,7 +29,7 @@ custom properties on the \uicontrol {Properties} tab in the \l {Connections} view. \image qmldesigner-dynamicprops.png "Connections View Properties tab" - For more information, see \l{Specifying Dynamic Properties}. + For more information, see \l{Specifying Custom Properties}. \li To enable users to interact with the component instances, connect the instances to signals on the \uicontrol Connections tab in the \uicontrol {Connections} view. For example, you can specify what diff --git a/doc/qtdesignstudio/src/components/qtquick-components-custom.qdoc b/doc/qtdesignstudio/src/components/qtquick-components-custom.qdoc index 6fb0a6e99e8..923428779b8 100644 --- a/doc/qtdesignstudio/src/components/qtquick-components-custom.qdoc +++ b/doc/qtdesignstudio/src/components/qtquick-components-custom.qdoc @@ -41,7 +41,7 @@ \uicontrol Navigator or the \uicontrol {2D} view. \li Edit component properties in the \uicontrol Properties view. The available properties depend on the component type. You can - \l{Specifying Dynamic Properties}{add properties for + \l{Specifying Custom Properties}{add properties for components} on the \uicontrol {Properties} tab in the \uicontrol Connections view. \li To change the appearance and behavior of the component instances diff --git a/doc/qtdesignstudio/src/components/qtquick-data-models.qdoc b/doc/qtdesignstudio/src/components/qtquick-data-models.qdoc index a08a1797528..6ecd695a2e7 100644 --- a/doc/qtdesignstudio/src/components/qtquick-data-models.qdoc +++ b/doc/qtdesignstudio/src/components/qtquick-data-models.qdoc @@ -139,7 +139,7 @@ When you add a \l{GridView}{Grid View}, \l{ListView}{List View}, or \l{PathView}{Path View}, the ListModel and the delegate component that creates an instance for each item in the model are added automatically. - For grid and list views, you can edit the list model in \QC. + For grid and list views, you can edit the list model in \QDS. \image qtquick-designer-listview-preview.png "Preview of a list view" diff --git a/doc/qtdesignstudio/src/components/qtquick-images.qdoc b/doc/qtdesignstudio/src/components/qtquick-images.qdoc index 4c853d5e50b..3d6879826c5 100644 --- a/doc/qtdesignstudio/src/components/qtquick-images.qdoc +++ b/doc/qtdesignstudio/src/components/qtquick-images.qdoc @@ -28,7 +28,7 @@ \image qtquick-designer-image-type.png "Image component in different views" When you drag-and-drop an image file from \uicontrol Assets to \l Navigator - or the \l {2D} view, \QC automatically + or the \l {2D} view, \QDS automatically creates an instance of the Image component for you with the path to the image file set as the value of the \uicontrol Source field in \uicontrol Properties. diff --git a/doc/qtdesignstudio/src/components/qtquick-positioning.qdoc b/doc/qtdesignstudio/src/components/qtquick-positioning.qdoc index 4fdbbece9ef..54857d91222 100644 --- a/doc/qtdesignstudio/src/components/qtquick-positioning.qdoc +++ b/doc/qtdesignstudio/src/components/qtquick-positioning.qdoc @@ -73,7 +73,7 @@ For more information on the JavaScript environment provided, see \l{Integrating QML and JavaScript}. - Bindings are a black box for \QC and using them might have a + Bindings are a black box for \QDS and using them might have a negative impact on performance, so consider setting anchors and margins for components, instead. For example, instead of setting \c {parent.width} for a component, you could anchor the component to its sibling components on the @@ -342,7 +342,7 @@ to right and top to bottom. Each component is positioned at the top-left corner of its cell with position (0, 0). - \QC generates the grid based on the positions of the child components in + \QDS generates the grid based on the positions of the child components in the \l {2D} view. You can modify the number of rows and columns in the \uicontrol Rows and \uicontrol Columns fields. diff --git a/doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc b/doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc index 96d0b4bfd65..1753da63f7b 100644 --- a/doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc +++ b/doc/qtdesignstudio/src/developers/studio-designer-developer-workflow.qdoc @@ -27,7 +27,7 @@ working Qt 6 application that you can build and run in Qt Creator using CMake. Therefore, you can open, build, and run the projects with Qt Creator. - \QDS continues to use the \e .qmlproject file format, while \QC uses a + \QDS continues to use the \e .qmlproject file format, while Qt Creator uses a \e CMakeLists.txt file as the project file. This enables you to share your project as a fully working C++ application with developers. @@ -46,9 +46,10 @@ \section1 Converting Project Structure for CMake - \QDS can generate \e CMakeLists.txt and other related files to use with \QC and to compile into - an executable application but only if the project has a certain folder structure. If you have a - \QDS QML project that doesn't have the CMake configuration, follow these steps to convert its + \QDS can generate \e CMakeLists.txt and other related files to use with + Qt Creator and to compile into an executable application but only if the + project has a certain folder structure. If you have a \QDS QML project that + doesn't have the CMake configuration, follow these steps to convert its file structure to the correct format. \list 1 diff --git a/doc/qtdesignstudio/src/overviews/qtquick-animation-overview.qdoc b/doc/qtdesignstudio/src/overviews/qtquick-animation-overview.qdoc index 6011a2a4972..ef7fccc3c7d 100644 --- a/doc/qtdesignstudio/src/overviews/qtquick-animation-overview.qdoc +++ b/doc/qtdesignstudio/src/overviews/qtquick-animation-overview.qdoc @@ -46,7 +46,7 @@ \section2 Timeline and Keyframe Based Animation - Timeline animation is based on \e keyframes. In \QC, keyframes determine the + Timeline animation is based on \e keyframes. In \QDS, keyframes determine the value of the property of a \l{glossary_component}{component} at a certain time. Animating properties enables their values to move through intermediate values instead of immediately changing to the target value. diff --git a/doc/qtdesignstudio/src/overviews/qtquick-creating-ui-logic.qdoc b/doc/qtdesignstudio/src/overviews/qtquick-creating-ui-logic.qdoc index c1227d8802e..3aebd6ae17d 100644 --- a/doc/qtdesignstudio/src/overviews/qtquick-creating-ui-logic.qdoc +++ b/doc/qtdesignstudio/src/overviews/qtquick-creating-ui-logic.qdoc @@ -114,7 +114,7 @@ \endif \row \li Adding custom properties for a particular component type - \li \l{Specifying Dynamic Properties} + \li \l{Specifying Custom Properties} \omit \row \li Adding properties for controlling states diff --git a/doc/qtdesignstudio/src/overviews/qtquick-production-quality-animation.qdoc b/doc/qtdesignstudio/src/overviews/qtquick-production-quality-animation.qdoc index 28811b6a74a..fcf1a4c4559 100644 --- a/doc/qtdesignstudio/src/overviews/qtquick-production-quality-animation.qdoc +++ b/doc/qtdesignstudio/src/overviews/qtquick-production-quality-animation.qdoc @@ -48,7 +48,7 @@ \section1 Profiling UI Code You can use \l{Profiling QML Applications}{QML Profiler} that is integrated - into \QC to find causes for typical performance problems in your UI. For + into \QDS to find causes for typical performance problems in your UI. For example, your UI might be slow, unresponsive, or stuttering. Typically, such problems are caused by executing too much JavaScript in too few frames. All JavaScript must return before the GUI thread can proceed, and frames are diff --git a/doc/qtdesignstudio/src/overviews/qtquick-prototyping.qdoc b/doc/qtdesignstudio/src/overviews/qtquick-prototyping.qdoc index a2edfa13c14..414e608a9c7 100644 --- a/doc/qtdesignstudio/src/overviews/qtquick-prototyping.qdoc +++ b/doc/qtdesignstudio/src/overviews/qtquick-prototyping.qdoc @@ -73,7 +73,7 @@ \li \l {Importing 3D Assets} - You can import exported assets into \QC. For a list of formats + You can import exported assets into \QDS. For a list of formats supported by each \l{Qt Quick 3D} version, see the module documentation. diff --git a/doc/qtdesignstudio/src/overviews/qtquick-uis.qdoc b/doc/qtdesignstudio/src/overviews/qtquick-uis.qdoc index a69e2eebb85..59eb00ab94b 100644 --- a/doc/qtdesignstudio/src/overviews/qtquick-uis.qdoc +++ b/doc/qtdesignstudio/src/overviews/qtquick-uis.qdoc @@ -20,14 +20,14 @@ components, and states, you need. Create a descriptive wireframe and acquire a detailed UI specification before you start to make the process of creating the UI more efficient. - \QC enables you to turn your UI concept into a wireframe with + \QDS enables you to turn your UI concept into a wireframe with a scalable layout where all your screens and controls are in place. You can present your wireframe to developers and other stakeholders for discussion, review, and approval before continuing into the prototyping phase. \endtable - In \QC, you build UIs around the behavior of \l{glossary-component} + In \QDS, you build UIs around the behavior of \l{glossary-component} {components} and how they connect with one another. You can use preset components available in the \l Components view or combine them to create your own components. You can specify values for the \e properties of a diff --git a/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc b/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc index 48c1999769b..7f237dfc496 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc +++ b/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc @@ -49,7 +49,7 @@ \li Edit component properties in the \l Properties view. The available properties depend on the component type. You can - \l{Specifying Dynamic Properties}{add properties for components} on + \l{Specifying Custom Properties}{add properties for components} on the \uicontrol Properties tab in the {Connections} view. \endlist diff --git a/doc/qtdesignstudio/src/qtdesignstudio-developer-topics.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-developer-topics.qdoc index 82f3b666b61..845e25b0198 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-developer-topics.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-developer-topics.qdoc @@ -26,7 +26,7 @@ \li \l{Converting UI Projects to Applications} \QDS projects are useful for creating UIs. To use them for - application development in \QC, you have to convert + application development in Qt Creator, you have to convert them to Qt Quick Application projects that contain .pro, .cpp, and .qrc files. \li \l{Using External Tools} diff --git a/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc index 43333648d8b..c7815bd349a 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc @@ -19,7 +19,7 @@ \li \l {FAQ - Assets}{Assets} \li \l {FAQ - Components}{Components} \li \l {FAQ - Views}{Views} - \li \l {FAQ - Integration Between \QDS and \QC}{Integration Between \QDS and \QC} + \li \l {FAQ - Integration Between \QDS and Qt Creator}{Integration Between \QDS and Qt Creator} \li \l {FAQ - Performance}{Performance} \li \l {FAQ - Data Simulation}{Data Simulation} \endlist @@ -67,7 +67,7 @@ \section1 FAQ - Components - \section2 Can custom components be used? + \section2 Can I use custom components? Yes, you can create custom components and controls by using wizard templates or move component instances into separate files to turn them into new @@ -81,7 +81,7 @@ For more information, see \l {Importing 3D Assets}. - \section2 How to integrate custom C++ components into QDS? + \section2 How can I integrate custom C++ components into QDS? You must create your own QML module that contains the components and provides additional information about your components. For more information, @@ -99,21 +99,21 @@ For more information, see the \l {3D} view. - \section1 FAQ - Integration Between \QDS and \QC + \section1 FAQ - Integration Between \QDS and Qt Creator - \section2 Is there a way to automatically propagate name changes between \QDS and \QC? + \section2 Can I automatically propagate name changes between \QDS and Qt Creator? Unfortunately we do not automate renaming files between tools at the moment. If you decide to change the name of a property, alias, or signal in \QDS, - you need to manually change the name in \QC to maintain the connection. + you need to manually change the name in Qt Creator to maintain the connection. However, you can rename symbols in all files within a project. To rename a QML type in a project, select \uicontrol Tools > \uicontrol QML/JS > \uicontrol {Rename Symbol Under Cursor} or press \key Ctrl+Shift+R. For more information, see \l {Renaming Symbols}. - \section2 When turning your \QDS project into application in \QC, what is the best way to add .qml files? + \section2 How can I add .qml files to my project in Qt Creator? - Use the project wizard templates to create an application in \QC and copy + Use the project wizard templates to create an application in \QDS and copy your .qml files to the project folder. Then make some changes to the project configuration and source files, as instructed in \l {Converting UI Projects to Applications}. diff --git a/doc/qtdesignstudio/src/qtdesignstudio-simulink.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-simulink.qdoc index 77d37f0dfa0..77c63d5fe16 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-simulink.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-simulink.qdoc @@ -143,7 +143,7 @@ Navigator to add the properties on the \uicontrol Properties tab in the \l Connections view. - See \l {Specifying Dynamic Properties} for a detailed description of how + See \l {Specifying Custom Properties} for a detailed description of how to add a custom property. The name of the property and the data type need to match those of the send or receive property of the Simulink model. diff --git a/doc/qtdesignstudio/src/qtdesignstudio-terms.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-terms.qdoc index 85c0ce58184..d26f96652cf 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-terms.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-terms.qdoc @@ -197,7 +197,7 @@ \li \l{Preset Components} \li \l{Specifying Component Properties} \li \l{Adding Bindings Between Properties} - \li \l{Specifying Dynamic Properties} + \li \l{Specifying Custom Properties} \endlist \section1 Signal @@ -294,7 +294,7 @@ deploys it to the \l{glossary-device}{device} specified in the selected \l{glossary-buildandrun-kit}{kit}, and runs it there. However, if you have not made any changes to the project since you last deployed - it, \QC simply runs it again. + it, \QDS simply runs it again. \endomit */ diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index 089f908e3a1..070bf4ae25e 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -122,7 +122,7 @@ \list \li\l{Connecting Components to Signals} \li\l{Adding Bindings Between Properties} - \li\l{Specifying Dynamic Properties} + \li\l{Specifying Custom Properties} \endlist \li \l{Adding States} \endlist diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-effects-materials.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-effects-materials.qdoc index df0ae40b4cd..806308869d2 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-effects-materials.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-effects-materials.qdoc @@ -193,5 +193,5 @@ \image studio-custom-material-uniform-properties.png "Uniforms as properties in Connections view Properties tab" For more information about adding properties, see - \l{Specifying Dynamic Properties}. + \l{Specifying Custom Properties}. */ diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-optimized-3d-scenes.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-optimized-3d-scenes.qdoc index 9ce91d34783..4032685223c 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-optimized-3d-scenes.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-optimized-3d-scenes.qdoc @@ -12,7 +12,7 @@ \title Creating Optimized 3D Scenes - In \QC, you can use various means to create a 3D scene. Your choice of + In \QDS, you can use various means to create a 3D scene. Your choice of strategy should always depend on the target platform of your scene. The way the content of your scene is authored can have dramatic effects on the runtime performance of your UI. The Optimal 3D Scene described @@ -88,7 +88,7 @@ The scene graph is the hierarchy of nodes that describe the scene to be rendered. - In \QC, the scene graph is represented by the tree-like view in + In \QDS, the scene graph is represented by the tree-like view in \uicontrol Navigator. You can also view the hierarchy of nodes in the \l {Code} view. By minimizing the size of the scene graph, you can minimize the effort needed when running the scene. In terms of diff --git a/doc/qtdesignstudio/src/views/qtquick-connection-editor-properties.qdoc b/doc/qtdesignstudio/src/views/qtquick-connection-editor-properties.qdoc index 2ea3ae6ede3..0d61823fc66 100644 --- a/doc/qtdesignstudio/src/views/qtquick-connection-editor-properties.qdoc +++ b/doc/qtdesignstudio/src/views/qtquick-connection-editor-properties.qdoc @@ -9,10 +9,10 @@ \else \nextpage quick-connections-backend.html \endif + \sa {Specifying Component Properties} + \title Specifying Custom Properties - \title Specifying Dynamic Properties - - Each preset \l{glossary-component}{component} has a set of preset properties + Each \l{Preset Components}{preset component }has a set of preset properties that you can specify values for. You can add custom properties that would not otherwise exist for a particular \l{Component Types}{component type}. You bind the properties to dynamic expressions to define global properties @@ -33,50 +33,36 @@ should have an \e int or \e real property for speed to which the UI is bound. - You can add properties for components on the \uicontrol Properties tab in - in the \l {Connections} view. + \section1 Adding Properties for a Component - \image qmldesigner-dynamicprops.png "Custom properties in the Connections view Custom Properties tab" - - To add properties for a component: + To add a custom property for a component: \list 1 - \li Go to the \uicontrol Properties tab in the \l Connections view. + \li Go to the \uicontrol {Local Custom Properties} section in the + \uicontrol Properties view. \li Select the \inlineimage icons/plus.png - (\uicontrol Add) button to add a dynamic property for the currently - selected component. The component ID is displayed in the \uicontrol Item - column. - \li Double-click the value in the \uicontrol Property column to give a - name to the property. Property names must begin with a lower case - letter and can only contain letters, numbers, and underscores. - JavaScript \e {reserved words} are not valid property names. - \li Double-click the value in the \uicontrol {Property Type} column to - specify the \l{Supported Property Types}{type of the property}. - \li Double-click the value in the \uicontrol {Property Value} column - to specify the value of the property. + (\uicontrol Add) button to add a custom property for the currently + selected component. + \image add-local-custom-property.png + \li Set the \uicontrol Name and \uicontrol Type for the property. + \image add-new-property-dialog.png + \endlist + + \section1 Binding a Property Value + + To bind the value of the property to that of another one or to data + accessible in the application. + + \list 1 + \li In the \uicontrol Properties view, select + \inlineimage icons/action-icon.png + next to the property. + \li Select \uicontrol {Set Binding}. + \image qmldesigner-binding-editor.png "Binding Editor" \endlist - Right-click a property and select \uicontrol {Open Binding Editor} in - the context menu to bind the value of the property to that of another one - or to data accessible in the application in \uicontrol {Binding Editor}. For more information, see \l{Setting Bindings}. - \image qmldesigner-binding-editor.png "Binding Editor" - - The properties you add for a component are displayed in the \l Properties - view when you select a component of that type in the \l Navigator or - \l {2D} view. - - \image qtquick-custom-properties.png "Custom properties in Properties view" - - For more information about setting property values in the - \l Properties view, see \l{Specifying Component Properties}. - - \if defined(qtcreator) - For an example of using custom properties in an application, see - \l{Creating a Mobile Application}. - \endif - \section1 Supported Property Types The following table describes the supported property types: @@ -112,6 +98,9 @@ \row \li string \li Free form text string + \row + \li TextureInput + \li Specifies a texture exposed to the shaders of a CustomMaterial or Effect. \row \li url \li Resource locator, such as a file name. It can be either absolute, @@ -122,5 +111,14 @@ \li variant \li Generic property type. For example, variant properties can store numbers, strings, objects, arrays, and functions. + \row + \li vector2d + \li Refers to a value with x and y attributes. + \row + \li vector3d + \li Refers to a value with x, y, and z attributes. + \row + \li vector4d + \li Refers to a value with x, y, z, and w attributes. \endtable */ diff --git a/doc/qtdesignstudio/src/views/qtquick-connection-editor.qdoc b/doc/qtdesignstudio/src/views/qtquick-connection-editor.qdoc index 5f87102e66b..d17dbcb003d 100644 --- a/doc/qtdesignstudio/src/views/qtquick-connection-editor.qdoc +++ b/doc/qtdesignstudio/src/views/qtquick-connection-editor.qdoc @@ -26,7 +26,7 @@ the value of a property changes, the values of any properties that are bound to it are automatically updated accordingly. - \li \l{Specifying Dynamic Properties} + \li \l{Specifying Custom Properties} Each preset component has a set of preset properties that you can specify values for. You can add custom properties that would diff --git a/doc/qtdesignstudio/src/views/qtquick-connection-view.qdoc b/doc/qtdesignstudio/src/views/qtquick-connection-view.qdoc index 94895ea3f21..69c2a78dc9c 100644 --- a/doc/qtdesignstudio/src/views/qtquick-connection-view.qdoc +++ b/doc/qtdesignstudio/src/views/qtquick-connection-view.qdoc @@ -63,7 +63,7 @@ \li \uicontrol Properties \li Add custom properties that would not otherwise exist for a particular preset component or your own custom component. - \li \l{Specifying Dynamic Properties} + \li \l{Specifying Custom Properties} \if defined(qtcreator) \row \li \uicontrol Backends diff --git a/doc/qtdesignstudio/src/views/qtquick-navigator.qdoc b/doc/qtdesignstudio/src/views/qtquick-navigator.qdoc index c57558f6de5..90735297f7b 100644 --- a/doc/qtdesignstudio/src/views/qtquick-navigator.qdoc +++ b/doc/qtdesignstudio/src/views/qtquick-navigator.qdoc @@ -107,7 +107,7 @@ \section1 Locking Components When designing complex applications, it is easy to accidentally modify - the properties of a component in one of the \QC views in ways that lead to + the properties of a component in one of the \QDS views in ways that lead to surprising results. For example, the \uicontrol {2D} view can become crowded and other components can get in the way when you are trying to select or transform a particular component, so that you end up transforming @@ -115,7 +115,7 @@ To lock components that you are not currently editing and their children, click \inlineimage icons/lockon.png - in \uicontrol Navigator. Locked components cannot be handled in any \QC + in \uicontrol Navigator. Locked components cannot be handled in any \QDS views. You can unlock the components when you want to edit them again. \image qtquick-designer-navigator-lock.gif "Locking components in Navigator" diff --git a/doc/qtdesignstudio/src/views/qtquick-properties-view.qdoc b/doc/qtdesignstudio/src/views/qtquick-properties-view.qdoc index a7efc9d00bd..d8f1f01d159 100644 --- a/doc/qtdesignstudio/src/views/qtquick-properties-view.qdoc +++ b/doc/qtdesignstudio/src/views/qtquick-properties-view.qdoc @@ -22,6 +22,26 @@ \image qmldesigner-element-properties.png "Rectangle and Text properties" + \section1 Custom Properties + + Custom Properties are properties that the user has added to the component. + + There are two types of custom properties: + + \table + \header + \li Custom Property Type + \li Description + \row + \li Local Custom Property + \li A property that has been added for a \l{Preset Components}{preset component}. + \row + \li Exposed Custom Property + \li A property that has been added inside a component. + \endtable + + \image custom-properties.png + \section1 Summary of Properties View Buttons The following table lists the \uicontrol Properties view buttons: diff --git a/doc/qtdesignstudio/src/views/qtquick-properties.qdoc b/doc/qtdesignstudio/src/views/qtquick-properties.qdoc index 6127c12283b..d716932d943 100644 --- a/doc/qtdesignstudio/src/views/qtquick-properties.qdoc +++ b/doc/qtdesignstudio/src/views/qtquick-properties.qdoc @@ -29,7 +29,7 @@ another preset component in the field. If you have specified values for properties that are not supported by the - new component type, \QC offers to remove them for you. If you'd rather do + new component type, \QDS offers to remove them for you. If you'd rather do this yourself, you can select the \inlineimage icons/action-icon.png (\uicontrol Actions) menu next to the property name, and then select \uicontrol Reset to remove the property values before trying again. diff --git a/doc/qtdesignstudio/src/views/studio-workspaces.qdoc b/doc/qtdesignstudio/src/views/studio-workspaces.qdoc index e26f1ce8a88..a6a6d97dfb0 100644 --- a/doc/qtdesignstudio/src/views/studio-workspaces.qdoc +++ b/doc/qtdesignstudio/src/views/studio-workspaces.qdoc @@ -8,7 +8,7 @@ \title Managing Workspaces - In the \uicontrol Design mode, you can arrange a set of \QC + In the \uicontrol Design mode, you can arrange a set of \QDS views as a \e workspace on the screen. To detach views: @@ -34,10 +34,10 @@ \section1 Saving Workspaces - The changes you make to a workspace are saved when you exit \QC. + The changes you make to a workspace are saved when you exit \QDS. Select \uicontrol View > \uicontrol Workspaces > \uicontrol Manage > \uicontrol {Restore last workspace on startup} - to restore the current workspace the next time you start \QC. + to restore the current workspace the next time you start \QDS. \image qtcreator-workspace-manager.png "Workspace Manager" diff --git a/share/qtcreator/debugger/creatortypes.py b/share/qtcreator/debugger/creatortypes.py index 8d0edf2e804..2e440d5d2bc 100644 --- a/share/qtcreator/debugger/creatortypes.py +++ b/share/qtcreator/debugger/creatortypes.py @@ -198,14 +198,8 @@ def qdump__CPlusPlus__Internal__Value(d, value): def qdump__Utils__FilePath(d, value): - try: - # support FilePath before 4.15 as well - if not d.extractPointer(value["m_url"]): # there is no valid URL - d.putStringValue(value["m_data"]) - else: - d.putItem(value["m_url"]) - except: - scheme, host, path = d.split("{@QString}{@QString}{@QString}", value) + data, path_len, scheme_len, host_len = d.split("{@QString}IHH", value) + if False: scheme_enc = d.encodeString(scheme) host_enc = d.encodeString(host) elided, path_enc = d.encodeStringHelper(path, d.displayStringLimit) @@ -218,7 +212,10 @@ def qdump__Utils__FilePath(d, value): if not path_enc.startswith(slash): val += slash + dot + slash val += path_enc - d.putValue(val, "utf16", elided=elided) + else: + elided, data_enc = d.encodeStringHelper(data, d.displayStringLimit) + val = data_enc + d.putValue(val, "utf16", elided=elided) d.putPlainChildren(value) diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowser.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowser.qml index ba72ef03a89..4e3d9213859 100644 --- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowser.qml +++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowser.qml @@ -17,6 +17,7 @@ Item { property var currentMaterial: null property int currentMaterialIdx: 0 property var currentBundleMaterial: null + property int copiedMaterialInternalId: -1 property var matSectionsModel: [] @@ -125,15 +126,20 @@ Item { StudioControls.MenuItem { text: modelData enabled: root.currentMaterial - onTriggered: materialBrowserModel.copyMaterialProperties(root.currentMaterialIdx, modelData) + onTriggered: { + root.copiedMaterialInternalId = root.currentMaterial.materialInternalId + materialBrowserModel.copyMaterialProperties(root.currentMaterialIdx, modelData) + } } } } StudioControls.MenuItem { text: qsTr("Paste properties") - enabled: root.currentMaterial && root.currentMaterial.materialType - === materialBrowserModel.copiedMaterialType + enabled: root.currentMaterial + && root.copiedMaterialInternalId !== root.currentMaterial.materialInternalId + && root.currentMaterial.materialType === materialBrowserModel.copiedMaterialType + && materialBrowserModel.isCopiedMaterialValid() onTriggered: materialBrowserModel.pasteMaterialProperties(root.currentMaterialIdx) } @@ -213,7 +219,22 @@ Item { width: root.width - addMaterialButton.width - onSearchChanged: (searchText) => rootView.handleSearchFilterChanged(searchText) + onSearchChanged: (searchText) => { + rootView.handleSearchFilterChanged(searchText) + + // make sure searched categories that have matches are expanded + if (!materialBrowserModel.isEmpty && !userMaterialsSection.expanded) + userMaterialsSection.expanded = true + + if (!materialBrowserBundleModel.isEmpty && !bundleMaterialsSection.expanded) + bundleMaterialsSection.expanded = true + + for (let i = 0; i < bundleMaterialsSectionRepeater.count; ++i) { + let sec = bundleMaterialsSectionRepeater.itemAt(i) + if (sec.visible && !sec.expanded) + sec.expanded = true + } + } } IconButton { @@ -282,10 +303,8 @@ Item { height: root.cellHeight onShowContextMenu: { - if (searchBox.isEmpty()) { - root.currentMaterial = model - cxtMenu.popup() - } + root.currentMaterial = model + cxtMenu.popup() } } } @@ -312,6 +331,8 @@ Item { } Section { + id: bundleMaterialsSection + width: root.width caption: qsTr("Material Library") addTopPadding: noMatchText.visible @@ -319,6 +340,8 @@ Item { Column { Repeater { + id: bundleMaterialsSectionRepeater + model: materialBrowserBundleModel delegate: Section { @@ -343,10 +366,8 @@ Item { height: root.cellHeight onShowContextMenu: { - if (searchBox.isEmpty()) { - root.currentBundleMaterial = modelData - cxtMenuBundle.popup() - } + root.currentBundleMaterial = modelData + cxtMenuBundle.popup() } } } diff --git a/share/qtcreator/qmldesigner/newstateseditor/Main.qml b/share/qtcreator/qmldesigner/newstateseditor/Main.qml index 29feb5741db..540f70b4857 100644 --- a/share/qtcreator/qmldesigner/newstateseditor/Main.qml +++ b/share/qtcreator/qmldesigner/newstateseditor/Main.qml @@ -303,18 +303,50 @@ Rectangle { width: Math.min(300, root.width) - onApplied: { + function apply() { let renamed = statesEditorModel.renameActiveStateGroup(editTextField.text) if (renamed) editDialog.close() } + onApplied: editDialog.accept() + StudioControls.TextField { id: editTextField - text: statesEditorModel.activeStateGroup actionIndicatorVisible: false translationIndicatorVisible: false anchors.fill: parent + + onTextChanged: { + let btn = editDialog.standardButton(Dialog.Apply) + if (!btn) + return + + if (editDialog.previousString !== editTextField.text) { + btn.enabled = true + } else { + btn.enabled = false + } + } + + onAccepted: editDialog.accept() + onRejected: editDialog.reject() + } + + onAccepted: { + let renamed = statesEditorModel.renameActiveStateGroup(editTextField.text) + if (renamed) + editDialog.close() + } + + property string previousString + + onAboutToShow: { + editTextField.text = statesEditorModel.activeStateGroup + editDialog.previousString = statesEditorModel.activeStateGroup + + let btn = editDialog.standardButton(Dialog.Apply) + btn.enabled = false } } @@ -747,8 +779,7 @@ Rectangle { height: extendGap.portraitOneColumn ? root.innerGridSpacing : Constants.thumbnailSize + 2 * root.extend color: StudioTheme.Values.themeStateHighlight - visible: extendBackground.radius !== 0 - && extendBackground.visible + visible: extendBackground.visible } StateThumbnail { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml index fedf76bdbbe..4e2ef4b044a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml @@ -35,7 +35,7 @@ Section { id: root anchors.left: parent.left anchors.right: parent.right - caption: qsTr("User Added Properties") + caption: qsTr("Local Custom Properties") property DynamicPropertiesModel propertiesModel: null diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExpressionTextField.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExpressionTextField.qml index 65ac0a62766..bc6763abbeb 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExpressionTextField.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExpressionTextField.qml @@ -11,8 +11,6 @@ import StudioTheme 1.0 as StudioTheme StudioControls.TextField { id: textField - signal rejected - translationIndicator.visible: false actionIndicator.visible: false @@ -136,6 +134,11 @@ StudioControls.TextField { onPressed: listView.model = null + onRejected: { + if (textField.completionActive) + listView.model = null + } + Keys.priority: Keys.BeforeItem Keys.onPressed: function(event) { var text = textField.text @@ -222,15 +225,6 @@ StudioControls.TextField { } } - Keys.onEscapePressed: function(event) { - event.accepted = true - if (textField.completionActive) { - listView.model = null - } else { - textField.rejected() - } - } - Keys.onUpPressed: function(event) { listView.decrementCurrentIndex() event.accepted = false diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/DialogButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/DialogButton.qml index 6f0c33264fc..173b4ffdf3d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/DialogButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/DialogButton.qml @@ -60,7 +60,7 @@ T.Button { states: [ State { name: "default" - when: !root.down && !root.hovered && !root.checked + when: root.enabled && !root.down && !root.hovered && !root.checked PropertyChanges { target: background @@ -75,7 +75,7 @@ T.Button { }, State { name: "hover" - when: root.hovered && !root.checked && !root.down + when: root.enabled && root.hovered && !root.checked && !root.down PropertyChanges { target: background @@ -88,8 +88,8 @@ T.Button { } }, State { - name: "pressed" - when: root.checked || root.down + name: "press" + when: root.enabled && (root.checked || root.down) PropertyChanges { target: background @@ -100,6 +100,19 @@ T.Button { target: textItem color: StudioTheme.Values.themeTextColor } + }, + State { + name: "disable" + when: !root.enabled + PropertyChanges { + target: background + color: StudioTheme.Values.themeControlBackgroundDisabled + border.color: StudioTheme.Values.themeControlOutlineDisabled + } + PropertyChanges { + target: textItem + color: StudioTheme.Values.themeTextColorDisabled + } } ] } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml index 4911bf11800..a0cf90b76da 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml @@ -30,6 +30,8 @@ T.TextField { property bool contextMenuAboutToShow: false + signal rejected + horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter @@ -225,10 +227,10 @@ T.TextField { } ] - Keys.onPressed: function(event) { - if (event.key === Qt.Key_Escape) { - root.text = root.preFocusText - root.focus = false - } + Keys.onEscapePressed: function(event) { + event.accepted = true + root.text = root.preFocusText + root.rejected() + root.focus = false } } diff --git a/share/qtcreator/translations/qtcreator_cs.ts b/share/qtcreator/translations/qtcreator_cs.ts index ee2b5662bc7..31bbd36f7af 100644 --- a/share/qtcreator/translations/qtcreator_cs.ts +++ b/share/qtcreator/translations/qtcreator_cs.ts @@ -44,7 +44,7 @@ - BookmarkDialog + Bookmarks Add Bookmark Přidat záložku @@ -81,13 +81,6 @@ Add in folder: Přidat do složky: - - - BookmarkManager - - Bookmarks - Záložky - Remove Odstranit @@ -100,21 +93,6 @@ You are going to delete a Folder which will also<br>remove its content. Are you sure you would like to continue? Chystáte se smazat složku, přičemž se smaže<br>i její obsah. Jste si jistý, že přesto chcete pokračovat? - - New Folder - Nová složka - - - - BookmarkWidget - - Delete Folder - Smazat složku - - - Rename Folder - Přejmenovat složku - Show Bookmark Ukázat záložku @@ -143,17 +121,6 @@ Add Přidat - - Remove - Odstranit - - - - Bookmarks - - Bookmarks - Záložky - Move Up Posunout nahoru @@ -560,7 +527,7 @@ - CodePaster::CodepasterPlugin + CodePaster &Code Pasting &Vkládání kódu @@ -609,25 +576,6 @@ Empty snippet received for "%1". Přijat prázdný úryvek pro "%1". - - This protocol supports no listing - Tento protokol nepodporuje výpisy - - - Waiting for items - Čeká se na data - - - - CodePaster::PasteSelectDialog - - Paste: - Vložit: - - - Protocol: - Protokol: - Refresh Obnovit @@ -640,13 +588,6 @@ This protocol does not support listing Tento protokol nepodporuje výpisy - - - CodePaster::SettingsPage - - Username: - Uživatelské jméno: - Copy Paste URL to clipboard Kopírovat URL do schránky @@ -659,38 +600,6 @@ General Obecné - - CodePaster - CodePaster - - - Default Protocol: - Výchozí protokol: - - - Pastebin.ca - Pastebin.ca - - - Pastebin.com - Pastebin.com - - - Code Pasting - Vkládání kódu - - - Display Output pane after sending a post - Po odeslání ukázat výstupní tabulku - - - Copy-paste URL to clipboard - Kopírovat URL do schránky - - - Default protocol: - Výchozí protokol: - CommonOptionsPage @@ -16766,7 +16675,7 @@ p, li { white-space: pre-wrap; } - Cvs::Internal::SettingsPage + Cvs Prompt to submit Potvrdit předložení @@ -18464,7 +18373,7 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás - CodePaster::CodePasterProtocol + CodePaster No Server defined in the CodePaster preferences. V nastavení ke CodePaster nebyl stanoven žádný server. @@ -18477,9 +18386,6 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás No such paste Požadované vložení neexistuje - - - CodePaster::CodePasterSettingsPage CodePaster CodePaster @@ -18488,10 +18394,6 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás <i>Note: Specify the host name for the CodePaster service without any protocol prepended (e.g. codepaster.mycompany.com).</i> <i>Poznámka: Zadejte název hostitelského počítače (serveru) pro službu CodePaster bez protokolové předpony (například: codepaster.mycompany.com).</i> - - Code Pasting - Vkládání kódu - Server: Server: @@ -18635,7 +18537,7 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás - Cvs::Internal::CheckoutWizard + Cvs Checks out a project from a CVS repository. Odhlásí projekt ze skladiště CVS. @@ -18648,9 +18550,6 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás CVS Checkout Získání (checkout) skladiště CVS - - - Cvs::Internal::CheckoutWizardPage Location Umístění @@ -18663,16 +18562,6 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás Repository: Skladiště: - - - CvsPlugin - - Cannot find repository for '%1' - Nelze najít skladiště pro '%1' - - - - Cvs::Internal::CvsPlugin Parsing of the log output failed Nepodařilo se vyhodnotit výstup záznamu @@ -18998,9 +18887,6 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás CVS did not respond within timeout limit (%1 ms). Žádná odpověď od CVS v rámci časového omezení (%1 ms). - - - Cvs::Internal::CvsSubmitEditor Added Přidáno @@ -19017,9 +18903,6 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás CVS Submit Předložení CVS - - - Cvs::Internal::SettingsPageWidget CVS Command Příkaz CVS @@ -21205,25 +21088,6 @@ S60 emulator run configuration default display name, %1 is base pro-File nameNastavit znovu výchozí - - CodePaster::FileShareProtocolSettingsWidget - - Form - Formulář - - - &Display: - &Zobrazit: - - - entries - Záznamy - - - The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. - Protokol vložení založený na sdílení souborů umožňuje sdílení kousků kódu pomocí jednoduchých souborů na sdílené síťové diskové jednotce. Soubory nejsou nikdy mazány. - - Git::Internal::StashDialog @@ -24270,9 +24134,6 @@ heslem, jež můžete zadat níže. Code Pasting Úryvky kódu - - - CodePaster::FileShareProtocol Cannot open %1: %2 Nelze otevřít soubor '%1': %2 @@ -24297,23 +24158,10 @@ heslem, jež můžete zadat níže. Pasted: %1 Vloženo: %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Sdílení souboru - - - CodePaster::PasteBinDotComSettings - - Pastebin.com - Pastebin.com - - - - CodePaster::PasteView <Comment> <Poznámka> @@ -24322,9 +24170,6 @@ heslem, jež můžete zadat níže. Paste Vložit - - - CodePaster::Protocol %1 - Configuration Error %1 - Chyba v nastavení @@ -24628,7 +24473,7 @@ heslem, jež můžete zadat níže. - Cvs::Internal::CvsEditor + Cvs Annotate revision "%1" Opatřit anotacemi revizi "%1" @@ -33605,15 +33450,12 @@ správy verzí (%2) - CodePaster::PasteBinDotComProtocol + CodePaster <Unknown> Unknown user of paste. <Neznámý> - - - CodePaster::NetworkProtocol Checking connection Ověření spojení @@ -33845,7 +33687,7 @@ Příznaky: %3 - Cvs::Internal::CvsDiffParameterWidget + Cvs Ignore whitespace Nevšímat si bílých znaků @@ -44421,7 +44263,7 @@ p, li { white-space: pre-wrap; } - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster Form Formulář @@ -44442,13 +44284,6 @@ p, li { white-space: pre-wrap; } entries záznamů - - - CodePaster::Internal::PasteBinComSettingsWidget - - Form - Formulář - <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> dovoluje posílání uživatelsky stanovených subdomén (například creator.pastebin.com). Zadejte požadovanou předponu. @@ -44461,9 +44296,6 @@ p, li { white-space: pre-wrap; } <i>Note: The plugin will use this for posting as well as fetching.</i> <i>Poznámka: Přídavný modul toto použije pro posílání a stejně tak natahování.</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: Protokol: @@ -44472,17 +44304,10 @@ p, li { white-space: pre-wrap; } Paste: Vložení: - - - CodePaster::Internal::ViewDialog Send to Codepaster Poslat na CodePaster - - Protocol: - Protokol: - &Username: &Uživatelské jméno: @@ -44531,9 +44356,6 @@ p, li { white-space: pre-wrap; } &Expires after: &Vyprší po: - - - CodePaster::Internal::SettingsPage Display Output pane after sending a post Po odeslání ukázat výstupní tabulku @@ -44550,14 +44372,6 @@ p, li { white-space: pre-wrap; } Default protocol: Výchozí protokol: - - &Expires after: - &Vyprší po: - - - Days - dnech - CppTools::Internal::CppFileSettingsPage @@ -47485,15 +47299,12 @@ Nainstalujte, prosím, alespoň jedno SDK. - AutotoolsProjectManager::Internal::AutogenStepFactory + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. Autogen - - - AutotoolsProjectManager::Internal::AutogenStep Autogen Autogen @@ -47502,9 +47313,6 @@ Nainstalujte, prosím, alespoň jedno SDK. Configuration unchanged, skipping autogen step. Nastavení nezměněno. Přeskakuje se krok autogen. - - - AutotoolsProjectManager::Internal::AutogenStepConfigWidget Arguments: Argumenty: @@ -47514,17 +47322,11 @@ Nainstalujte, prosím, alespoň jedno SDK. AutotoolsProjectManager::AutogenStepConfigWidget display name. Autogen - - - AutotoolsProjectManager::Internal::AutoreconfStepFactory Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. Autoreconf - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Autoreconf @@ -47533,21 +47335,11 @@ Nainstalujte, prosím, alespoň jedno SDK. Configuration unchanged, skipping autoreconf step. Nastavení nezměněno. Přeskakuje se krok autoreconf. - - - AutotoolsProjectManager::Internal::AutoreconfStepConfigWidget - - Arguments: - Argumenty: - Autoreconf AutotoolsProjectManager::AutoreconfStepConfigWidget display name. Autoreconf - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Default The name of the build configuration created by default for a autotools project. @@ -47565,9 +47357,6 @@ Nainstalujte, prosím, alespoň jedno SDK. New configuration name: Název nového nastavení: - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget Build directory: Adresář pro sestavování: @@ -47584,9 +47373,6 @@ Nainstalujte, prosím, alespoň jedno SDK. <Invalid tool chain> <Neplatná sada nástrojů> - - - AutotoolsProjectManager::Internal::AutotoolsManager Failed opening project '%1': Project file does not exist Projekt %1 se nepodařil otevřít: Soubor s projektem neexistuje @@ -47599,54 +47385,32 @@ Nainstalujte, prosím, alespoň jedno SDK. Failed opening project '%1': Project is not a file Projekt '%1' se nepodařil otevřít: Daný projektový soubor není soubor - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Průvodce Autotools - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. Zadejte, prosím, adresář, ve kterém chcete vytvořit svůj projekt.. Doporučuje se, nepoužívat pro vytvoření projektu zdrojový adresář. Tím se zajistí, že zdrojový adresář zůstane volný, a umožní různá sestavení s rozdílnými nastaveními. - - Build directory: - Adresář pro sestavování: - Build Location Umístění sestavování - - - AutotoolsProjectManager::Internal::AutotoolsTarget Desktop Autotools Default target display name Stolní počítač - - - AutotoolsProjectManager::Internal::AutotoolsTargetFactory Default Build Výchozí sestavení - - - AutotoolsProjectManager::Internal::ConfigureStepFactory Configure Display name for AutotoolsProjectManager::ConfigureStep id. Configure - - - AutotoolsProjectManager::Internal::ConfigureStep Configure Configure @@ -47655,21 +47419,11 @@ Nainstalujte, prosím, alespoň jedno SDK. Configuration unchanged, skipping configure step. Nastavení nezměněno, přeskakuje se krok nastavení. - - - AutotoolsProjectManager::Internal::ConfigureStepConfigWidget - - Arguments: - Argumenty: - Configure AutotoolsProjectManager::ConfigureStepConfigWidget display name. Nastavit - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 Zpracovává se %1 v adresáři %2 @@ -47678,17 +47432,11 @@ Nainstalujte, prosím, alespoň jedno SDK. Parsing directory %1 Zpracovává se adresář %1 - - - AutotoolsProjectManager::Internal::MakeStepFactory Make Display name for AutotoolsProjectManager::MakeStep id. Make - - - AutotoolsProjectManager::Internal::MakeStep Make Make @@ -47701,13 +47449,6 @@ Nainstalujte, prosím, alespoň jedno SDK. Configuration is faulty. Check the Issues view for details. Nastavení je chybné. Prověřte, prosím, pohled na potíže kvůli podrobnostem. - - - AutotoolsProjectManager::Internal::MakeStepConfigWidget - - Arguments: - Argumenty: - Make AutotoolsProjectManager::MakeStepConfigWidget display name. @@ -56824,7 +56565,7 @@ Lze používat části jmen, pokud jsou jednoznačné. - Cvs::Internal::CvsControl + Cvs &Edit Ú&pravy diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index 78f1eabde99..d1484ae1368 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -2406,7 +2406,7 @@ Advarsel: dette er en eksperimentel facilitet og kan lede til at test-eksekverba - AutotoolsProjectManager::Internal::AutogenStep + AutotoolsProjectManager Autogen Autogen @@ -2415,9 +2415,6 @@ Advarsel: dette er en eksperimentel facilitet og kan lede til at test-eksekverba Configuration unchanged, skipping autogen step. Konfiguration uændret, springer autogen-trin over. - - - AutotoolsProjectManager::Internal::AutogenStepConfigWidget Arguments: Argumenter: @@ -2427,17 +2424,11 @@ Advarsel: dette er en eksperimentel facilitet og kan lede til at test-eksekverba AutotoolsProjectManager::AutogenStepConfigWidget display name. Autogen - - - AutotoolsProjectManager::Internal::AutogenStepFactory Autogen Display name for AutotoolsProjectManager::AutogenStep id. Autogen - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Autoreconf @@ -2446,29 +2437,16 @@ Advarsel: dette er en eksperimentel facilitet og kan lede til at test-eksekverba Configuration unchanged, skipping autoreconf step. Konfiguration uændret, springer autoreconf-trin over. - - - AutotoolsProjectManager::Internal::AutoreconfStepConfigWidget - - Arguments: - Argumenter: - Autoreconf AutotoolsProjectManager::AutoreconfStepConfigWidget display name. Autoreconf - - - AutotoolsProjectManager::Internal::AutoreconfStepFactory Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. Autoreconf - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Default The name of the build configuration created by default for a autotools project. @@ -2478,9 +2456,6 @@ Advarsel: dette er en eksperimentel facilitet og kan lede til at test-eksekverba Build Byg - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget Build directory: Bygmappe: @@ -2489,31 +2464,18 @@ Advarsel: dette er en eksperimentel facilitet og kan lede til at test-eksekverba Autotools Manager Autotools-håndtering - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Autotools-assistent - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. It is not recommended to use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. Indtast venligst mappen hvor du vil bygge dit projekt. Det anbefaler ikke at bruge kildemappen til bygning. Dette sikre at kildemappen forbliver ren og muliggør flere bygninger med forskellige indstillinger. - - Build directory: - Bygmappe: - Build Location Bygplacering - - - AutotoolsProjectManager::Internal::ConfigureStep Configure Konfigurer @@ -2522,56 +2484,30 @@ Advarsel: dette er en eksperimentel facilitet og kan lede til at test-eksekverba Configuration unchanged, skipping configure step. Konfiguration uændret, springer konfigurationstrin over. - - - AutotoolsProjectManager::Internal::ConfigureStepConfigWidget - - Arguments: - Argumenter: - Configure AutotoolsProjectManager::ConfigureStepConfigWidget display name. Konfigurer - - - AutotoolsProjectManager::Internal::ConfigureStepFactory Configure Display name for AutotoolsProjectManager::ConfigureStep id. Konfigurer - - - AutotoolsProjectManager::Internal::MakeStep Make Make - - - AutotoolsProjectManager::Internal::MakeStepConfigWidget - - Arguments: - Argumenter: - Make AutotoolsProjectManager::MakeStepConfigWidget display name. Make - - - AutotoolsProjectManager::Internal::MakeStepFactory Make Display name for AutotoolsProjectManager::MakeStep id. Make - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 Parser %1 i mappen %2 @@ -3818,7 +3754,7 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15. - BinEditor::Internal::BinEditorDocument + BinEditor The Binary Editor cannot open empty files. Binær-redigeringen kan ikke åbne tomme filer. @@ -3835,9 +3771,6 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15.Cannot open %1: %2 Kan ikke åbne %1: %2 - - - BinEditor::Internal::BinEditorWidget Memory at 0x%1 Hukommelse ved 0x%1 @@ -3940,14 +3873,14 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15. - BinEditorWidget::TextEditorWidget + BinEditor Zoom: %1% Zoom: %1% - BookmarkDialog + Bookmarks Add Bookmark Tilføj bogmærke @@ -3980,13 +3913,6 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15.Rename Folder Omdøb mappe - - - BookmarkManager - - Bookmarks - Bogmærker - Remove Fjern @@ -3995,25 +3921,10 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15.Deleting a folder also removes its content.<br>Do you want to continue? Sletning af en mappe fjerner også alt dens indhold.<br>Vil du fortsætte? - - New Folder - Ny mappe - Bookmark Bogmærke - - - BookmarkWidget - - Delete Folder - Slet mappe - - - Rename Folder - Omdøb mappe - Show Bookmark Vis bogmærke @@ -4030,9 +3941,6 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15.Rename Bookmark Omdøb bogmærke - - - Bookmarks Edit Bookmark Rediger bogmærke @@ -4045,10 +3953,6 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15.Line number: Linjenummer: - - Bookmarks - Bogmærker - Move Up Flyt op @@ -5706,9 +5610,6 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere Code Pasting Kodeindsætning - - - CodePaster::AuthenticationDialog Username: Brugernavn: @@ -5717,9 +5618,6 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere Password: Adgangskode: - - - CodePaster::CodepasterPlugin &Code Pasting &Kodeindsætning @@ -5764,9 +5662,6 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere Empty snippet received for "%1". Tom snippet modtaget fra "%1". - - - CodePaster::FileShareProtocol Cannot open %1: %2 Kan ikke åbne %1: %2 @@ -5787,16 +5682,10 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere Pasted: %1 Indsatte: %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Fildeling - - - CodePaster::Internal::FileShareProtocolSettingsWidget The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. Den fildelingsbaseret indsætter-protokol giver mulighed for at dele kode-snippets ved brug af simple filer på et delt netværksdrev. Filer slettes aldrig. @@ -5813,9 +5702,6 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere entries poster - - - CodePaster::Internal::PasteBinComSettingsWidget <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> giver mulighed for at sende poster til brugerdefineret underdomæner (f.eks. creator.pastebin.com). Udfyld det ønsket præfiks. @@ -5828,9 +5714,6 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere <i>Note: The plugin will use this for posting as well as fetching.</i> <i>Bemærk: pluginet bruger dette til både at sende og hente.</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: Protokol: @@ -5839,9 +5722,6 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere Paste: Indsæt: - - - CodePaster::Internal::SettingsPage Copy-paste URL to clipboard Kopiér-indsæt URL til udklipsholder @@ -5858,25 +5738,14 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere Display Output pane after sending a post Vis outputrude efter afsendelse af en post - - Username: - Brugernavn: - Days dag(e) - - - CodePaster::Internal::ViewDialog Send to Codepaster Send til kodeindsætter - - Protocol: - Protokol: - &Username: &Brugernavn: @@ -5893,14 +5762,6 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere <Description> <beskrivelse> - - Days - dag(e) - - - &Expires after: - &Udløber efter: - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> @@ -5925,9 +5786,6 @@ p, li { white-space: pre-wrap; } Patch 2 Patch 2 - - - CodePaster::KdePasteProtocol Pasting to KDE paster needs authentication.<br/>Enter your KDE Identity credentials to continue. Indsætning til KDE-indsætter kræver autentifikation.<br/>Indtast din KDE-identitetslegitimationsoplysninger for at fortsætte. @@ -5936,9 +5794,6 @@ p, li { white-space: pre-wrap; } Login failed Indlogning mislykkedes - - - CodePaster::NetworkProtocol Pasting needs authentication.<br/>Enter your identity credentials to continue. Indsætning kræver autentifikation.<br/>Indtast din identitetslegitimationsoplysninger for at fortsætte. @@ -5955,9 +5810,6 @@ p, li { white-space: pre-wrap; } Connecting to %1... Opretter forbindelse til %1... - - - CodePaster::PasteSelectDialog Refresh Genindlæs @@ -5970,9 +5822,6 @@ p, li { white-space: pre-wrap; } This protocol does not support listing Denne protokol understøtter ikke visning - - - CodePaster::PasteView <Comment> <kommentar> @@ -5981,16 +5830,10 @@ p, li { white-space: pre-wrap; } Paste Indsæt - - - CodePaster::Protocol %1 - Configuration Error %1 - konfigurationsfejl - - - CodePaster::SettingsPage General Generelt @@ -10278,7 +10121,7 @@ Flag: %3 - Cvs::Internal::CvsControl + Cvs &Edit &Rediger @@ -10287,9 +10130,6 @@ Flag: %3 CVS Checkout CVS checkout - - - Cvs::Internal::CvsDiffConfig Ignore Whitespace Ignorer blanktegn @@ -10298,16 +10138,10 @@ Flag: %3 Ignore Blank Lines Ignorer tomme linjer - - - Cvs::Internal::CvsEditorWidget Annotate revision "%1" Annotate revision "%1" - - - Cvs::Internal::CvsPlugin Cannot find repository for "%1". Kan ikke finde repository for "%1". @@ -10576,9 +10410,6 @@ Flag: %3 No CVS executable specified. Ingen CVS-eksekverbar angivet. - - - Cvs::Internal::CvsSubmitEditor Added Tilføjet @@ -10591,9 +10422,6 @@ Flag: %3 Modified Ændret - - - Cvs::Internal::SettingsPage Configuration Konfiguration @@ -10638,9 +10466,6 @@ Flag: %3 CVS CVS - - - Cvs::Internal::SettingsPageWidget CVS Command CVS-kommando @@ -43009,7 +42834,7 @@ Spordataene er tabt. - BinEditor::Internal::BinEditorPluginPrivate + BinEditor &Undo &Fortryd diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 1a9217ee998..3f62d54795a 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -25,7 +25,7 @@ - BookmarkDialog + Bookmarks Add Bookmark Lesezeichen hinzufügen @@ -58,13 +58,6 @@ Add in folder: Im Verzeichnis: - - - BookmarkManager - - Bookmarks - Lesezeichen - Remove Entfernen @@ -73,25 +66,10 @@ Deleting a folder also removes its content.<br>Do you want to continue? Beim Löschen eines Verzeichnisses wird auch dessen Inhalt gelöscht.<br>Möchten Sie trotzdem fortsetzen? - - New Folder - Neues Verzeichnis - Bookmark Lesezeichen - - - BookmarkWidget - - Delete Folder - Verzeichnis löschen - - - Rename Folder - Verzeichnis umbenennen - Show Bookmark Lesezeichen anzeigen @@ -108,13 +86,6 @@ Rename Bookmark Lesezeichen umbenennen - - - Bookmarks - - Bookmarks - Lesezeichen - Move Up Nach oben @@ -292,7 +263,7 @@ - Cvs::Internal::CvsPlugin + Cvs &CVS &CVS @@ -553,9 +524,6 @@ The initial revision %1 cannot be described. Die erste Version (%1) kann nicht weiter beschrieben werden. - - - Cvs::Internal::CvsSubmitEditor Added Hinzugefügt @@ -568,9 +536,6 @@ Modified Geändert - - - Cvs::Internal::SettingsPage Configuration Konfiguration @@ -611,9 +576,6 @@ When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit ID). Otherwise, only the respective file will be displayed. Wenn die Option aktiviert ist, werden beim Klick auf die Revisionsnummer in der Annotationsansicht alle Dateien angezeigt, die zu einem Commit gehören (mittels Commit-ID bestimmt). Ansonsten wird nur die betreffende Datei angezeigt. - - - Cvs::Internal::SettingsPageWidget CVS Command CVS-Kommando @@ -624,7 +586,7 @@ - CodePaster::CodepasterPlugin + CodePaster &Code Pasting &Code Pasting @@ -669,9 +631,6 @@ Empty snippet received for "%1". Leeren Text für "%1" erhalten. - - - CodePaster::PasteSelectDialog Refresh Aktualisieren @@ -684,9 +643,6 @@ This protocol does not support listing Dieses Protokoll stellt keine Liste zur Verfügung - - - CodePaster::SettingsPage General Allgemein @@ -10613,7 +10569,7 @@ Für CMake-Projekte stellen Sie sicher, dass die Variable QML_IMPORT_PATH in CMa - CodePaster::PasteView + CodePaster <Comment> <Kommentar> @@ -10771,7 +10727,7 @@ Für CMake-Projekte stellen Sie sicher, dass die Variable QML_IMPORT_PATH in CMa - CodePaster::FileShareProtocol + CodePaster Cannot open %1: %2 Die Datei %1 kann nicht geöffnet werden: %2 @@ -10792,16 +10748,10 @@ Für CMake-Projekte stellen Sie sicher, dass die Variable QML_IMPORT_PATH in CMa Pasted: %1 Ausschnitt: %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Dateibasiert - - - CodePaster::Protocol %1 - Configuration Error %1 - Konfigurationsfehler @@ -11432,7 +11382,7 @@ IDs müssen außerdem mit einem Kleinbuchstaben beginnen. - CodePaster::NetworkProtocol + CodePaster Checking connection Prüfe Verbindung @@ -17150,7 +17100,7 @@ Außer: %3 - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. Das dateibasierte Paster-Protokoll dient zum Austausch von Textauschnitten mittels einfacher Dateien auf einem Netzlaufwerk. Die Dateien werden nicht gelöscht. @@ -17167,9 +17117,6 @@ Außer: %3 entries Einträge - - - CodePaster::Internal::PasteBinComSettingsWidget <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> erlaubt das Senden an benutzerdefinierte Subdomänen (zum Beispiel creator.pastebin.com). Geben Sie das gewünschte Präfix an. @@ -17182,9 +17129,6 @@ Außer: %3 <i>Note: The plugin will use this for posting as well as fetching.</i> <i>Hinweis: Es wird sowohl zum Senden als auch zum Abholen verwendet.</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: Protokoll: @@ -17193,17 +17137,10 @@ Außer: %3 Paste: Ausschnitt: - - - CodePaster::Internal::ViewDialog Send to Codepaster An CodePaster senden - - Protocol: - Protokoll: - &Username: &Nutzername: @@ -17256,9 +17193,6 @@ p, li { white-space: pre-wrap; } Make public: Öffentlich machen: - - - CodePaster::Internal::SettingsPage Display Output pane after sending a post Ausgabebereich nach Senden anzeigen @@ -17275,14 +17209,6 @@ p, li { white-space: pre-wrap; } Default protocol: Vorgabeprotokoll: - - &Expires after: - &Verfällt nach: - - - Days - Tagen - Make pasted content public by default Hochgeladene Inhalte standardmäßig öffentlich machen @@ -18139,7 +18065,7 @@ should a repository require SSH-authentication (see documentation on SSH and the - AutotoolsProjectManager::Internal::AutogenStep + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. @@ -18157,9 +18083,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration unchanged, skipping autogen step. Unveränderte Konfiguration, autogen-Schritt wird übersprungen. - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. @@ -18169,24 +18092,14 @@ should a repository require SSH-authentication (see documentation on SSH and the Autoreconf Autoreconf - - Arguments: - Argumente: - Configuration unchanged, skipping autoreconf step. Unveränderte Konfiguration, autoreconf-Schritt wird übersprungen. - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Autotools-Assistent - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. It is not recommended to use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. Bitte geben Sie das Verzeichnis ein, in dem das Projekt erstellt werden soll. Es wird empfohlen, nicht das Quellverzeichnis zum Erstellen zu verwenden. Das ermöglicht es, das Projekt mehrmals mit verschiedenen Einstellungen zu erstellen. @@ -18199,9 +18112,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Build Location Build-Verzeichnis - - - AutotoolsProjectManager::Internal::ConfigureStep Configure Display name for AutotoolsProjectManager::ConfigureStep id. @@ -18211,17 +18121,10 @@ should a repository require SSH-authentication (see documentation on SSH and the Configure Konfigurieren - - Arguments: - Argumente: - Configuration unchanged, skipping configure step. Unveränderte Konfiguration, configure-Schritt wird übersprungen. - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 Werte %1 im Verzeichnis %2 aus @@ -28198,7 +28101,7 @@ Der vom Kit mindestens benötigte API-Level ist %1. - BinEditor::Internal::BinEditorDocument + BinEditor The Binary Editor cannot open empty files. Der Binäreditor kann keine leeren Dateien öffnen. @@ -28705,7 +28608,7 @@ Möchten Sie sie jetzt auschecken? - Cvs::Internal::CvsEditorWidget + Cvs Annotate revision "%1" Annotation für Revision "%1" @@ -37503,7 +37406,7 @@ Fehler: %5 - BinEditor::Internal::BinEditorWidget + BinEditor Memory at 0x%1 Speicher bei 0x%1 @@ -37614,7 +37517,7 @@ Fehler: %5 - BinEditorWidget::TextEditorWidget + BinEditor Zoom: %1% Vergrößerung: %1% @@ -42534,7 +42437,7 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni - BinEditor::Internal::BinEditorPlugin + BinEditor &Undo &Rückgängig @@ -44782,7 +44685,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e - AutotoolsProjectManager::Internal::AutotoolsBuildConfiguration + AutotoolsProjectManager Autotools Manager Autotools-Verwaltung @@ -48863,7 +48766,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e - CodePaster::DPasteDotComProtocol + CodePaster %1: %2 %1: %2 diff --git a/share/qtcreator/translations/qtcreator_es.ts b/share/qtcreator/translations/qtcreator_es.ts index fd0f5a18bfc..87c605a567b 100644 --- a/share/qtcreator/translations/qtcreator_es.ts +++ b/share/qtcreator/translations/qtcreator_es.ts @@ -89,7 +89,7 @@ - BookmarkDialog + Bookmarks Add Bookmark Agregar marcador @@ -126,17 +126,10 @@ Rename Folder Renombrar directorio - - - BookmarkManager Bookmark Marcador - - Bookmarks - Marcadores - Remove Suprimir @@ -149,17 +142,6 @@ New Folder Nuevo directorio - - - BookmarkWidget - - Delete Folder - Suprimir directorio - - - Rename Folder - Renombrar directorio - Show Bookmark Mostrar marcador @@ -184,17 +166,6 @@ Add Agregar - - Remove - Suprimir - - - - Bookmarks - - Bookmarks - Marcadores - &Remove Bookmark Sup&rimir marcador @@ -542,7 +513,7 @@ - CodePaster::CodepasterPlugin + CodePaster &CodePaster @@ -571,9 +542,6 @@ Waiting for items Esperando items - - - CodePaster::CustomFetcher CodePaster Error Error de CodePaster @@ -582,20 +550,10 @@ Could not fetch code No se pudo obtener el código - - - CodePaster::CustomPoster - - CodePaster Error - Error de CodePaster - Some error occured while posting Ocurrió algún error mientras se enviaba el código - - - CodePaster::PasteSelectDialog Paste: Pegar: @@ -605,9 +563,6 @@ Protocol: - - - CodePaster::SettingsPage CodePaster Server: Servidor CodePaster: @@ -11246,7 +11201,7 @@ p, li { white-space: pre-wrap; } - Cvs::Internal::SettingsPage + Cvs Prompt to submit Preguntar antes de enviar @@ -12157,14 +12112,11 @@ p, li { white-space: pre-wrap; } - CodePaster::CodePasterProtocol + CodePaster No such paste - - - CodePaster::CodePasterSettingsPage CodePaster @@ -12248,7 +12200,7 @@ p, li { white-space: pre-wrap; } - Cvs::Internal::CheckoutWizard + Cvs Checks out a project from a CVS repository. @@ -12257,9 +12209,6 @@ p, li { white-space: pre-wrap; } CVS Checkout - - - Cvs::Internal::CheckoutWizardPage Specify repository and path. @@ -12268,16 +12217,10 @@ p, li { white-space: pre-wrap; } Repository: Repositorio: - - - CvsPlugin Cannot find repository for '%1' - - - Cvs::Internal::CvsPlugin Parsing of the log output failed @@ -12468,9 +12411,6 @@ p, li { white-space: pre-wrap; } CVS did not respond within timeout limit (%1 ms). - - - Cvs::Internal::CvsSubmitEditor Added @@ -12487,9 +12427,6 @@ p, li { white-space: pre-wrap; } CVS Submit - - - Cvs::Internal::SettingsPageWidget CVS Command diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 5bfe46aed94..477a51b6798 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -48,7 +48,7 @@ - BookmarkDialog + Bookmarks Add Bookmark Ajouter un signet @@ -85,17 +85,10 @@ Add in folder: Ajouter dans le dossier : - - - BookmarkManager Bookmark Signet - - Bookmarks - Signets - Remove Supprimer @@ -108,21 +101,6 @@ You are going to delete a Folder which will also<br>remove its content. Are you sure you would like to continue? Vous allez supprimer un dossier et tout ce qu'il contient.<br>Êtes vous sûr de vouloir continuer ? - - New Folder - Nouveau dossier - - - - BookmarkWidget - - Delete Folder - Supprimer le dossier - - - Rename Folder - Renommer le dossier - Show Bookmark Afficher le signet @@ -151,17 +129,6 @@ Add Ajouter - - Remove - Supprimer - - - - Bookmarks - - Bookmarks - Signets - Move Up Déplacer vers le haut @@ -592,7 +559,7 @@ - CodePaster::CodepasterPlugin + CodePaster &CodePaster &CodePaster @@ -650,13 +617,6 @@ This protocol supports no listing Ce protocole ne prend en charge le listage - - Waiting for items - En attente des éléments - - - - CodePaster::CustomFetcher CodePaster Error Erreur dans CodePaster @@ -665,29 +625,10 @@ Could not fetch code Impossible de récuperer le code - - - CodePaster::CustomPoster - - CodePaster Error - Erreur dans CodePaster - Some error occured while posting Une erreur s'est produite lors de la publication - - - CodePaster::PasteSelectDialog - - Paste: - quelque chose de plus français pour la référence de paste? - Collage : - - - Protocol: - Protocole : - Refresh Rafraîchir @@ -700,61 +641,10 @@ This protocol does not support listing Ce protocole ne prend en charge le listage - - - CodePaster::SettingsPage General Général - - CodePaster Server: - Serveur CodePaster : - - - Username: - Nom d'utilisateur : - - - Copy Paste URL to clipboard - Copier l'URL dans le presse papier - - - Display Output Pane after sending a post - Afficher le résultat après publication - - - CodePaster - CodePaster - - - Default Protocol: - Protocole par défaut : - - - Pastebin.ca - Pastebin.ca - - - Pastebin.com - Pastebin.com - - - Code Pasting - Collage de code - - - Display Output pane after sending a post - Afficher le résultat après publication - - - Copy-paste URL to clipboard - Copier l'URL dans le presse papier - - - Default protocol: - Protocole par défaut : - CompletionSettingsPage @@ -17917,7 +17807,7 @@ p, li { white-space: pre-wrap; } - Cvs::Internal::SettingsPage + Cvs Prompt to submit Invite lors du submit @@ -19121,7 +19011,7 @@ p, li { white-space: pre-wrap; } - CodePaster::CodePasterProtocol + CodePaster No Server defined in the CodePaster preferences! Aucun serveur définit dans les préférences CodePaster ! @@ -19142,9 +19032,6 @@ p, li { white-space: pre-wrap; } No such paste Aucun collage de ce type - - - CodePaster::CodePasterSettingsPage CodePaster CodePaster @@ -19153,10 +19040,6 @@ p, li { white-space: pre-wrap; } <i>Note: Specify the host name for the CodePaster service without any protocol prepended (e.g. codepaster.mycompany.com).</i> <i>Note : spécifier le nom d'hôte pour le service CodePaster sans aucun protocole (par exemple, codepaster.mycompany.com).</i> - - Code Pasting - Collage de code - Server: Serveur : @@ -19227,7 +19110,7 @@ p, li { white-space: pre-wrap; } - Cvs::Internal::CheckoutWizard + Cvs Checks out a project from a CVS repository. Obtient un projet à partir d'un dépôt CVS. @@ -19240,9 +19123,6 @@ p, li { white-space: pre-wrap; } CVS Checkout Import CVS - - - Cvs::Internal::CheckoutWizardPage Location Emplacement @@ -19255,16 +19135,6 @@ p, li { white-space: pre-wrap; } Repository: Dépôt : - - - CvsPlugin - - Cannot find repository for '%1' - Impossible de trouver le dépot de "%1" - - - - Cvs::Internal::CvsPlugin Parsing of the log output failed Échec de l'analyse de la sortie @@ -19590,9 +19460,6 @@ p, li { white-space: pre-wrap; } CVS did not respond within timeout limit (%1 ms). CVS n'a pas répondu dans le temps imparti (%1 ms). - - - Cvs::Internal::CvsSubmitEditor Added Ajouté @@ -19609,9 +19476,6 @@ p, li { white-space: pre-wrap; } CVS Submit CVS Submit - - - Cvs::Internal::SettingsPageWidget CVS Command CVS Command @@ -21416,31 +21280,6 @@ S60 emulator run configuration default display name, %1 is base pro-File nameRestaurer les paramètres par défaut - - CodePaster::FileShareProtocolSettingsWidget - - Form - Formulaire - - - &Path: - Che&min : - - - &Display: - &Afficher : - - - entries - Entrées - - - The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. - J'ai traduis "fileshare". Mais la phrase me semble lourde... -cédric : je pense qu'il faut laisser comme ça moi ou alors carrément enlever "basé sur le partage de fichiers" mais du coup on en perd en route ... (j'ai changé "Les fichiers" en "Ces fichiers", je trouve que ça fait moins pompeux. - Le protocole de collage basé sur le partage de fichier permet de partager des fragments de code en utilisant de simples fichiers sur un disque réseau partagé. Ces fichiers ne sont jamais effacés. - - Git::Internal::StashDialog @@ -24395,9 +24234,6 @@ avec un mot de passe, que vous pouvez renseigner ci-dessus. Code Pasting Collage de code - - - CodePaster::FileShareProtocol Cannot open %1: %2 Imposible d'ouvrir %1 : %2 @@ -24422,23 +24258,10 @@ avec un mot de passe, que vous pouvez renseigner ci-dessus. Pasted: %1 Copié : %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Fileshare - - - CodePaster::PasteBinDotComSettings - - Pastebin.com - Pastebin.com - - - - CodePaster::PasteView <Comment> <Commentaire> @@ -24447,9 +24270,6 @@ avec un mot de passe, que vous pouvez renseigner ci-dessus. Paste Coller - - - CodePaster::Protocol %1 - Configuration Error %1 - Erreur de configuration @@ -24762,7 +24582,7 @@ avec un mot de passe, que vous pouvez renseigner ci-dessus. - Cvs::Internal::CvsEditor + Cvs Annotate revision "%1" Révision annotée "%1" @@ -29220,7 +29040,7 @@ La liste du serveur était %2. - CodePaster::NetworkProtocol + CodePaster Checking connection Vérification de la connexion @@ -38822,7 +38642,7 @@ Would you like to overwrite them? - CodePaster::PasteBinDotComProtocol + CodePaster <Unknown> Unknown user of paste. @@ -38862,7 +38682,7 @@ Would you like to overwrite them? - Cvs::Internal::CvsDiffParameterWidget + Cvs Ignore whitespace Ignorer les espaces @@ -43134,7 +42954,7 @@ Filtre : %2 - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster Form Formulaire @@ -43155,13 +42975,6 @@ Filtre : %2 entries Entrées - - - CodePaster::Internal::PasteBinComSettingsWidget - - Form - Formulaire - <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> permet d'envoyer d'envoyer des messages à des sous-domaines personnalisés (comme creator.pastebin.com). Remplissez le préfixe désiré. @@ -43174,9 +42987,6 @@ Filtre : %2 <i>Note: The plugin will use this for posting as well as fetching.</i> <i>Note : le plug-in utilisera ceci pour poster et récupérer. </i> - - - CodePaster::Internal::PasteSelectDialog Protocol: Protocole : @@ -43185,17 +42995,10 @@ Filtre : %2 Paste: Collage : - - - CodePaster::Internal::ViewDialog Send to Codepaster Envoyer sur Codepaster - - Protocol: - Protocole : - &Username: &Utilisateur : @@ -43244,9 +43047,6 @@ p, li { white-space: pre-wrap; } &Expires after: &Expire après : - - - CodePaster::Internal::SettingsPage Display Output pane after sending a post Afficher le résultat après publication @@ -43263,14 +43063,6 @@ p, li { white-space: pre-wrap; } Default protocol: Protocole par défaut : - - &Expires after: - &Expire après : - - - Days - Jours - CppTools::Internal::CppFileSettingsPage @@ -45153,15 +44945,12 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e - AutotoolsProjectManager::Internal::AutogenStepFactory + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. Autogen - - - AutotoolsProjectManager::Internal::AutogenStep Autogen Autogen @@ -45170,9 +44959,6 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e Configuration unchanged, skipping autogen step. Configuration inchangée, étape autogen ignorée. - - - AutotoolsProjectManager::Internal::AutogenStepConfigWidget Arguments: Arguments : @@ -45182,17 +44968,11 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e AutotoolsProjectManager::AutogenStepConfigWidget display name. Autogen - - - AutotoolsProjectManager::Internal::AutoreconfStepFactory Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. Autoreconf - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Autoreconf @@ -45201,21 +44981,11 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e Configuration unchanged, skipping autoreconf step. Configuration inchangée, étape autoreconf ignorée. - - - AutotoolsProjectManager::Internal::AutoreconfStepConfigWidget - - Arguments: - Arguments : - Autoreconf AutotoolsProjectManager::AutoreconfStepConfigWidget display name. Autoreconf - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Default The name of the build configuration created by default for a autotools project. @@ -45233,9 +45003,6 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e New configuration name: Nom de la nouvelle configuration : - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget Build directory: Répertoire de compilation : @@ -45252,9 +45019,6 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e <Invalid tool chain> <Chaîne d'outils invalide> - - - AutotoolsProjectManager::Internal::AutotoolsManager Failed opening project '%1': Project file does not exist Échec de l'ouverture du projet "%1' : le fichier du projet n"existe pas @@ -45267,47 +45031,28 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e Failed opening project '%1': Project is not a file Échec de l'ouverture du projet "%1" : le projet n'est pas un fichier - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Assistant Autotools - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. Veuillez spécifier le répertoire où vous voulez compiler votre projet. Qt Creator recommande de ne pas utiliser le répertoire source pour la compilation. Cela garantit que le répertoire source reste propre et permet des compilations multiples avec différents paramètres. - - Build directory: - Répertoire de compilation : - Build Location Emplacement de compilation - - - AutotoolsProjectManager::Internal::AutotoolsTarget Desktop Autotools Default target display name Desktop - - - AutotoolsProjectManager::Internal::ConfigureStepFactory Configure Display name for AutotoolsProjectManager::ConfigureStep id. Configurer - - - AutotoolsProjectManager::Internal::ConfigureStep Configure Configurer @@ -45317,21 +45062,11 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e ignorée ? Configuration inchangée, étape de configuration sautée. - - - AutotoolsProjectManager::Internal::ConfigureStepConfigWidget - - Arguments: - Arguments : - Configure AutotoolsProjectManager::ConfigureStepConfigWidget display name. Configurer - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 Analyse, car c'est une action en court @@ -45341,17 +45076,11 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e Parsing directory %1 Analyse du répertoire %1 - - - AutotoolsProjectManager::Internal::MakeStepFactory Make Display name for AutotoolsProjectManager::MakeStep id. Make - - - AutotoolsProjectManager::Internal::MakeStep Make Make @@ -45364,13 +45093,6 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e Configuration is faulty. Check the Issues view for details. La configuration est défectueuse, veuillez vérifier la vue des problèmes pour les détails. - - - AutotoolsProjectManager::Internal::MakeStepConfigWidget - - Arguments: - Arguments : - Make AutotoolsProjectManager::MakeStepConfigWidget display name. @@ -53656,7 +53378,7 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües. - Cvs::Internal::CvsControl + Cvs &Edit &Édition diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index 52b30f02fc8..aa0101eeb40 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -2939,7 +2939,7 @@ Za to upiši ovaj prečac i jedan razmak u polje za unos mjesta, a zatim riječ - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. Protokol lijepljenja temeljen na programu za zajedničko korištenje datoteka, omogućuje dijeljenje isječaka kȏda pomoću jednostavnih datoteka na zajedničkom mrežnom pogonu. Datoteke se nikad ne brišu. @@ -2956,9 +2956,6 @@ Za to upiši ovaj prečac i jedan razmak u polje za unos mjesta, a zatim riječ entries unosa - - - CodePaster::Internal::PasteBinComSettingsWidget <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> omogućuje slanje članaka na prilagođene poddomene (npr. creator.pastebin.com). Unesi željeni prefiks. @@ -2971,9 +2968,6 @@ Za to upiši ovaj prečac i jedan razmak u polje za unos mjesta, a zatim riječ <i>Note: The plugin will use this for posting as well as fetching.</i> <i>Napomena: Dodatak će koristiti prefiks za slanje i za dohvaćanje.</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: Protokol: @@ -2982,17 +2976,10 @@ Za to upiši ovaj prečac i jedan razmak u polje za unos mjesta, a zatim riječ Paste: Zalijepi: - - - CodePaster::Internal::ViewDialog Send to Codepaster Pošalji na Codepaster - - Protocol: - Protokol: - &Username: &Korisničko ime: @@ -3041,9 +3028,6 @@ p, li { white-space: pre-wrap; } Patch 2 Zakrpa 2 - - - CodePaster::Internal::SettingsPage Copy-paste URL to clipboard Kopiraj-zalijepi URL u međuspremnik @@ -3052,10 +3036,6 @@ p, li { white-space: pre-wrap; } Default protocol: Zadani protokol: - - &Expires after: - &Isteći će nakon: - Display Output pane after sending a post Pirkaži ploču izrade nakon slanja članka @@ -3064,10 +3044,6 @@ p, li { white-space: pre-wrap; } Username: Korisničko ime: - - Days - dana - CppCodeModelInspectorDialog @@ -3609,7 +3585,7 @@ Ti se predznaci koriste kao dodatak trenutačnom direktoriju na Switch zaglavlju - Cvs::Internal::SettingsPage + Cvs Configuration Konfiguracija @@ -9383,7 +9359,7 @@ should a repository require SSH-authentication (see documentation on SSH and the - BookmarkDialog + Bookmarks Add Bookmark Dodaj knjižnu oznaku @@ -15521,7 +15497,7 @@ Check the test environment. - AutotoolsProjectManager::Internal::AutogenStep + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. @@ -15539,9 +15515,6 @@ Check the test environment. Configuration unchanged, skipping autogen step. - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. @@ -15551,17 +15524,10 @@ Check the test environment. Autoreconf - - Arguments: - Argumenti: - Configuration unchanged, skipping autoreconf step. - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Default The name of the build configuration created by default for a autotools project. @@ -15571,27 +15537,14 @@ Check the test environment. Build - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget - - Build directory: - - Autotools Manager - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. It is not recommended to use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. @@ -15604,9 +15557,6 @@ Check the test environment. Build Location Mjesto izgradnje - - - AutotoolsProjectManager::Internal::ConfigureStep Configure Display name for AutotoolsProjectManager::ConfigureStep id. @@ -15616,17 +15566,10 @@ Check the test environment. Configure - - Arguments: - Argumenti: - Configuration unchanged, skipping configure step. - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 @@ -16464,7 +16407,7 @@ Check the test environment. - BinEditor::BinEditorWidget + BinEditor Memory at 0x%1 Memorija pri 0x%1 @@ -16626,7 +16569,7 @@ Check the test environment. - BinEditor::Internal::BinEditorDocument + BinEditor The Binary Editor cannot open empty files. Binarni uređivač ne može otvoriti prazne datoteke. @@ -16643,9 +16586,6 @@ Check the test environment. Cannot open %1: %2 Nije moguće otvoriti %1: %2 - - - BinEditor::Internal::BinEditorPlugin &Undo &Poništi @@ -16654,135 +16594,28 @@ Check the test environment. &Redo Po&novi - - - BinEditor::Internal::BinEditorWidget - - Memory at 0x%1 - Memorija pri 0x%1 - - - Decimal&nbsp;unsigned&nbsp;value: - Decimalna&nbsp;nepotpisana&nbsp;vrijednost: - - - Decimal&nbsp;signed&nbsp;value: - Decimalna&nbsp;potpisana&nbsp;vrijednost: - - - Previous&nbsp;decimal&nbsp;unsigned&nbsp;value: - Prethodna&nbsp;decimalna&nbsp;nepotpisana&nbsp;vrijednost: - - - Previous&nbsp;decimal&nbsp;signed&nbsp;value: - Prethodna&nbsp;decimalna&nbsp;potpisana&nbsp;vrijednost: - - - %1-bit&nbsp;Integer&nbsp;Type - %1-bit&nbsp;cjelobrojna&nbsp;vrsta - - - Little Endian - - - - Big Endian - - - - Binary&nbsp;value: - Binarna&nbsp;vrijednost: - - - Octal&nbsp;value: - Oktalna&nbsp;vrijednost: - - - Previous&nbsp;binary&nbsp;value: - Prethodna&nbsp;binarna&nbsp;vrijednost: - - - Previous&nbsp;octal&nbsp;value: - Prethodna&nbsp;oktalna&nbsp;vrijednost: - - - <i>double</i>&nbsp;value: - <i>dupla</i>&nbsp;vrijednost: - - - Previous <i>double</i>&nbsp;value: - Prethodna <i>dupla</i>&nbsp;vrijednost: - - - <i>float</i>&nbsp;value: - <i>pomična</i>&nbsp;vrijednost: - - - Previous <i>float</i>&nbsp;value: - Prethodna <i>pomična</i>&nbsp;vrijednost: - - - Copying Failed - Neuspjelo kopiranje - - - You cannot copy more than 4 MB of binary data. - Ne možeš kopirati više od 4 MB binarnih podataka. - - - Copy Selection as ASCII Characters - Kopiraj odabir kao ASCII znakove - - - Copy Selection as Hex Values - Kopiraj odabir kao heksadecimalne znakove - - - Set Data Breakpoint on Selection - Postavi točku prekida podataka na odabiru - Copy 0x%1 Kopiraj 0x%1 - - Jump to Address in This Window - Prijeđi na adresu u ovom prozoru - - - Jump to Address in New Window - Prijeđi na adresu u novom prozoru - Copy Value Kopiraj vrijednost - - Jump to Address 0x%1 in This Window - Prijeđi na adresu 0x%1 u ovom prozoru - - - Jump to Address 0x%1 in New Window - Prijeđi na adresu 0x%1 u novom prozoru - - BinEditorWidget::TextEditorWidget + BinEditor Zoom: %1% Zumiranje: %1% - BookmarkManager + Bookmarks Bookmark Knjižna oznaka - - Bookmarks - Knjižne oznake - Remove Ukloni @@ -16791,17 +16624,6 @@ Check the test environment. Deleting a folder also removes its content.<br>Do you want to continue? Brisanjem mape se uklanja i njen sadržaj.<br>Želiš li nastaviti? - - New Folder - Nova mapa - - - - Bookmarks - - Bookmarks - Knjižne oznake - Move Up Premjesti prema gore @@ -20608,18 +20430,11 @@ u kontrolu verzija (%2) - CodePaster::AuthenticationDialog - - Username: - Korisničko ime: - + CodePaster Password: Lozinka: - - - CodePaster::CodepasterPlugin &Code Pasting &Lijepljenje kȏda @@ -20664,9 +20479,6 @@ u kontrolu verzija (%2) Empty snippet received for "%1". Dobiven je prazan isječak za "%1". - - - CodePaster::FileShareProtocol Cannot open %1: %2 Nije moguće otvoriti %1: %2 @@ -20687,16 +20499,10 @@ u kontrolu verzija (%2) Pasted: %1 Zalijepljeno: %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Dijeljenje datoteka - - - CodePaster::KdePasteProtocol Pasting to KDE paster needs authentication.<br/>Enter your KDE Identity credentials to continue. Za lijepljenje u KDE paster je potrebna autenticikacija.<br/>Upiši tvoje podatke za KDE identifikaciju za nastavljanje. @@ -20705,16 +20511,10 @@ u kontrolu verzija (%2) Login failed Neuspjela prijava - - - CodePaster::PasteCodeDotXyzProtocol %1: %2 %1: %2 - - - CodePaster::PasteSelectDialog Refresh Aktualiziraj @@ -20727,9 +20527,6 @@ u kontrolu verzija (%2) This protocol does not support listing Ovaj protokol ne podržava popis - - - CodePaster::PasteView <Comment> <Komentar> @@ -20738,16 +20535,10 @@ u kontrolu verzija (%2) Paste Zalijepi - - - CodePaster::Protocol %1 - Configuration Error %1 – Greška u konfiguraciji - - - CodePaster::NetworkProtocol Pasting needs authentication.<br/>Enter your identity credentials to continue. Za lijepljenje je potrebna autenticikacija.<br/>Upiši tvoje podatke za identifikaciju za nastavljanje. @@ -20764,16 +20555,10 @@ u kontrolu verzija (%2) Connecting to %1... Povezivanje na %1 … - - - CodePaster::SettingsPage General Opće - - - CodePaster Code Pasting Lijepljenje kȏda @@ -21807,7 +21592,7 @@ Oznake: %3 - Cvs::Internal::CvsDiffConfig + Cvs Ignore Whitespace @@ -21816,9 +21601,6 @@ Oznake: %3 Ignore Blank Lines - - - Cvs::Internal::CvsControl &Edit &Uredi @@ -21827,16 +21609,10 @@ Oznake: %3 CVS Checkout - - - Cvs::Internal::CvsEditorWidget Annotate revision "%1" - - - Cvs::Internal::CvsPlugin Cannot find repository for "%1". @@ -22081,9 +21857,6 @@ Oznake: %3 No CVS executable specified. - - - Cvs::Internal::CvsSubmitEditor Added @@ -22096,9 +21869,6 @@ Oznake: %3 Modified Posljednja promjena - - - Cvs::Internal::SettingsPageWidget CVS Command @@ -40894,15 +40664,7 @@ What do you want to do? - BookmarkWidget - - Delete Folder - Ukloni mapu - - - Rename Folder - Preimenuj mapu - + Bookmarks Show Bookmark Prikaži knjižnu oznaku diff --git a/share/qtcreator/translations/qtcreator_hu.ts b/share/qtcreator/translations/qtcreator_hu.ts index 5f485187fec..191fbb524f5 100644 --- a/share/qtcreator/translations/qtcreator_hu.ts +++ b/share/qtcreator/translations/qtcreator_hu.ts @@ -77,7 +77,7 @@ - BookmarkDialog + Bookmarks Add Bookmark Künyvjelző hozzáadása @@ -110,13 +110,6 @@ Rename Folder Dosszié átnevezése - - - BookmarkManager - - Bookmarks - Könyvjelzők - Remove Eltávolítás @@ -125,13 +118,6 @@ You are going to delete a Folder which will also<br>remove its content. Are you sure you would like to continue? Egy olyan irattárat fog törölni, mely <br>törölni fogja annak tartalmát is. Biztos benne, hogy folytatni szeretné? - - New Folder - Új dosszié - - - - BookmarkWidget Delete Folder Irattár törlése @@ -164,21 +150,10 @@ Add Hozzáadás - - Remove - Eltávolítás - - - - Bookmarks &Remove Bookmark Könyvjelző &eltávolítása - - Bookmarks - Könyvjelzők - Remove all Bookmarks Az összes könyvjelző eltávolítása @@ -540,7 +515,7 @@ - Cvs::Internal::CvsPlugin + Cvs Parsing of the log output failed A log kimenet elemzése nem sikerült @@ -731,9 +706,6 @@ CVS did not respond within timeout limit (%1 ms). A CVS nem válaszolt az időtúllépési korláton belül (%1 ms). - - - Cvs::Internal::CvsSubmitEditor Added Hozzáadva @@ -750,9 +722,6 @@ CVS Submit CVS feltöltés - - - Cvs::Internal::CheckoutWizard Checks out a project from a CVS repository. Egy projekt megnézése egy CVS tárolóból. @@ -761,9 +730,6 @@ CVS Checkout CVS megnézés - - - Cvs::Internal::CheckoutWizardPage Specify repository and path. Határozza meg a tárolót és az útvonalat. @@ -772,9 +738,6 @@ Repository: Tároló: - - - Cvs::Internal::SettingsPage Prompt to submit Feltöltési prompt @@ -803,16 +766,10 @@ CVS CVS - - - Cvs::Internal::SettingsPageWidget CVS Command CVS parancs - - - CvsPlugin Cannot find repository for '%1' '%1' tárolóra nem található @@ -896,7 +853,7 @@ - CodePaster::0 + CodePaster &CodePaster &KódBeillesztő @@ -961,9 +918,6 @@ CodePaster KódBeillesztés - - - CodePaster::CodePasterProtocol No Server defined in the CodePaster preferences. Nincsen szerver definiálva a KódBeillesztő beállításokban. @@ -976,9 +930,6 @@ No such paste Nincs ilyen beillesztés - - - CodePaster::CodePasterSettingsPage CodePaster KódBeillesztés @@ -995,9 +946,6 @@ Note: Specify the host name for the CodePaster service without any protocol prepended (e.g. codepaster.mycompany.com). Megjegyzés: Határozza meg a hosz nevet a KódBeillesztő szolgáltatás számára. (például codepaster.mycompany.com). - - - CodePaster::CodepasterPlugin &Code Pasting &Kód beillesztés @@ -1026,9 +974,6 @@ Waiting for items Elemekre várakozás - - - CodePaster::PasteSelectDialog Protocol: Protokoll: @@ -1037,9 +982,6 @@ Paste: Beillesztés: - - - CodePaster::SettingsPage General Általános @@ -1048,10 +990,6 @@ Default Protocol: Alapértelmezett protokoll: - - CodePaster - KódBeillesztés - Pastebin.ca Pastebin.ca @@ -1072,10 +1010,6 @@ Display Output Pane after sending a post Kimeneti panel kijelzése egy küldés után - - Code Pasting - Kód beillesztés - CommonOptionsPage diff --git a/share/qtcreator/translations/qtcreator_it.ts b/share/qtcreator/translations/qtcreator_it.ts index f675922862e..98c5e2e5c14 100644 --- a/share/qtcreator/translations/qtcreator_it.ts +++ b/share/qtcreator/translations/qtcreator_it.ts @@ -98,7 +98,7 @@ - BookmarkDialog + Bookmarks Add Bookmark Aggiungi un Segnalibro @@ -135,17 +135,10 @@ Rename Folder Rinomina la Cartella - - - BookmarkManager Bookmark Segnalibro - - Bookmarks - Segnalibri - Remove Rimuovi @@ -158,17 +151,6 @@ New Folder Nuova Cartella - - - BookmarkWidget - - Delete Folder - Cancella la Cartella - - - Rename Folder - Rinomina la Cartella - Show Bookmark Mostra il Segnalibro @@ -193,17 +175,6 @@ Add Aggiungi - - Remove - Rimuovi - - - - Bookmarks - - Bookmarks - Segnalibri - &Remove Bookmark &Rimuovi Segnalibro @@ -560,7 +531,7 @@ - CodePaster::CodepasterPlugin + CodePaster &CodePaster &CodePaster @@ -589,9 +560,6 @@ Waiting for items Sto aspettando gli elementi - - - CodePaster::CustomFetcher CodePaster Error Errore CodePaster @@ -600,20 +568,10 @@ Could not fetch code Non riesco a caricare il codice - - - CodePaster::CustomPoster - - CodePaster Error - Errore CodePaster - Some error occured while posting C'è stato un errore nella spedizione - - - CodePaster::PasteSelectDialog Paste: Incolla: @@ -623,9 +581,6 @@ Protocol: - - - CodePaster::SettingsPage CodePaster Server: Server CodePaster: @@ -11144,7 +11099,7 @@ p, li { white-space: pre-wrap; } - Cvs::Internal::SettingsPage + Cvs Prompt to submit Prompt del submit @@ -12010,14 +11965,11 @@ p, li { white-space: pre-wrap; } - CodePaster::CodePasterProtocol + CodePaster No such paste - - - CodePaster::CodePasterSettingsPage CodePaster CodePaster @@ -12108,7 +12060,7 @@ p, li { white-space: pre-wrap; } - Cvs::Internal::CheckoutWizard + Cvs Checks out a project from a CVS repository. @@ -12117,9 +12069,6 @@ p, li { white-space: pre-wrap; } CVS Checkout - - - Cvs::Internal::CheckoutWizardPage Specify repository and path. @@ -12128,16 +12077,10 @@ p, li { white-space: pre-wrap; } Repository: Deposito: - - - CvsPlugin Cannot find repository for '%1' - - - Cvs::Internal::CvsPlugin Parsing of the log output failed @@ -12328,9 +12271,6 @@ p, li { white-space: pre-wrap; } CVS did not respond within timeout limit (%1 ms). - - - Cvs::Internal::CvsSubmitEditor Added @@ -12347,9 +12287,6 @@ p, li { white-space: pre-wrap; } CVS Submit - - - Cvs::Internal::SettingsPageWidget CVS Command diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index aa9f96e65ba..3c5af372adc 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -1814,7 +1814,7 @@ Local pulls are not applied to the master branch. - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster Form フォーム @@ -1835,13 +1835,6 @@ Local pulls are not applied to the master branch. entries エントリ - - - CodePaster::Internal::PasteBinComSettingsWidget - - Form - フォーム - <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> は、独自のサブドメイン(例:creator.pastebin.com)に送信する事もできます。希望するプレフィックスを入力してください。 @@ -1854,9 +1847,6 @@ Local pulls are not applied to the master branch. <i>Note: The plugin will use this for posting as well as fetching.</i> <i>注意: プラグインは受信時だけでなく送信時にも、この設定を使用します。</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: プロトコル: @@ -1865,17 +1855,10 @@ Local pulls are not applied to the master branch. Paste: 貼り付け: - - - CodePaster::Internal::ViewDialog Send to Codepaster Codepaster に送る - - Protocol: - プロトコル: - &Username: ユーザー名(&U): @@ -1928,9 +1911,6 @@ p, li { white-space: pre-wrap; } Make public: 公開する: - - - CodePaster::Internal::SettingsPage Copy-paste URL to clipboard 貼り付けた URL をクリップボードにコピーする @@ -1939,10 +1919,6 @@ p, li { white-space: pre-wrap; } Default protocol: 既定のプロトコル: - - &Expires after: - 有効期間(&E): - Display Output pane after sending a post 送信後にアウトプットペインを表示する @@ -1951,10 +1927,6 @@ p, li { white-space: pre-wrap; } Username: ユーザー名: - - Days - - Make pasted content public by default 貼り付けたコンテンツをデフォルトで公開 @@ -2535,7 +2507,7 @@ These prefixes are used in addition to current file name on Switch Header/Source - Cvs::Internal::SettingsPage + Cvs Configuration 設定 @@ -7513,7 +7485,7 @@ SSH 認証が必要とされるリポジトリで使用されます(SSH の SSH_ - BookmarkDialog + Bookmarks Add Bookmark ブックマークの追加 @@ -12297,15 +12269,12 @@ in the system's browser for manual download. - AutotoolsProjectManager::Internal::AutogenStepFactory + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. Autogen - - - AutotoolsProjectManager::Internal::AutogenStep Autogen Autogen @@ -12318,66 +12287,29 @@ in the system's browser for manual download. Configuration unchanged, skipping autogen step. 設定が変更されていない為、autogen ステップをスキップします。 - - Autogen - Display name for AutotoolsProjectManager::AutogenStep id. - Autogen - - - - AutotoolsProjectManager::Internal::AutogenStepConfigWidget - - Arguments: - 引数: - Autogen AutotoolsProjectManager::AutogenStepConfigWidget display name. Autogen - - - AutotoolsProjectManager::Internal::AutoreconfStepFactory Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. Autoreconf - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Autoreconf - - Arguments: - 引数: - Configuration unchanged, skipping autoreconf step. 設定が変更されていない為、autoreconf ステップをスキップします。 - - Autoreconf - Display name for AutotoolsProjectManager::AutoreconfStep id. - Autoreconf - - - - AutotoolsProjectManager::Internal::AutoreconfStepConfigWidget - - Arguments: - 引数: - Autoreconf AutotoolsProjectManager::AutoreconfStepConfigWidget display name. Autoreconf - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Default The name of the build configuration created by default for a autotools project. @@ -12387,9 +12319,6 @@ in the system's browser for manual download. Build ビルド - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget Build directory: ビルドディレクトリ: @@ -12398,23 +12327,14 @@ in the system's browser for manual download. Autotools Manager Autotools マネージャ - - - AutotoolsProjectManager::Internal::AutotoolsManager Failed opening project "%1": Project is not a file プロジェクト "%1" が開けません: プロジェクトがファイルではありません - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Autotools ウィザード - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. プロジェクトをビルドするディレクトリを指定してください。Qt Creator ではソースディレクトリ内でのビルドは推奨していません。ソースディレクトリとビルドディレクトリを分ける事でソースをきれいに保ち、異なる設定での複数のビルドを行う事ができます。 @@ -12423,57 +12343,28 @@ in the system's browser for manual download. Please enter the directory in which you want to build your project. It is not recommended to use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. プロジェクトをビルドするためのディレクトリを入力してください。ビルドにソースディレクトリを使用することはお勧めしません。これにより、ソース・ディレクトリがクリーンな状態に保たれ、異なる設定での複数回のビルドが可能になります。 - - Build directory: - ビルドディレクトリ: - Build Location ビルドパス - - - AutotoolsProjectManager::Internal::ConfigureStepFactory Configure Display name for AutotoolsProjectManager::ConfigureStep id. 設定する - - - AutotoolsProjectManager::Internal::ConfigureStep Configure 設定する - - Arguments: - 引数: - Configuration unchanged, skipping configure step. 設定が変更されていない為、configure ステップをスキップします。 - - Configure - Display name for AutotoolsProjectManager::ConfigureStep id. - 設定する - - - - AutotoolsProjectManager::Internal::ConfigureStepConfigWidget - - Arguments: - 引数: - Configure AutotoolsProjectManager::ConfigureStepConfigWidget display name. 設定する - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 ディレクトリ %2 の %1 を解析中 @@ -12482,28 +12373,15 @@ in the system's browser for manual download. Parsing directory %1 ディレクトリ %1 を解析中 - - - AutotoolsProjectManager::Internal::MakeStepFactory Make Display name for AutotoolsProjectManager::MakeStep id. Make - - - AutotoolsProjectManager::Internal::MakeStep Make Make - - - AutotoolsProjectManager::Internal::MakeStepConfigWidget - - Arguments: - 引数: - Make AutotoolsProjectManager::MakeStepConfigWidget display name. @@ -12971,10 +12849,6 @@ in the system's browser for manual download. Bookmarks - - Bookmarks - ブックマーク - Move Up 上に移動 @@ -14925,9 +14799,6 @@ to version control (%2) Code Pasting コード貼り付け - - - CodePaster::CodepasterPlugin &Code Pasting コード貼り付け(&C) @@ -14972,9 +14843,6 @@ to version control (%2) Empty snippet received for "%1". "%1" から空のテンプレートを受信しました。 - - - CodePaster::FileShareProtocol Cannot open %1: %2 %1 を開けません: %2 @@ -14995,16 +14863,10 @@ to version control (%2) Pasted: %1 貼り付け: %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Fileshare - - - CodePaster::PasteSelectDialog Refresh 更新 @@ -15017,9 +14879,6 @@ to version control (%2) This protocol does not support listing このプロトコルは一覧表示をサポートしていません - - - CodePaster::PasteView <Comment> <コメント> @@ -15028,16 +14887,10 @@ to version control (%2) Paste 貼り付け - - - CodePaster::Protocol %1 - Configuration Error %1 - 設定エラー - - - CodePaster::NetworkProtocol Checking connection 接続の確認 @@ -15046,9 +14899,6 @@ to version control (%2) Connecting to %1... %1 に接続中... - - - CodePaster::SettingsPage General 一般 @@ -15935,7 +15785,7 @@ Flags: %3 - Cvs::Internal::CvsControl + Cvs &Edit 編集(&E) @@ -15944,9 +15794,6 @@ Flags: %3 CVS Checkout CVS チェックアウト - - - Cvs::Internal::CvsPlugin Cannot find repository for "%1". "%1" にリポジトリが見つかりません。 @@ -15967,14 +15814,6 @@ Flags: %3 Ignore Blank Lines 空行を無視 - - &Edit - 編集(&E) - - - CVS Checkout - CVS チェックアウト - Diff Current File 現在のファイルの差分表示 @@ -16235,20 +16074,6 @@ Flags: %3 The initial revision %1 cannot be described. 初期リビジョン %1 に説明はありません。 - - - Cvs::Internal::CvsDiffParameterWidget - - Ignore Whitespace - 空白を無視 - - - Ignore Blank Lines - 空行を無視 - - - - Cvs::Internal::CvsSubmitEditor Added 追加 @@ -16261,17 +16086,10 @@ Flags: %3 Modified 変更 - - - Cvs::Internal::SettingsPageWidget CVS Command CVS コマンド - - CVS - CVS - Debugger @@ -33495,15 +33313,7 @@ When a problem is detected, the application is interrupted and can be debugged.< - BookmarkWidget - - Delete Folder - フォルダを削除する - - - Rename Folder - フォルダ名の変更 - + Bookmarks Show Bookmark ブックマークを開く @@ -33520,13 +33330,6 @@ When a problem is detected, the application is interrupted and can be debugged.< Rename Bookmark ブックマークの名前変更 - - - BookmarkManager - - Bookmarks - ブックマーク - Remove 削除 @@ -33535,10 +33338,6 @@ When a problem is detected, the application is interrupted and can be debugged.< Deleting a folder also removes its content.<br>Do you want to continue? フォルダを削除すると中身も削除されます。<br>続行しますか? - - New Folder - 新しいフォルダ - Bookmark ブックマーク @@ -38791,7 +38590,7 @@ Only desktop kits are supported. Make sure the currently active kit is a desktop - BinEditor::BinEditorWidget + BinEditor Memory at 0x%1 0x%1 のメモリ @@ -38892,9 +38691,6 @@ Only desktop kits are supported. Make sure the currently active kit is a desktop Jump to Address 0x%1 in New Window 新規ウィンドウでアドレス 0x%1 に移動 - - - BinEditor::Internal::BinEditorDocument The Binary Editor cannot open empty files. バイナリエディタでは空のファイルを開けません。 @@ -38911,9 +38707,6 @@ Only desktop kits are supported. Make sure the currently active kit is a desktop Cannot open %1: %2 %1 を開けません: %2 - - - BinEditor::Internal::BinEditorPlugin &Undo 元に戻す(&U) @@ -40116,7 +39909,7 @@ Do you want to check them out now? - Cvs::Internal::CvsEditorWidget + Cvs Annotate revision "%1" リビジョン "%1" のアノテーション @@ -48088,11 +47881,7 @@ Android パッケージソースディレクトリのファイルはビルドデ - AutotoolsProjectManager::Internal::AutotoolsBuildConfiguration - - Autotools Manager - Autotools マネージャ - + AutotoolsProjectManager BuildConfiguration @@ -49026,118 +48815,18 @@ The name of the release build configuration created by default for a qmake proje - BinEditor::Internal::BinEditorWidget - - Memory at 0x%1 - 0x%1 のメモリ - - - Decimal&nbsp;unsigned&nbsp;value: - 符号無し10進数: - - - Decimal&nbsp;signed&nbsp;value: - 符号付き10進数: - - - Previous&nbsp;decimal&nbsp;unsigned&nbsp;value: - 直前の符号無し10進数: - - - Previous&nbsp;decimal&nbsp;signed&nbsp;value: - 直前の符号付き10進数: - - - %1-bit&nbsp;Integer&nbsp;Type - %1 ビット整数型 - - - Little Endian - リトルエンディアン - - - Big Endian - ビッグエンディアン - - - Binary&nbsp;value: - 2進数: - - - Octal&nbsp;value: - 8進数: - - - Previous&nbsp;binary&nbsp;value: - 直前の2進数: - - - Previous&nbsp;octal&nbsp;value: - 直前の8進数: - - - <i>double</i>&nbsp;value: - <i>倍精度浮動小数点</i>数: - - - Previous <i>double</i>&nbsp;value: - 直前の<i>倍精度浮動小数点</i>数: - - - <i>float</i>&nbsp;value: - <i>単精度浮動小数点</i>数: - - - Previous <i>float</i>&nbsp;value: - 直前の<i>単精度浮動小数点</i>数: - - - Copying Failed - コピー失敗 - - - You cannot copy more than 4 MB of binary data. - 4MB より大きなバイナリデータはコピーできません。 - - - Copy Selection as ASCII Characters - 選択内容を ASCII 文字列としてコピーする - - - Copy Selection as Hex Values - 選択内容を16進数の値としてコピーする - - - Set Data Breakpoint on Selection - 選択した箇所にデータブレークポイントを設定 - + BinEditor Copy 0x%1 0x%1をコピー - - Jump to Address in This Window - ウィンドウ内でアドレスに移動 - - - Jump to Address in New Window - 新規ウィンドウでアドレスに移動 - Copy Value 値をコピー - - Jump to Address 0x%1 in This Window - ウィンドウ内でアドレス 0x%1 に移動 - - - Jump to Address 0x%1 in New Window - 新規ウィンドウでアドレス 0x%1 に移動 - - BinEditorWidget::TextEditorWidget + BinEditor Zoom: %1% 拡大率: %1% diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index a61f64966f7..23080705b2f 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -317,7 +317,7 @@ - CodePaster::PasteSelectDialog + CodePaster Refresh Odśwież @@ -330,16 +330,13 @@ This protocol does not support listing Ten protokół nie obsługuje wyświetlania zawartości - - - CodePaster::SettingsPage General Ogólne - Cvs::Internal::SettingsPage + Cvs CVS CVS @@ -1378,7 +1375,7 @@ - BookmarkDialog + Bookmarks Add Bookmark Dodaj zakładkę @@ -1986,10 +1983,6 @@ Przyczyna: %3 Bookmarks - - Bookmarks - Zakładki - Move Up Przenieś do góry @@ -2770,7 +2763,7 @@ Kontynuować? - CodePaster::CodepasterPlugin + CodePaster &Code Pasting Wklejanie &kodu @@ -2933,7 +2926,7 @@ Kontynuować? - Cvs::Internal::CvsPlugin + Cvs &CVS &CVS @@ -3206,9 +3199,6 @@ Kontynuować? The initial revision %1 cannot be described. Początkowa wersja %1 nie może być opisana. - - - Cvs::Internal::CvsSubmitEditor Added Dodano @@ -3221,9 +3211,6 @@ Kontynuować? Modified Zmodyfikowano - - - Cvs::Internal::SettingsPageWidget CVS Command Komenda CVS @@ -9958,15 +9945,7 @@ Nie zostanie zastosowane do białych znaków w komentarzach i ciągach znakowych - BookmarkWidget - - Delete Folder - Usuń katalog - - - Rename Folder - Zmień nazwę katalogu - + Bookmarks Show Bookmark Pokaż zakładkę @@ -9983,13 +9962,6 @@ Nie zostanie zastosowane do białych znaków w komentarzach i ciągach znakowych Rename Bookmark Zmień nazwę zakładki - - - BookmarkManager - - Bookmarks - Zakładki - Remove Usuń @@ -9998,10 +9970,6 @@ Nie zostanie zastosowane do białych znaków w komentarzach i ciągach znakowych Deleting a folder also removes its content.<br>Do you want to continue? Usunięcie katalogu usuwa również jego zawartość.<br>Czy kontynuować? - - New Folder - Nowy katalog - Bookmark Zakładka @@ -11018,9 +10986,6 @@ Dla projektów CMake, upewnij się, że zmienna QML_IMPORT_PATH jest obecna w CM Code Pasting Wklejanie kodu - - - CodePaster::PasteView <Comment> <Komentarz> @@ -12345,7 +12310,7 @@ które można ustawić poniżej. - CodePaster::FileShareProtocol + CodePaster Cannot open %1: %2 Nie można otworzyć %1: %2 @@ -12366,16 +12331,10 @@ które można ustawić poniżej. Pasted: %1 Wklejono: %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Fileshare - - - CodePaster::Protocol %1 - Configuration Error %1 - Błąd konfiguracji @@ -13156,7 +13115,7 @@ Lista serwera: %2. - CodePaster::NetworkProtocol + CodePaster Checking connection Sprawdzanie połączenia @@ -19427,7 +19386,7 @@ Wykluczenia: %3 - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster Form Formularz @@ -19448,13 +19407,6 @@ Wykluczenia: %3 entries wpisów - - - CodePaster::Internal::PasteBinComSettingsWidget - - Form - Formularz - <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> pozwala wysyłać fragmenty kodu do własnych poddomen (np. creator.pastebin.com). Podaj przedrostek serwera. @@ -19467,9 +19419,6 @@ Wykluczenia: %3 <i>Note: The plugin will use this for posting as well as fetching.</i> <i>Uwaga: wtyczka użyje go zarówno do wysyłania jak i pobierania fragmentów kodu.</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: Protokół: @@ -19478,17 +19427,10 @@ Wykluczenia: %3 Paste: Wklej: - - - CodePaster::Internal::ViewDialog Send to Codepaster Wyślij do Codepaster - - Protocol: - Protokół: - &Username: Nazwa &użytkownika: @@ -19537,9 +19479,6 @@ p, li { white-space: pre-wrap; } Days Dni - - - CodePaster::Internal::SettingsPage Display Output pane after sending a post Pokazuj panel z komunikatami po wysłaniu kodu @@ -19556,14 +19495,6 @@ p, li { white-space: pre-wrap; } Default protocol: Domyślny protokół: - - &Expires after: - Okr&es ważności: - - - Days - Dni - CppTools::Internal::CppFileSettingsPage @@ -21249,15 +21180,12 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt. - AutotoolsProjectManager::Internal::AutogenStepFactory + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. Autogen - - - AutotoolsProjectManager::Internal::AutogenStep Autogen Autogen @@ -21266,9 +21194,6 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.Configuration unchanged, skipping autogen step. Konfiguracja niezmieniona, krok autogen pominięty. - - - AutotoolsProjectManager::Internal::AutogenStepConfigWidget Arguments: Argumenty: @@ -21278,17 +21203,11 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.AutotoolsProjectManager::AutogenStepConfigWidget display name. Autogen - - - AutotoolsProjectManager::Internal::AutoreconfStepFactory Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. Autoreconf - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Autoreconf @@ -21297,21 +21216,11 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.Configuration unchanged, skipping autoreconf step. Konfiguracja niezmieniona, krok autoreconf pominięty. - - - AutotoolsProjectManager::Internal::AutoreconfStepConfigWidget - - Arguments: - Argumenty: - Autoreconf AutotoolsProjectManager::AutoreconfStepConfigWidget display name. Autoreconf - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Default The name of the build configuration created by default for a autotools project. @@ -21321,9 +21230,6 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.Build Wersja - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget Build directory: Katalog wersji: @@ -21332,39 +21238,23 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.Autotools Manager Menedżer Autotools - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Kreator Autotools - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. Podaj katalog, w którym zbudować projekt. Zaleca się nie budować projektu w katalogu ze źródłami. Dzięki temu katalog ze źródłami pozostaje czysty i możliwe jest zbudowanie wielu wersji z różnymi ustawieniami, na podstawie tych samych źródeł. - - Build directory: - Katalog wersji: - Build Location Położenie wersji - - - AutotoolsProjectManager::Internal::ConfigureStepFactory Configure Display name for AutotoolsProjectManager::ConfigureStep id. Konfiguracja - - - AutotoolsProjectManager::Internal::ConfigureStep Configure Konfiguracja @@ -21373,21 +21263,11 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.Configuration unchanged, skipping configure step. Konfiguracja niezmieniona, krok konfiguracji pominięty. - - - AutotoolsProjectManager::Internal::ConfigureStepConfigWidget - - Arguments: - Argumenty: - Configure AutotoolsProjectManager::ConfigureStepConfigWidget display name. Konfiguracja - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 Parsowanie %1 w katalogu %2 @@ -21396,28 +21276,15 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.Parsing directory %1 Parsowanie katalogu %1 - - - AutotoolsProjectManager::Internal::MakeStepFactory Make Display name for AutotoolsProjectManager::MakeStep id. Make - - - AutotoolsProjectManager::Internal::MakeStep Make Make - - - AutotoolsProjectManager::Internal::MakeStepConfigWidget - - Arguments: - Argumenty: - Make AutotoolsProjectManager::MakeStepConfigWidget display name. @@ -25398,7 +25265,7 @@ Więcej informacji w dokumentacji "Checking Code Syntax". - Cvs::Internal::CvsControl + Cvs &Edit &Edycja @@ -30433,7 +30300,7 @@ Zainstaluj SDK o wersji %1 lub wyższej. - BinEditor::Internal::BinEditorDocument + BinEditor The Binary Editor cannot open empty files. Edytor plików binarnych nie może otwierać pustych plików. @@ -30450,9 +30317,6 @@ Zainstaluj SDK o wersji %1 lub wyższej. Cannot open %1: %2 Nie można otworzyć %1: %2 - - - BinEditor::Internal::BinEditorPlugin &Undo &Cofnij @@ -30986,7 +30850,7 @@ Do you want to check them out now? - Cvs::Internal::CvsEditorWidget + Cvs Annotate revision "%1" Dołącz adnotację do wersji "%1" @@ -39993,7 +39857,7 @@ Uwaga: podczas używania zwykłego formatu tekstowego może brakować niektóryc - BinEditor::Internal::BinEditorWidget + BinEditor Memory at 0x%1 Pamięć w 0x%1 @@ -41705,7 +41569,7 @@ Błąd: %2 - BinEditorWidget::TextEditorWidget + BinEditor Zoom: %1% Powiększenie:%1% @@ -41946,18 +41810,11 @@ Błąd: %2 - CodePaster::AuthenticationDialog - - Username: - Nazwa użytkownika: - + CodePaster Password: Hasło: - - - CodePaster::KdePasteProtocol Pasting to KDE paster needs authentication.<br/>Enter your KDE Identity credentials to continue. @@ -42012,7 +41869,7 @@ Błąd: %2 - Cvs::Internal::CvsDiffConfig + Cvs Ignore Whitespace Ignoruj białe znaki diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index b7f138be074..0e7fd60b4f9 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -3543,7 +3543,7 @@ Warning: this is an experimental feature and might lead to failing to execute th - AutotoolsProjectManager::Internal::AutogenStep + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. @@ -3561,9 +3561,6 @@ Warning: this is an experimental feature and might lead to failing to execute th Configuration unchanged, skipping autogen step. Конфигурация не изменилась, этап autogen пропускается. - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. @@ -3573,31 +3570,18 @@ Warning: this is an experimental feature and might lead to failing to execute th Autoreconf Autoreconf - - Arguments: - Параметры: - Configuration unchanged, skipping autoreconf step. Конфигурация не изменилась, этап autoreconf пропускается. - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfiguration Autotools Manager Управление Autotools - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Мастер Autotools - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. It is not recommended to use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. Укажите каталог, в котором желаете собирать проект. Рекомендуется не использовать каталог с исходниками для сборки. Это позволит поддерживать каталог с исходниками в чистоте, а также даст возможность делать несколько сборок с различными настройками. @@ -3610,9 +3594,6 @@ Warning: this is an experimental feature and might lead to failing to execute th Build Location Каталог сборки - - - AutotoolsProjectManager::Internal::ConfigureStep Configure Display name for AutotoolsProjectManager::ConfigureStep id. @@ -3622,17 +3603,10 @@ Warning: this is an experimental feature and might lead to failing to execute th Configure Configure - - Arguments: - Параметры: - Configuration unchanged, skipping configure step. Конфигурация не изменилась, этап configure пропускается. - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 Обрабатывается %1 в каталоге %2 @@ -5455,7 +5429,7 @@ For example, "Revision: 15" will leave the branch at revision 15. - BinEditor::Internal::BinEditorDocument + BinEditor The Binary Editor cannot open empty files. Двоичный редактор не может открывать пустые файлы. @@ -5472,9 +5446,6 @@ For example, "Revision: 15" will leave the branch at revision 15.Cannot open %1: %2 Не удалось открыть %1: %2 - - - BinEditor::Internal::BinEditorPlugin &Undo &Отменить @@ -5483,9 +5454,6 @@ For example, "Revision: 15" will leave the branch at revision 15.&Redo &Повторить - - - BinEditor::Internal::BinEditorWidget Memory at 0x%1 Память с 0x%1 @@ -5596,14 +5564,14 @@ For example, "Revision: 15" will leave the branch at revision 15. - BinEditorWidget::TextEditorWidget + BinEditor Zoom: %1% Масштаб: %1% - BookmarkDialog + Bookmarks Add Bookmark Добавить закладку @@ -5636,13 +5604,6 @@ For example, "Revision: 15" will leave the branch at revision 15.Add in folder: Добавить в папку: - - - BookmarkManager - - Bookmarks - Закладки - Remove Удалить @@ -5651,25 +5612,10 @@ For example, "Revision: 15" will leave the branch at revision 15.Deleting a folder also removes its content.<br>Do you want to continue? Удаление папки приведёт к удалению её содержимого.<br>Желаете продолжить? - - New Folder - Новая папка - Bookmark Закладка - - - BookmarkWidget - - Delete Folder - Удалить папку - - - Rename Folder - Переименовать папку - Show Bookmark Показать закладку @@ -5686,13 +5632,6 @@ For example, "Revision: 15" will leave the branch at revision 15.Rename Bookmark Переименовать закладку - - - Bookmarks - - Bookmarks - Закладки - Edit Bookmark Изменение закладки @@ -8412,9 +8351,6 @@ Set a valid executable first. Code Pasting Вставка кода - - - CodePaster::CodepasterPlugin &Code Pasting Вставка &Кода @@ -8459,16 +8395,10 @@ Set a valid executable first. Empty snippet received for "%1". Для «%1» получен пустой фрагмент. - - - CodePaster::DPasteDotComProtocol %1: %2 %1: %2 - - - CodePaster::FileShareProtocol Cannot open %1: %2 Не удалось открыть %1: %2 @@ -8489,16 +8419,10 @@ Set a valid executable first. Pasted: %1 Вставлен: %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Общие файлы - - - CodePaster::Internal::FileShareProtocolSettingsWidget The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. Протокол на базе общих файлов позволяет публиковать фрагменты кода используя обычные файлы на общем сетевом диске. Файлы никогда не удаляются. @@ -8515,9 +8439,6 @@ Set a valid executable first. entries записей - - - CodePaster::Internal::PasteBinComSettingsWidget <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> позволяет отправлять данные на пользовательские субдомены (например, creator.pastebin.com). Поэтому укажите желаемый префикс. @@ -8530,9 +8451,6 @@ Set a valid executable first. <i>Note: The plugin will use this for posting as well as fetching.</i> <i>Модуль будет использовать префикс, как для отправки, так и для получения.</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: Протокол: @@ -8541,9 +8459,6 @@ Set a valid executable first. Paste: Вставить: - - - CodePaster::Internal::SettingsPage Display Output pane after sending a post Отправив данные, показать окно вывода @@ -8572,17 +8487,10 @@ Set a valid executable first. Make pasted content public by default По умолчанию публиковать вставляемую информацию - - - CodePaster::Internal::ViewDialog Send to Codepaster Отправить в Codepaster - - Protocol: - Протокол: - &Username: &Пользователь: @@ -8621,21 +8529,10 @@ p, li { white-space: pre-wrap; } Patch 2 - - &Expires after: - &Истекает через: - - - Days - дней - Make public: Публиковать: - - - CodePaster::NetworkProtocol Checking connection Проверка соединения @@ -8644,9 +8541,6 @@ p, li { white-space: pre-wrap; } Connecting to %1... Подключение к %1... - - - CodePaster::PasteSelectDialog Refresh Обновить @@ -8659,9 +8553,6 @@ p, li { white-space: pre-wrap; } This protocol does not support listing Данный протокол не поддерживает получение списка - - - CodePaster::PasteView Paste Вставить @@ -8670,16 +8561,10 @@ p, li { white-space: pre-wrap; } <Comment> <Комментарий> - - - CodePaster::Protocol %1 - Configuration Error %1 - ошибка конфигурации - - - CodePaster::SettingsPage General Основное @@ -13882,14 +13767,11 @@ Do you want to display them anyway? - Cvs::Internal::CvsEditorWidget + Cvs Annotate revision "%1" Аннотация ревизии «%1» - - - Cvs::Internal::CvsPlugin &CVS &CVS @@ -14150,9 +14032,6 @@ Do you want to display them anyway? The initial revision %1 cannot be described. Невозможно описать начальную ревизию %1. - - - Cvs::Internal::CvsSubmitEditor Added Добавлен @@ -14165,9 +14044,6 @@ Do you want to display them anyway? Modified Изменён - - - Cvs::Internal::SettingsPage Configuration Настройка @@ -14208,9 +14084,6 @@ Do you want to display them anyway? When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit ID). Otherwise, only the respective file will be displayed. Если включено, по щелчку на номере ревизии при просмотре аннотации (полученной по идентификатору фиксации) будут отображаться все зафиксированные файлы. В противном случае, только соответствующий файл. - - - Cvs::Internal::SettingsPageWidget CVS Command Команда CVS @@ -52313,7 +52186,7 @@ What do you want to do? - WebAssembly::Internal::EmrunRunConfigurationFactory + WebAssembly Effective emrun call: Команда запуска emrun: @@ -52322,9 +52195,6 @@ What do you want to do? Launch with emrun Запустить через emrun - - - WebAssembly::Internal::WebAssemblyDevice Web Browser Браузер @@ -52333,9 +52203,6 @@ What do you want to do? WebAssembly Runtime Среда WebAssembly - - - WebAssembly::Internal::WebAssemblyToolChain Emscripten Compiler Компилятор Emscripten @@ -52344,9 +52211,6 @@ What do you want to do? WebAssembly WebAssembly - - - WebAssembly::Internal::WebBrowserSelectionAspect Web browser Браузер @@ -52355,9 +52219,6 @@ What do you want to do? Web browser: Браузер: - - - WebAssemblyPlugin WebAssembly Qt Version is meant for WebAssembly diff --git a/share/qtcreator/translations/qtcreator_sl.ts b/share/qtcreator/translations/qtcreator_sl.ts index e36ea3677b6..da207332c60 100644 --- a/share/qtcreator/translations/qtcreator_sl.ts +++ b/share/qtcreator/translations/qtcreator_sl.ts @@ -109,7 +109,7 @@ - BookmarkDialog + Bookmarks Add Bookmark Dodaj zaznamek @@ -149,13 +149,6 @@ Add in Folder: Dodaj v mapo: - - - BookmarkManager - - Bookmarks - Zaznamki - Remove Odstrani @@ -164,25 +157,10 @@ Deleting a folder also removes its content.<br>Do you want to continue? Izbris mape odstrani tudi njeno vsebino.<br>Ali želite nadaljevati? - - New Folder - Nova mapa - You are going to delete a Folder which will also<br>remove its content. Are you sure you would like to continue? Nameravate izbrisati mapo, pri čemer bo zbrisana<br>tudi njena vsebina. Ali res želite nadaljevati? - - - BookmarkWidget - - Delete Folder - Izbriši mapo - - - Rename Folder - Preimenuj mapo - Show Bookmark Prikaži zaznamek @@ -203,17 +181,6 @@ Add Dodaj - - Remove - Odstrani - - - - Bookmarks - - Bookmarks - Zaznamki - Move Up Premakni gor @@ -500,7 +467,7 @@ - CodePaster::CodepasterPlugin + CodePaster &Code Pasting &Lepljenje kode @@ -529,9 +496,6 @@ Empty snippet received for "%1". Za »%1« je bil prejet prazen izrezek. - - - CodePaster::PasteSelectDialog Paste: Prilepi: @@ -553,9 +517,6 @@ This protocol does not support listing Protokol ne podpira izpisa seznama - - - CodePaster::SettingsPage Username: Uporabniško ime: @@ -11021,7 +10982,7 @@ p, li { white-space: pre-wrap; } - Cvs::Internal::SettingsPage + Cvs CVS CVS @@ -12286,7 +12247,7 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan - CodePaster::CodePasterProtocol + CodePaster No Server defined in the CodePaster preferences. V nastavitvah za CodePaster ni določenega nobenega strežnika. @@ -12299,9 +12260,6 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan No such paste Tak prilepek ne obstaja - - - CodePaster::CodePasterSettingsPage CodePaster CodePaster @@ -12383,7 +12341,7 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan - Cvs::Internal::CheckoutWizard + Cvs Checks out a CVS repository and tries to load the contained project. Prevzame skladišče CVS in poskusi naložiti vsebovani projekt. @@ -12392,9 +12350,6 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan CVS Checkout Prevzem iz CVS - - - Cvs::Internal::CheckoutWizardPage Location Mesto @@ -12407,9 +12362,6 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan Repository: Skladišče: - - - Cvs::Internal::CvsPlugin Parsing of the log output failed Razčlenjevanje dnevnika ni uspelo. @@ -12698,9 +12650,6 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan CVS did not respond within timeout limit (%1 ms). CVS se v za to namenjenem času (%1 ms) ni odzval. - - - Cvs::Internal::CvsSubmitEditor Added Dodana @@ -12713,9 +12662,6 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan Modified Spremenjena - - - Cvs::Internal::SettingsPageWidget CVS Command Ukaz CVS @@ -13650,7 +13596,7 @@ Razlog: %2 - CodePaster::FileShareProtocolSettingsWidget + CodePaster Form Obrazec @@ -15686,9 +15632,6 @@ Desetiška predznačena vrednost (najprej veliki konec): %4 Code Pasting Prilepljanje kode - - - CodePaster::FileShareProtocol Cannot open %1: %2 Ni moč odpreti %1: %2 @@ -15713,23 +15656,14 @@ Desetiška predznačena vrednost (najprej veliki konec): %4 Unable to open a file for writing in %1: %2 Datoteke ni moč odpreti za pisanje v %1: %2 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Fileshare - - - CodePaster::PasteBinDotComSettings Pastebin.com Pastebin.com - - - CodePaster::PasteView <Comment> <komentar> @@ -15738,9 +15672,6 @@ Desetiška predznačena vrednost (najprej veliki konec): %4 Paste Prilepi - - - CodePaster::Protocol %1 - Configuration Error %1 - Napaka pri nastavitvi @@ -15964,7 +15895,7 @@ Desetiška predznačena vrednost (najprej veliki konec): %4 - Cvs::Internal::CvsEditor + Cvs Annotate revision "%1" Dodaj opombo za revizijo »%1« @@ -23090,16 +23021,13 @@ Vedite: to lahko odstrani krajevno datoteko. - CodePaster::PasteBinDotComProtocol + CodePaster <Unknown> Unknown user of paste. <neznano> - - - CodePaster::NetworkProtocol Checking connection Preverjanje povezave @@ -23242,7 +23170,7 @@ Vedite: to lahko odstrani krajevno datoteko. - Cvs::Internal::CvsDiffParameterWidget + Cvs Ignore whitespace Prezri presledke diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index fdcd6b6d282..d1eac66034b 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -806,7 +806,7 @@ Local pulls are not applied to the master branch. - BookmarkDialog + Bookmarks Add Bookmark Додати закладку @@ -839,13 +839,6 @@ Local pulls are not applied to the master branch. Add in folder: Додати в теку: - - - BookmarkManager - - Bookmarks - Закладки - Remove Видалити @@ -854,21 +847,6 @@ Local pulls are not applied to the master branch. Deleting a folder also removes its content.<br>Do you want to continue? Видалення теки призводить до видалення її вмісту.<br>Бажаєте продовжити? - - New Folder - Нова тека - - - - BookmarkWidget - - Delete Folder - Видалити теку - - - Rename Folder - Перейменувати теку - Show Bookmark Показати закладку @@ -889,17 +867,6 @@ Local pulls are not applied to the master branch. Add Додати - - Remove - Видалити - - - - Bookmarks - - Bookmarks - Закладки - Move Up Пересунути вгору @@ -1347,9 +1314,6 @@ Local pulls are not applied to the master branch. Code Pasting Вставка коду - - - CodePaster::CodePasterProtocol No Server defined in the CodePaster preferences. Не вказано сервер в налаштуваннях CodePaster. @@ -1362,9 +1326,6 @@ Local pulls are not applied to the master branch. No such paste Немає такої вставки - - - CodePaster::CodePasterSettingsPage CodePaster CodePaster @@ -1377,9 +1338,6 @@ Local pulls are not applied to the master branch. <i>Note: Specify the host name for the CodePaster service without any protocol prepended (e.g. codepaster.mycompany.com).</i> <i>Примітка: Задайте назву вузла сервісу, не вказуючи протокол (наприклад. codepaster.mycompany.com).</i> - - - CodePaster::CodepasterPlugin &Code Pasting Вставка &коду @@ -1428,9 +1386,6 @@ Local pulls are not applied to the master branch. Empty snippet received for "%1". Отримано порожній фрагмент для "%1". - - - CodePaster::FileShareProtocol Cannot open %1: %2 Неможливо відкрити %1: %2 @@ -1451,16 +1406,10 @@ Local pulls are not applied to the master branch. Pasted: %1 Вставлено: %1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare Fileshare - - - CodePaster::NetworkProtocol Checking connection Перевірка підключення @@ -1469,9 +1418,6 @@ Local pulls are not applied to the master branch. Connecting to %1... Підключення до %1... - - - CodePaster::PasteSelectDialog Refresh Оновити @@ -1484,9 +1430,6 @@ Local pulls are not applied to the master branch. This protocol does not support listing Цей протокол не підтримує отримання списку - - - CodePaster::PasteView <Comment> <Коментар> @@ -1495,9 +1438,6 @@ Local pulls are not applied to the master branch. Paste Вставити - - - CodePaster::Protocol %1 - Configuration Error %1 - помилка конфігурації @@ -1506,9 +1446,6 @@ Local pulls are not applied to the master branch. Settings... Налаштування... - - - CodePaster::SettingsPage General Загальне @@ -24762,7 +24699,7 @@ With cache simulation, further event counters are enabled: - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster Form Форма @@ -24783,13 +24720,6 @@ With cache simulation, further event counters are enabled: entries елементів - - - CodePaster::Internal::PasteBinComSettingsWidget - - Form - Форма - <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> дозволяє надсилати дані до піддоменів користувача (наприклад. creator.pastebin.com). Вкажіть бажаний префікс. @@ -24802,9 +24732,6 @@ With cache simulation, further event counters are enabled: <i>Note: The plugin will use this for posting as well as fetching.</i> <i>Примітка: Додаток буде використовувати цей префікс і для отримання даних.</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: Протокол: @@ -24813,17 +24740,10 @@ With cache simulation, further event counters are enabled: Paste: Вставка: - - - CodePaster::Internal::ViewDialog Send to Codepaster Надіслати до Codepaster - - Protocol: - Протокол: - &Username: &Ім'я користувача: @@ -24876,9 +24796,6 @@ p, li { white-space: pre-wrap; } Days днів - - - CodePaster::Internal::SettingsPage Display Output pane after sending a post Показати панель виведення після надсилання @@ -24895,18 +24812,6 @@ p, li { white-space: pre-wrap; } Default protocol: Типовий протокол: - - &Expires after: - &Застаріє через: - - - Days - днів - - - Days - днів - CppTools::Internal::CppFileSettingsPage @@ -25008,7 +24913,7 @@ These prefixes are used in addition to current file name on Switch Header/Source - Cvs::Internal::SettingsPage + Cvs Configuration Конфігурація @@ -26355,19 +26260,12 @@ should a repository require SSH-authentication (see documentation on SSH and the - AutotoolsProjectManager::Internal::AutogenStepFactory + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. Autogen - - Autogen - Autogen - - - - AutotoolsProjectManager::Internal::AutogenStep Autogen Autogen @@ -26376,9 +26274,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration unchanged, skipping autogen step. Конфігурація не змінилась, пропускаємо крок autogen. - - - AutotoolsProjectManager::Internal::AutogenStepConfigWidget Arguments: Аргументи: @@ -26388,25 +26283,11 @@ should a repository require SSH-authentication (see documentation on SSH and the AutotoolsProjectManager::AutogenStepConfigWidget display name. Autogen - - Autogen - Autogen - - - - AutotoolsProjectManager::Internal::AutoreconfStepFactory Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. Autoreconf - - Autoreconf - Autoreconf - - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Autoreconf @@ -26415,25 +26296,11 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration unchanged, skipping autoreconf step. Конфігурація не змінилась, пропускаємо крок autoreconf. - - - AutotoolsProjectManager::Internal::AutoreconfStepConfigWidget - - Arguments: - Аргументи: - Autoreconf AutotoolsProjectManager::AutoreconfStepConfigWidget display name. Autoreconf - - Autoreconf - Autoreconf - - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Default The name of the build configuration created by default for a autotools project. @@ -26451,9 +26318,6 @@ should a repository require SSH-authentication (see documentation on SSH and the New configuration name: Назва нової конфігурації: - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget Build directory: Тека збірки: @@ -26462,9 +26326,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Autotools Manager Управління Autotools - - - AutotoolsProjectManager::Internal::AutotoolsManager Failed opening project '%1': Project is not a file Збій відкриття проекту '%1': Проект не є файлом @@ -26473,43 +26334,23 @@ should a repository require SSH-authentication (see documentation on SSH and the Failed opening project "%1": Project is not a file Збій відкриття проекту "%1": Проект не є файлом - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Майстер Autotools - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. Будь ласка, введіть теку, в якій ви хочете зібрати ваш проект. Qt Creator рекомендує не використовувати теку з кодом для збірки. Це гарантуватиме, що тека з кодом лишатиметься чистою, та дозволить здійснювати декілька збірок з різними налаштуваннями. - - Build directory: - Тека збірки: - Build Location Розташування збірки - - - AutotoolsProjectManager::Internal::ConfigureStepFactory Configure Display name for AutotoolsProjectManager::ConfigureStep id. Configure - - Configure - Configure - - - - AutotoolsProjectManager::Internal::ConfigureStep Configure Configure @@ -26518,25 +26359,11 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration unchanged, skipping configure step. Конфігурація не змінилась, пропускаємо крок configure. - - - AutotoolsProjectManager::Internal::ConfigureStepConfigWidget - - Arguments: - Аргументи: - Configure AutotoolsProjectManager::ConfigureStepConfigWidget display name. Configure - - Configure - Configure - - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 Розбір %1 в теці %2 @@ -26545,21 +26372,11 @@ should a repository require SSH-authentication (see documentation on SSH and the Parsing directory %1 Розбір теки %1 - - - AutotoolsProjectManager::Internal::MakeStepFactory Make Display name for AutotoolsProjectManager::MakeStep id. Make - - Make - Make - - - - AutotoolsProjectManager::Internal::MakeStep Make Make @@ -26572,22 +26389,11 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration is faulty. Check the Issues view for details. Конфігурація збійна. Перевірте вид "Проблеми" для деталей. - - - AutotoolsProjectManager::Internal::MakeStepConfigWidget - - Arguments: - Аргументи: - Make AutotoolsProjectManager::MakeStepConfigWidget display name. Make - - Make - Make - BinEditorDocument @@ -26697,7 +26503,7 @@ should a repository require SSH-authentication (see documentation on SSH and the - Cvs::Internal::CheckoutWizardPage + Cvs Location Розташування @@ -26710,9 +26516,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Repository: Сховище: - - - Cvs::Internal::CvsPlugin Cannot find repository for '%1' Неможливо знайти сховище для '%1' @@ -27001,9 +26804,6 @@ should a repository require SSH-authentication (see documentation on SSH and the No cvs executable specified! Виконуваний модуль cvs не вказано! - - - Cvs::Internal::CvsDiffParameterWidget Ignore whitespace Ігнорувати пропуски @@ -27020,9 +26820,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Ignore Blank Lines Ігнорувати порожні рядки - - - Cvs::Internal::CvsSubmitEditor Added Додано @@ -27035,9 +26832,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Modified Змінено - - - Cvs::Internal::SettingsPageWidget CVS Command Команда CVS @@ -36186,7 +35980,7 @@ Partial names can be used if they are unambiguous. - Cvs::Internal::CvsControl + Cvs &Edit &Редагувати @@ -44036,7 +43830,7 @@ Deploying local Qt libraries is incompatible with Android 5. - BinEditor::BinEditorWidget + BinEditor Memory at 0x%1 Пам'ять в 0x%1 @@ -44137,9 +43931,6 @@ Deploying local Qt libraries is incompatible with Android 5. Jump to Address 0x%1 in New Window Перейти до адреси 0x%1 в новому вікні - - - BinEditor::Internal::BinEditorDocument The Binary Editor cannot open empty files. Двійковий редактор не може відкривати порожні файли. @@ -44156,9 +43947,6 @@ Deploying local Qt libraries is incompatible with Android 5. Cannot open %1: %2 Неможливо відкрити %1: %2 - - - BinEditor::Internal::BinEditorPlugin &Undo &Повернути @@ -44700,7 +44488,7 @@ The statements may not contain '{' nor '}' characters. - Cvs::Internal::CvsEditorWidget + Cvs Annotate revision "%1" diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 7e32dfa3128..9c5aea526b5 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -114,7 +114,7 @@ - BookmarkDialog + Bookmarks Add Bookmark 添加书签 @@ -151,13 +151,6 @@ Add in folder: 添加到文件夹: - - - BookmarkManager - - Bookmarks - 书签 - Remove 删除 @@ -166,21 +159,6 @@ Deleting a folder also removes its content.<br>Do you want to continue? 删除文件夹会同时删除文件夹下的文件。<br>您确定继续吗? - - New Folder - 新文件夹 - - - - BookmarkWidget - - Delete Folder - 删除文件夹 - - - Rename Folder - 重命名文件夹 - Show Bookmark 显示书签 @@ -205,17 +183,6 @@ Add 添加 - - Remove - 删除 - - - - Bookmarks - - Bookmarks - 书签 - Move Up 向上移动 @@ -655,7 +622,7 @@ - CodePaster::CodepasterPlugin + CodePaster &Code Pasting 粘贴代码(&C) @@ -704,25 +671,6 @@ Empty snippet received for "%1". "%1"接收到空的片段。 - - This protocol supports no listing - 此协议不支持listing - - - Waiting for items - 等待数据项 - - - - CodePaster::PasteSelectDialog - - Paste: - 粘贴: - - - Protocol: - 协议: - Refresh 刷新 @@ -735,13 +683,6 @@ This protocol does not support listing 此协议不支持列表 - - - CodePaster::SettingsPage - - Username: - 用户名: - Copy Paste URL to clipboard 复制URL到剪贴板 @@ -754,30 +695,6 @@ General 概要 - - CodePaster - CodePaster - - - Default Protocol: - 默认协议: - - - Code Pasting - 代码粘贴 - - - Default protocol: - 默认协议: - - - Display Output pane after sending a post - 发送后显示输出对话框 - - - Copy-paste URL to clipboard - 复制/粘帖URL到剪贴板 - CompletionSettingsPage @@ -16526,7 +16443,7 @@ Will not be applied to whitespace in comments and strings. - Cvs::Internal::SettingsPage + Cvs CVS Command: CVS 命令: @@ -17662,7 +17579,7 @@ Will not be applied to whitespace in comments and strings. - CodePaster::CodePasterProtocol + CodePaster No Server defined in the CodePaster preferences. 在CodePaster首选项中没有定义服务器。 @@ -17675,9 +17592,6 @@ Will not be applied to whitespace in comments and strings. No such paste 没有相关粘贴 - - - CodePaster::CodePasterSettingsPage CodePaster CodePaster @@ -17686,10 +17600,6 @@ Will not be applied to whitespace in comments and strings. <i>Note: Specify the host name for the CodePaster service without any protocol prepended (e.g. codepaster.mycompany.com).</i> <i>注意: 为CodePaster服务指定主机名,不包括任何协议前缀。(如 codepaster.mycompany.com).</i> - - Code Pasting - 代码粘贴 - Server: 服务器: @@ -17806,7 +17716,7 @@ Will not be applied to whitespace in comments and strings. - Cvs::Internal::CheckoutWizard + Cvs Checks out a project from a CVS repository. 从CVS仓库中检出项目。 @@ -17819,9 +17729,6 @@ Will not be applied to whitespace in comments and strings. CVS Checkout CVS Checkout - - - Cvs::Internal::CheckoutWizardPage Location 位置 @@ -17834,16 +17741,6 @@ Will not be applied to whitespace in comments and strings. Repository: 代码仓库: - - - CvsPlugin - - Cannot find repository for '%1' - 无法为'%1'找到仓库 - - - - Cvs::Internal::CvsPlugin Parsing of the log output failed 解析日志输出失败 @@ -18165,9 +18062,6 @@ Will not be applied to whitespace in comments and strings. CVS did not respond within timeout limit (%1 ms). CVS 在超时时间 (%1 毫秒)内无响应。 - - - Cvs::Internal::CvsSubmitEditor Added 已添加 @@ -18180,9 +18074,6 @@ Will not be applied to whitespace in comments and strings. Modified 已更改 - - - Cvs::Internal::SettingsPageWidget CVS Command CVS 命令 @@ -22314,14 +22205,11 @@ Previous decimal signed value (big endian): %4 - CodePaster::PasteBinDotComSettings + CodePaster Pastebin.com Pastebin.com - - - CodePaster::PasteView <Comment> <注释> @@ -22490,7 +22378,7 @@ Previous decimal signed value (big endian): %4 - Cvs::Internal::CvsEditor + Cvs Annotate revision "%1" 注释修订版本 "%1" @@ -25545,30 +25433,6 @@ Preselects Qt for Simulator and mobile targets if available 关于Bauhaus - - CodePaster::FileShareProtocolSettingsWidget - - Form - 界面 - - - &Path: - 路径(&P): - - - &Display: - 显示(&D): - - - entries - - - - The fileshare-based paster protocol allows for sharing code snippets using simple files on a shared network drive. Files are never deleted. - 文件共享剪贴板允许在共享的驱动器上共享代码片段. -文件永远不会被删除. - - StartExternalQmlDialog @@ -25809,7 +25673,7 @@ with a password, which you can enter below. - CodePaster::FileShareProtocol + CodePaster Cannot open %1: %2 无法打开%1 : %2 @@ -25834,16 +25698,10 @@ with a password, which you can enter below. Pasted: %1 粘贴了 "%1" - - - CodePaster::FileShareProtocolSettingsPage Fileshare 文件共享 - - - CodePaster::Protocol %1 - Configuration Error %1 - 配置错误 @@ -27891,7 +27749,7 @@ Server list was %2. - CodePaster::NetworkProtocol + CodePaster Checking connection 正在检查连接 @@ -36100,7 +35958,7 @@ Would you like to overwrite them? - Cvs::Internal::CvsDiffParameterWidget + Cvs Ignore whitespace 忽略空白 @@ -38796,7 +38654,7 @@ stderr was: %1 - CodePaster::PasteBinDotComProtocol + CodePaster <Unknown> Unknown user of paste. @@ -41757,7 +41615,7 @@ This option is useful when you want to try your application on devices which don - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster Form 界面 @@ -41778,13 +41636,6 @@ This option is useful when you want to try your application on devices which don entries - - - CodePaster::Internal::PasteBinComSettingsWidget - - Form - 界面 - <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> 允许发送主题到自定义子域名,(比如. creator.pastebin.com),请输入您希望的前缀。 @@ -41797,9 +41648,6 @@ This option is useful when you want to try your application on devices which don <i>Note: The plugin will use this for posting as well as fetching.</i> <i>注意: 插件将会使用它来获取和发布。</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: 协议: @@ -41808,17 +41656,10 @@ This option is useful when you want to try your application on devices which don Paste: 粘贴: - - - CodePaster::Internal::ViewDialog Send to Codepaster 发送到CodePaster - - Protocol: - 协议: - &Username: 用户名(&U): @@ -41859,9 +41700,6 @@ p, li { white-space: pre-wrap; } Patch 2 Patch 2 - - - CodePaster::Internal::SettingsPage Display Output pane after sending a post 发送后显示输出对话框 @@ -44552,15 +44390,12 @@ Please choose a valid package name for your application (e.g. "org.example. - AutotoolsProjectManager::Internal::AutogenStepFactory + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. Autogen - - - AutotoolsProjectManager::Internal::AutogenStep Autogen Autogen @@ -44569,9 +44404,6 @@ Please choose a valid package name for your application (e.g. "org.example. Configuration unchanged, skipping autogen step. 配置未改变,跳过autogen步骤。 - - - AutotoolsProjectManager::Internal::AutogenStepConfigWidget Arguments: 参数: @@ -44581,17 +44413,11 @@ Please choose a valid package name for your application (e.g. "org.example. AutotoolsProjectManager::AutogenStepConfigWidget display name. Autogen - - - AutotoolsProjectManager::Internal::AutoreconfStepFactory Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. Autoreconf - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Autoreconf @@ -44600,21 +44426,11 @@ Please choose a valid package name for your application (e.g. "org.example. Configuration unchanged, skipping autoreconf step. 配置未改变,跳过autoreconf步骤。 - - - AutotoolsProjectManager::Internal::AutoreconfStepConfigWidget - - Arguments: - 参数: - Autoreconf AutotoolsProjectManager::AutoreconfStepConfigWidget display name. Autoreconf - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Build 构建 @@ -44627,16 +44443,10 @@ Please choose a valid package name for your application (e.g. "org.example. New configuration name: 新配置名称: - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget Build directory: 构建目录: - - - AutotoolsProjectManager::Internal::AutotoolsManager Failed opening project '%1': Project file does not exist 打开项目 '%1'失败: 项目文件不存在 @@ -44645,39 +44455,23 @@ Please choose a valid package name for your application (e.g. "org.example. Failed opening project '%1': Project already open 打开项目 '%1'失败:项目已经被打开 - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Autotool向导 - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. 请进入您想构建项目的目录。Qt Creator 建议不要使用源目录构建。这能确保源目录干净,并且可以针对不同设定多次构建。 - - Build directory: - 构建目录: - Build Location 构建路径 - - - AutotoolsProjectManager::Internal::ConfigureStepFactory Configure Display name for AutotoolsProjectManager::ConfigureStep id. 配置 - - - AutotoolsProjectManager::Internal::ConfigureStep Configure 配置 @@ -44686,21 +44480,11 @@ Please choose a valid package name for your application (e.g. "org.example. Configuration unchanged, skipping configure step. 配置未改变,跳过configure步骤。 - - - AutotoolsProjectManager::Internal::ConfigureStepConfigWidget - - Arguments: - 参数: - Configure AutotoolsProjectManager::ConfigureStepConfigWidget display name. 配置 - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 正在目录 %2中分析 %1 @@ -44709,17 +44493,11 @@ Please choose a valid package name for your application (e.g. "org.example. Parsing directory %1 正在分析目录 %1 - - - AutotoolsProjectManager::Internal::MakeStepFactory Make Display name for AutotoolsProjectManager::MakeStep id. Make - - - AutotoolsProjectManager::Internal::MakeStep Make Make @@ -44732,13 +44510,6 @@ Please choose a valid package name for your application (e.g. "org.example. Configuration is faulty. Check the Issues view for details. 配置错误,请检查"问题"视图获得详细信息。 - - - AutotoolsProjectManager::Internal::MakeStepConfigWidget - - Arguments: - 参数: - Make AutotoolsProjectManager::MakeStepConfigWidget display name. diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index 5f51f6b37fd..0cff87067cb 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -32,7 +32,7 @@ - BookmarkDialog + Bookmarks Add Bookmark 新增書籤 @@ -65,13 +65,6 @@ Add in folder: 新增到資料夾: - - - BookmarkManager - - Bookmarks - 書籤 - Remove 移除 @@ -80,21 +73,6 @@ Deleting a folder also removes its content.<br>Do you want to continue? 刪除資料夾會同時移除它的內容。<br>您確定要繼續嗎? - - New Folder - 新資料夾 - - - - BookmarkWidget - - Delete Folder - 刪除資料夾 - - - Rename Folder - 重新命名資料夾 - Show Bookmark 顯示書籤 @@ -115,17 +93,6 @@ Add 新增 - - Remove - 移除 - - - - Bookmarks - - Bookmarks - 書籤 - Move Up 向上移動 @@ -379,7 +346,7 @@ - CodePaster::CodepasterPlugin + CodePaster &Code Pasting 貼上代碼(&C) @@ -428,9 +395,6 @@ Empty snippet received for "%1". 接收到 "%1" 的空片段。 - - - CodePaster::PasteSelectDialog Refresh 刷新 @@ -443,9 +407,6 @@ This protocol does not support listing 此協定不支援列表 - - - CodePaster::SettingsPage General 一般 @@ -10221,7 +10182,7 @@ Will not be applied to whitespace in comments and strings. - Cvs::Internal::SettingsPage + Cvs CVS CVS @@ -10742,7 +10703,7 @@ Will not be applied to whitespace in comments and strings. - CodePaster::CodePasterProtocol + CodePaster No Server defined in the CodePaster preferences. 在 CodePaster 喜好設定中沒有定義伺服器。 @@ -10755,9 +10716,6 @@ Will not be applied to whitespace in comments and strings. No such paste 沒有相關貼上內容 - - - CodePaster::CodePasterSettingsPage CodePaster CodePaster @@ -10821,7 +10779,7 @@ Will not be applied to whitespace in comments and strings. - Cvs::Internal::CheckoutWizard + Cvs Checks out a CVS repository and tries to load the contained project. 從 CVS 主目錄中取出,並試著載入裡面包含的專案。 @@ -10830,9 +10788,6 @@ Will not be applied to whitespace in comments and strings. CVS Checkout CVS 取出 - - - Cvs::Internal::CheckoutWizardPage Location 位置 @@ -10845,9 +10800,6 @@ Will not be applied to whitespace in comments and strings. Repository: 主目錄: - - - Cvs::Internal::CvsPlugin Parsing of the log output failed 剖析紀錄輸出失敗 @@ -11108,9 +11060,6 @@ Will not be applied to whitespace in comments and strings. No cvs executable specified! 未指定 cvs 的執行檔! - - - Cvs::Internal::CvsSubmitEditor Added 已新增 @@ -11123,9 +11072,6 @@ Will not be applied to whitespace in comments and strings. Modified 已變更 - - - Cvs::Internal::SettingsPageWidget CVS Command CVS 指令 @@ -13079,7 +13025,7 @@ For qmlproject projects, use the importPaths property to add import paths. - CodePaster::PasteView + CodePaster <Comment> <註解> @@ -13240,7 +13186,7 @@ For qmlproject projects, use the importPaths property to add import paths. - Cvs::Internal::CvsEditor + Cvs Annotate revision "%1" 註記版本 "%1" @@ -14743,7 +14689,7 @@ with a password, which you can enter below. - CodePaster::FileShareProtocol + CodePaster Cannot open %1: %2 無法開啟 %1:%2 @@ -14764,16 +14710,10 @@ with a password, which you can enter below. Pasted: %1 已貼上:%1 - - - CodePaster::FileShareProtocolSettingsPage Fileshare 檔案共享 - - - CodePaster::Protocol %1 - Configuration Error %1 - 設置錯誤 @@ -16107,7 +16047,7 @@ Server list was %2. - CodePaster::NetworkProtocol + CodePaster Checking connection 正在檢查連線 @@ -22371,7 +22311,7 @@ Would you like to overwrite them? - Cvs::Internal::CvsDiffParameterWidget + Cvs Ignore whitespace 忽略空白 @@ -26350,7 +26290,7 @@ Filter: %2 - CodePaster::Internal::FileShareProtocolSettingsWidget + CodePaster Form 表單 @@ -26372,13 +26312,6 @@ Filter: %2 entries 條目 - - - CodePaster::Internal::PasteBinComSettingsWidget - - Form - 表單 - <a href="http://pastebin.com">pastebin.com</a> allows for sending posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix. <a href="http://pastebin.com">pastebin.com</a> 允許傳送主題到自定義子域名,(比如. creator.pastebin.com). 輸入你希望的前綴. @@ -26391,9 +26324,6 @@ Filter: %2 <i>Note: The plugin will use this for posting as well as fetching.</i> <i>注意:外掛程式將會使用此項來發佈與抓取。</i> - - - CodePaster::Internal::PasteSelectDialog Protocol: 協定: @@ -26402,17 +26332,10 @@ Filter: %2 Paste: 貼上: - - - CodePaster::Internal::ViewDialog Send to Codepaster 傳送至 CodePaster - - Protocol: - 協定: - &Username: 使用者名稱(&U): @@ -26453,9 +26376,6 @@ p, li { white-space: pre-wrap; } Patch 2 Patch 2 - - - CodePaster::Internal::SettingsPage Display Output pane after sending a post 發送後顯示輸出窗格 @@ -28156,15 +28076,12 @@ should a repository require SSH-authentication (see documentation on SSH and the - AutotoolsProjectManager::Internal::AutogenStepFactory + AutotoolsProjectManager Autogen Display name for AutotoolsProjectManager::AutogenStep id. Autogen - - - AutotoolsProjectManager::Internal::AutogenStep Autogen Autogen @@ -28173,9 +28090,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration unchanged, skipping autogen step. 設置未變更,跳過 autogen 步驟。 - - - AutotoolsProjectManager::Internal::AutogenStepConfigWidget Arguments: 參數: @@ -28185,17 +28099,11 @@ should a repository require SSH-authentication (see documentation on SSH and the AutotoolsProjectManager::AutogenStepConfigWidget display name. Autogen - - - AutotoolsProjectManager::Internal::AutoreconfStepFactory Autoreconf Display name for AutotoolsProjectManager::AutoreconfStep id. Autoreconf - - - AutotoolsProjectManager::Internal::AutoreconfStep Autoreconf Autoreconf @@ -28204,21 +28112,11 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration unchanged, skipping autoreconf step. 設置未變更,跳過 autoreconf 步驟。 - - - AutotoolsProjectManager::Internal::AutoreconfStepConfigWidget - - Arguments: - 參數: - Autoreconf AutotoolsProjectManager::AutoreconfStepConfigWidget display name. Autoreconf - - - AutotoolsProjectManager::Internal::AutotoolsBuildConfigurationFactory Build 建置 @@ -28231,9 +28129,6 @@ should a repository require SSH-authentication (see documentation on SSH and the New configuration name: 新設置名稱: - - - AutotoolsProjectManager::Internal::AutotoolsBuildSettingsWidget Build directory: 建置目錄: @@ -28246,9 +28141,6 @@ should a repository require SSH-authentication (see documentation on SSH and the <Invalid tool chain> <無效的工具鍊> - - - AutotoolsProjectManager::Internal::AutotoolsManager Failed opening project '%1': Project file does not exist 開啟專案 '%1' 失敗:專案檔不存在 @@ -28257,47 +28149,28 @@ should a repository require SSH-authentication (see documentation on SSH and the Failed opening project '%1': Project already open 開啟專案 '%1' 失敗:專案已經被開啟 - - - AutotoolsProjectManager::Internal::AutotoolsOpenProjectWizard Autotools Wizard Autotools 精靈 - - - AutotoolsProjectManager::Internal::BuildPathPage Please enter the directory in which you want to build your project. Qt Creator recommends to not use the source directory for building. This ensures that the source directory remains clean and enables multiple builds with different settings. 請輸入您想建置專案的目錄。Qt Creator 建議您不要直接用源碼的目錄來做建置。這樣可以保持源碼目錄的乾淨,並且可以讓您用不同的設定進行多個建置。 - - Build directory: - 建置目錄: - Build Location 建置位置 - - - AutotoolsProjectManager::Internal::AutotoolsTarget Desktop Autotools Default target display name 桌面 - - - AutotoolsProjectManager::Internal::ConfigureStepFactory Configure Display name for AutotoolsProjectManager::ConfigureStep id. 設置 - - - AutotoolsProjectManager::Internal::ConfigureStep Configure 設置 @@ -28306,21 +28179,11 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration unchanged, skipping configure step. 設置未變更,跳過設置步驟。 - - - AutotoolsProjectManager::Internal::ConfigureStepConfigWidget - - Arguments: - 參數: - Configure AutotoolsProjectManager::ConfigureStepConfigWidget display name. 設置 - - - AutotoolsProjectManager::Internal::MakefileParser Parsing %1 in directory %2 在目錄 %2 剖析 %1 中 @@ -28329,17 +28192,11 @@ should a repository require SSH-authentication (see documentation on SSH and the Parsing directory %1 剖析目錄 %1 中 - - - AutotoolsProjectManager::Internal::MakeStepFactory Make Display name for AutotoolsProjectManager::MakeStep id. Make - - - AutotoolsProjectManager::Internal::MakeStep Make Make @@ -28352,13 +28209,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Configuration is faulty. Check the Issues view for details. 設置錯誤。請在錯誤檢視中看詳情。 - - - AutotoolsProjectManager::Internal::MakeStepConfigWidget - - Arguments: - 參數: - Make AutotoolsProjectManager::MakeStepConfigWidget display name. diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 561265146d6..6cc7c49da5e 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -792,7 +792,7 @@ QList Snapshot::includeLocationsOfDocument(const QStr const QList includeFiles = doc->resolvedIncludes(); for (const Document::Include &includeFile : includeFiles) { if (includeFile.resolvedFileName() == fileName) - result.append(qMakePair(doc, includeFile.line())); + result.push_back({doc, includeFile.line()}); } } return result; diff --git a/src/libs/cplusplus/CppRewriter.cpp b/src/libs/cplusplus/CppRewriter.cpp index b980d78dee7..f5873cc71fc 100644 --- a/src/libs/cplusplus/CppRewriter.cpp +++ b/src/libs/cplusplus/CppRewriter.cpp @@ -404,7 +404,7 @@ SubstitutionMap::~SubstitutionMap() void SubstitutionMap::bind(const Name *name, const FullySpecifiedType &ty) { - _map.append(qMakePair(name, ty)); + _map.push_back({name, ty}); } FullySpecifiedType SubstitutionMap::apply(const Name *name, Rewrite *) const diff --git a/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp b/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp index ebb105f3504..bf14cfe0f21 100644 --- a/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp +++ b/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp @@ -389,7 +389,7 @@ FullySpecifiedType DeprecatedGenTemplateInstance::instantiate(const Name *classN if (templArgName && templArgName->identifier()) { const Identifier *templArgId = templArgName->identifier(); - subst.append(qMakePair(templArgId, templArgTy)); + subst.push_back({templArgId, templArgTy}); } } } diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 7228c446dfe..836e2ad05b7 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -1420,7 +1420,7 @@ void Preprocessor::preprocess(const QString &fileName, const QByteArray &source, trackedLine = tk.lineno; trackedColumn = unsigned(computeDistance(tk, true)); } - m_state.m_expandedTokensInfo.append(qMakePair(trackedLine, trackedColumn)); + m_state.m_expandedTokensInfo.push_back({trackedLine, trackedColumn}); } else if (m_state.m_expansionStatus == JustFinishedExpansion) { m_state.setExpansionStatus(NotExpanding); macroExpanded = true; diff --git a/src/libs/modelinglib/qmt/config/stereotypedefinitionparser.cpp b/src/libs/modelinglib/qmt/config/stereotypedefinitionparser.cpp index 2ae4cb34672..631b3b097c3 100644 --- a/src/libs/modelinglib/qmt/config/stereotypedefinitionparser.cpp +++ b/src/libs/modelinglib/qmt/config/stereotypedefinitionparser.cpp @@ -204,92 +204,88 @@ StereotypeDefinitionParser::~StereotypeDefinitionParser() void StereotypeDefinitionParser::parse(ITextSource *source) { TextScanner textScanner; - textScanner.setKeywords( - QList >() - << qMakePair(QString("icon"), KEYWORD_ICON) - << qMakePair(QString("id"), KEYWORD_ID) - << qMakePair(QString("title"), KEYWORD_TITLE) - << qMakePair(QString("elements"), KEYWORD_ELEMENTS) - << qMakePair(QString("stereotype"), KEYWORD_STEREOTYPE) - << qMakePair(QString("width"), KEYWORD_WIDTH) - << qMakePair(QString("height"), KEYWORD_HEIGHT) - << qMakePair(QString("minwidth"), KEYWORD_MINWIDTH) - << qMakePair(QString("minheight"), KEYWORD_MINHEIGHT) - << qMakePair(QString("locksize"), KEYWORD_LOCK_SIZE) - << qMakePair(QString("display"), KEYWORD_DISPLAY) - << qMakePair(QString("textalignment"), KEYWORD_TEXTALIGN) - << qMakePair(QString("basecolor"), KEYWORD_BASECOLOR) - << qMakePair(QString("shape"), KEYWORD_SHAPE) - << qMakePair(QString("outline"), KEYWORD_OUTLINE) - << qMakePair(QString("circle"), KEYWORD_CIRCLE) - << qMakePair(QString("ellipse"), KEYWORD_ELLIPSE) - << qMakePair(QString("line"), KEYWORD_LINE) - << qMakePair(QString("rect"), KEYWORD_RECT) - << qMakePair(QString("roundedrect"), KEYWORD_ROUNDEDRECT) - << qMakePair(QString("arc"), KEYWORD_ARC) - << qMakePair(QString("moveto"), KEYWORD_MOVETO) - << qMakePair(QString("lineto"), KEYWORD_LINETO) - << qMakePair(QString("arcmoveto"), KEYWORD_ARCMOVETO) - << qMakePair(QString("arcto"), KEYWORD_ARCTO) - << qMakePair(QString("close"), KEYWORD_CLOSE) - << qMakePair(QString("x"), KEYWORD_X) - << qMakePair(QString("y"), KEYWORD_Y) - << qMakePair(QString("x0"), KEYWORD_X0) - << qMakePair(QString("y0"), KEYWORD_Y0) - << qMakePair(QString("x1"), KEYWORD_X1) - << qMakePair(QString("y1"), KEYWORD_Y1) - << qMakePair(QString("radius"), KEYWORD_RADIUS) - << qMakePair(QString("radiusx"), KEYWORD_RADIUS_X) - << qMakePair(QString("radiusy"), KEYWORD_RADIUS_Y) - << qMakePair(QString("start"), KEYWORD_START) - << qMakePair(QString("span"), KEYWORD_SPAN) - << qMakePair(QString("toolbar"), KEYWORD_TOOLBAR) - << qMakePair(QString("priority"), KEYWORD_PRIORITY) - << qMakePair(QString("tools"), KEYWORD_TOOLS) - << qMakePair(QString("tool"), KEYWORD_TOOL) - << qMakePair(QString("element"), KEYWORD_ELEMENT) - << qMakePair(QString("separator"), KEYWORD_SEPARATOR) - << qMakePair(QString("relation"), KEYWORD_RELATION) - << qMakePair(QString("dependency"), KEYWORD_DEPENDENCY) - << qMakePair(QString("inheritance"), KEYWORD_INHERITANCE) - << qMakePair(QString("association"), KEYWORD_ASSOCIATION) - << qMakePair(QString("name"), KEYWORD_NAME) - << qMakePair(QString("direction"), KEYWORD_DIRECTION) - << qMakePair(QString("atob"), KEYWORD_ATOB) - << qMakePair(QString("btoa"), KEYWORD_BTOA) - << qMakePair(QString("bi"), KEYWORD_BI) - << qMakePair(QString("end"), KEYWORD_END) - << qMakePair(QString("a"), KEYWORD_A) - << qMakePair(QString("b"), KEYWORD_B) - << qMakePair(QString("role"), KEYWORD_ROLE) - << qMakePair(QString("cardinality"), KEYWORD_CARDINALITY) - << qMakePair(QString("navigable"), KEYWORD_NAVIGABLE) - << qMakePair(QString("relationship"), KEYWORD_RELATIONSHIP) - << qMakePair(QString("aggregation"), KEYWORD_AGGREGATION) - << qMakePair(QString("composition"), KEYWORD_COMPOSITION) - << qMakePair(QString("shaft"), KEYWORD_SHAFT) - << qMakePair(QString("head"), KEYWORD_HEAD) - << qMakePair(QString("diamond"), KEYWORD_DIAMOND) - << qMakePair(QString("triangle"), KEYWORD_TRIANGLE) - << qMakePair(QString("filled"), KEYWORD_FILLED) - << qMakePair(QString("pattern"), KEYWORD_PATTERN) - << qMakePair(QString("solid"), KEYWORD_SOLID) - << qMakePair(QString("dot"), KEYWORD_DOT) - << qMakePair(QString("dash"), KEYWORD_DASH) - << qMakePair(QString("dashdot"), KEYWORD_DASHDOT) - << qMakePair(QString("dashdotdot"), KEYWORD_DASHDOTDOT) - << qMakePair(QString("color"), KEYWORD_COLOR) - ); - textScanner.setOperators( - QList >() - << qMakePair(QString(";"), OPERATOR_SEMICOLON) - << qMakePair(QString("{"), OPERATOR_BRACE_OPEN) - << qMakePair(QString("}"), OPERATOR_BRACE_CLOSE) - << qMakePair(QString(":"), OPERATOR_COLON) - << qMakePair(QString(","), OPERATOR_COMMA) - << qMakePair(QString("."), OPERATOR_PERIOD) - << qMakePair(QString("-"), OPERATOR_MINUS) - ); + textScanner.setKeywords({{"icon", KEYWORD_ICON}, + {"id", KEYWORD_ID}, + {"title", KEYWORD_TITLE}, + {"elements", KEYWORD_ELEMENTS}, + {"stereotype", KEYWORD_STEREOTYPE}, + {"width", KEYWORD_WIDTH}, + {"height", KEYWORD_HEIGHT}, + {"minwidth", KEYWORD_MINWIDTH}, + {"minheight", KEYWORD_MINHEIGHT}, + {"locksize", KEYWORD_LOCK_SIZE}, + {"display", KEYWORD_DISPLAY}, + {"textalignment", KEYWORD_TEXTALIGN}, + {"basecolor", KEYWORD_BASECOLOR}, + {"shape", KEYWORD_SHAPE}, + {"outline", KEYWORD_OUTLINE}, + {"circle", KEYWORD_CIRCLE}, + {"ellipse", KEYWORD_ELLIPSE}, + {"line", KEYWORD_LINE}, + {"rect", KEYWORD_RECT}, + {"roundedrect", KEYWORD_ROUNDEDRECT}, + {"arc", KEYWORD_ARC}, + {"moveto", KEYWORD_MOVETO}, + {"lineto", KEYWORD_LINETO}, + {"arcmoveto", KEYWORD_ARCMOVETO}, + {"arcto", KEYWORD_ARCTO}, + {"close", KEYWORD_CLOSE}, + {"x", KEYWORD_X}, + {"y", KEYWORD_Y}, + {"x0", KEYWORD_X0}, + {"y0", KEYWORD_Y0}, + {"x1", KEYWORD_X1}, + {"y1", KEYWORD_Y1}, + {"radius", KEYWORD_RADIUS}, + {"radiusx", KEYWORD_RADIUS_X}, + {"radiusy", KEYWORD_RADIUS_Y}, + {"start", KEYWORD_START}, + {"span", KEYWORD_SPAN}, + {"toolbar", KEYWORD_TOOLBAR}, + {"priority", KEYWORD_PRIORITY}, + {"tools", KEYWORD_TOOLS}, + {"tool", KEYWORD_TOOL}, + {"element", KEYWORD_ELEMENT}, + {"separator", KEYWORD_SEPARATOR}, + {"relation", KEYWORD_RELATION}, + {"dependency", KEYWORD_DEPENDENCY}, + {"inheritance", KEYWORD_INHERITANCE}, + {"association", KEYWORD_ASSOCIATION}, + {"name", KEYWORD_NAME}, + {"direction", KEYWORD_DIRECTION}, + {"atob", KEYWORD_ATOB}, + {"btoa", KEYWORD_BTOA}, + {"bi", KEYWORD_BI}, + {"end", KEYWORD_END}, + {"a", KEYWORD_A}, + {"b", KEYWORD_B}, + {"role", KEYWORD_ROLE}, + {"cardinality", KEYWORD_CARDINALITY}, + {"navigable", KEYWORD_NAVIGABLE}, + {"relationship", KEYWORD_RELATIONSHIP}, + {"aggregation", KEYWORD_AGGREGATION}, + {"composition", KEYWORD_COMPOSITION}, + {"shaft", KEYWORD_SHAFT}, + {"head", KEYWORD_HEAD}, + {"diamond", KEYWORD_DIAMOND}, + {"triangle", KEYWORD_TRIANGLE}, + {"filled", KEYWORD_FILLED}, + {"pattern", KEYWORD_PATTERN}, + {"solid", KEYWORD_SOLID}, + {"dot", KEYWORD_DOT}, + {"dash", KEYWORD_DASH}, + {"dashdot", KEYWORD_DASHDOT}, + {"dashdotdot", KEYWORD_DASHDOTDOT}, + {"color", KEYWORD_COLOR}}); + + textScanner.setOperators({{";", OPERATOR_SEMICOLON}, + {"{", OPERATOR_BRACE_OPEN}, + {"}", OPERATOR_BRACE_CLOSE}, + {":", OPERATOR_COLON}, + {",", OPERATOR_COMMA}, + {".", OPERATOR_PERIOD}, + {"-", OPERATOR_MINUS}}); + textScanner.setSource(source); d->m_scanner = &textScanner; @@ -342,12 +338,12 @@ void StereotypeDefinitionParser::parseIcon() break; case KEYWORD_ELEMENTS: { - const static QHash elementNames = QHash() - << qMakePair(QString("package"), StereotypeIcon::ElementPackage) - << qMakePair(QString("component"), StereotypeIcon::ElementComponent) - << qMakePair(QString("class"), StereotypeIcon::ElementClass) - << qMakePair(QString("diagram"), StereotypeIcon::ElementDiagram) - << qMakePair(QString("item"), StereotypeIcon::ElementItem); + const static QHash elementNames + = {{"package", StereotypeIcon::ElementPackage}, + {"component", StereotypeIcon::ElementComponent}, + {"class", StereotypeIcon::ElementClass}, + {"diagram", StereotypeIcon::ElementDiagram}, + {"item", StereotypeIcon::ElementItem}}; parseEnums( parseIdentifierListProperty(), elementNames, token.sourcePos(), [&](StereotypeIcon::Element element) { elements.insert(element); }); @@ -370,12 +366,12 @@ void StereotypeDefinitionParser::parseIcon() break; case KEYWORD_LOCK_SIZE: { - const static QHash lockNames = QHash() - << qMakePair(QString("none"), StereotypeIcon::LockNone) - << qMakePair(QString("width"), StereotypeIcon::LockWidth) - << qMakePair(QString("height"), StereotypeIcon::LockHeight) - << qMakePair(QString("size"), StereotypeIcon::LockSize) - << qMakePair(QString("ratio"), StereotypeIcon::LockRatio); + const static QHash lockNames + = {{"none", StereotypeIcon::LockNone}, + {"width", StereotypeIcon::LockWidth}, + {"height", StereotypeIcon::LockHeight}, + {"size", StereotypeIcon::LockSize}, + {"ratio", StereotypeIcon::LockRatio}}; parseEnum( parseIdentifierProperty(), lockNames, token.sourcePos(), [&](StereotypeIcon::SizeLock lock) { stereotypeIcon.setSizeLock(lock); }); @@ -383,12 +379,12 @@ void StereotypeDefinitionParser::parseIcon() } case KEYWORD_DISPLAY: { - const static QHash displayNames = QHash() - << qMakePair(QString("none"), StereotypeIcon::DisplayNone) - << qMakePair(QString("label"), StereotypeIcon::DisplayLabel) - << qMakePair(QString("decoration"), StereotypeIcon::DisplayDecoration) - << qMakePair(QString("icon"), StereotypeIcon::DisplayIcon) - << qMakePair(QString("smart"), StereotypeIcon::DisplaySmart); + const static QHash displayNames + = {{"none", StereotypeIcon::DisplayNone}, + {"label", StereotypeIcon::DisplayLabel}, + {"decoration", StereotypeIcon::DisplayDecoration}, + {"icon", StereotypeIcon::DisplayIcon}, + {"smart", StereotypeIcon::DisplaySmart}}; parseEnum( parseIdentifierProperty(), displayNames, token.sourcePos(), [&](StereotypeIcon::Display display) { stereotypeIcon.setDisplay(display); }); @@ -396,11 +392,11 @@ void StereotypeDefinitionParser::parseIcon() } case KEYWORD_TEXTALIGN: { - const static QHash alignNames = QHash() - << qMakePair(QString("below"), StereotypeIcon::TextalignBelow) - << qMakePair(QString("center"), StereotypeIcon::TextalignCenter) - << qMakePair(QString("none"), StereotypeIcon::TextalignNone) - << qMakePair(QString("top"), StereotypeIcon::TextalignTop); + const static QHash alignNames + = {{"below", StereotypeIcon::TextalignBelow}, + {"center", StereotypeIcon::TextalignCenter}, + {"none", StereotypeIcon::TextalignNone}, + {"top", StereotypeIcon::TextalignTop}}; parseEnum( parseIdentifierProperty(), alignNames, token.sourcePos(), [&](StereotypeIcon::TextAlignment align) { stereotypeIcon.setTextAlignment(align); }); @@ -434,22 +430,22 @@ void StereotypeDefinitionParser::parseIcon() QPair StereotypeDefinitionParser::SCALED(int keyword) { - return qMakePair(keyword, IconCommandParameter(ShapeValueF::UnitScaled)); + return {keyword, IconCommandParameter(ShapeValueF::UnitScaled)}; } QPair StereotypeDefinitionParser::FIX(int keyword) { - return qMakePair(keyword, IconCommandParameter(ShapeValueF::UnitRelative)); + return {keyword, IconCommandParameter(ShapeValueF::UnitRelative)}; } QPair StereotypeDefinitionParser::ABSOLUTE(int keyword) { - return qMakePair(keyword, IconCommandParameter(ShapeValueF::UnitAbsolute)); + return {keyword, IconCommandParameter(ShapeValueF::UnitAbsolute)}; } QPair StereotypeDefinitionParser::BOOLEAN(int keyword) { - return qMakePair(keyword, IconCommandParameter(IconCommandParameter::Boolean)); + return {keyword, IconCommandParameter(IconCommandParameter::Boolean)}; } IconShape StereotypeDefinitionParser::parseIconShape() @@ -626,10 +622,10 @@ void StereotypeDefinitionParser::parseRelation(CustomRelation::Element element) break; case KEYWORD_DIRECTION: { - const static QHash directionNames = QHash() - << qMakePair(QString("atob"), CustomRelation::Direction::AtoB) - << qMakePair(QString("btoa"), CustomRelation::Direction::BToA) - << qMakePair(QString("bi"), CustomRelation::Direction::Bi); + const static QHash directionNames + = {{"atob", CustomRelation::Direction::AtoB}, + {"btoa", CustomRelation::Direction::BToA}, + {"bi", CustomRelation::Direction::Bi}}; if (element != CustomRelation::Element::Dependency) throwUnknownPropertyError(token); parseEnum( @@ -639,12 +635,12 @@ void StereotypeDefinitionParser::parseRelation(CustomRelation::Element element) } case KEYWORD_PATTERN: { - const static QHash patternNames = QHash() - << qMakePair(QString("solid"), CustomRelation::ShaftPattern::Solid) - << qMakePair(QString("dash"), CustomRelation::ShaftPattern::Dash) - << qMakePair(QString("dot"), CustomRelation::ShaftPattern::Dot) - << qMakePair(QString("dashdot"), CustomRelation::ShaftPattern::DashDot) - << qMakePair(QString("dashdotdot"), CustomRelation::ShaftPattern::DashDotDot); + const static QHash patternNames + = {{"solid", CustomRelation::ShaftPattern::Solid}, + {"dash", CustomRelation::ShaftPattern::Dash}, + {"dot", CustomRelation::ShaftPattern::Dot}, + {"dashdot", CustomRelation::ShaftPattern::DashDot}, + {"dashdotdot", CustomRelation::ShaftPattern::DashDotDot}}; if (element != CustomRelation::Element::Relation) throwUnknownPropertyError(token); parseEnum( @@ -743,10 +739,10 @@ void StereotypeDefinitionParser::parseRelationEnd(CustomRelation *relation) { if (relation->element() != CustomRelation::Element::Association) throwUnknownPropertyError(token); - const static QHash relationshipNames = QHash() - << qMakePair(QString("association"), CustomRelation::Relationship::Association) - << qMakePair(QString("aggregation"), CustomRelation::Relationship::Aggregation) - << qMakePair(QString("composition"), CustomRelation::Relationship::Composition); + const static QHash relationshipNames + = {{"association", CustomRelation::Relationship::Association}, + {"aggregation", CustomRelation::Relationship::Aggregation}, + {"composition", CustomRelation::Relationship::Composition}}; parseEnum( parseIdentifierProperty(), relationshipNames, token.sourcePos(), [&](CustomRelation::Relationship relationship) { relationEnd.setRelationship(relationship); }); @@ -756,13 +752,13 @@ void StereotypeDefinitionParser::parseRelationEnd(CustomRelation *relation) { if (relation->element() != CustomRelation::Element::Relation) throwUnknownPropertyError(token); - const static QHash headNames = QHash() - << qMakePair(QString("none"), CustomRelation::Head::None) - << qMakePair(QString("arrow"), CustomRelation::Head::Arrow) - << qMakePair(QString("triangle"), CustomRelation::Head::Triangle) - << qMakePair(QString("filledtriangle"), CustomRelation::Head::FilledTriangle) - << qMakePair(QString("diamond"), CustomRelation::Head::Diamond) - << qMakePair(QString("filleddiamond"), CustomRelation::Head::FilledDiamond); + const static QHash headNames + = {{"none", CustomRelation::Head::None}, + {"arrow", CustomRelation::Head::Arrow}, + {"triangle", CustomRelation::Head::Triangle}, + {"filledtriangle", CustomRelation::Head::FilledTriangle}, + {"diamond", CustomRelation::Head::Diamond}, + {"filleddiamond", CustomRelation::Head::FilledDiamond}}; parseEnum( parseIdentifierProperty(), headNames, token.sourcePos(), [&](CustomRelation::Head head) { relationEnd.setHead(head); }); diff --git a/src/libs/modelinglib/qmt/config/textscanner.cpp b/src/libs/modelinglib/qmt/config/textscanner.cpp index 576832202f7..7ff31a20ac5 100644 --- a/src/libs/modelinglib/qmt/config/textscanner.cpp +++ b/src/libs/modelinglib/qmt/config/textscanner.cpp @@ -52,14 +52,14 @@ TextScanner::~TextScanner() delete d; } -void TextScanner::setKeywords(const QList > &keywords) +void TextScanner::setKeywords(const QList> &keywords) { d->m_keywordToSubtypeMap.clear(); foreach (const DefTuple &tuple, keywords) d->m_keywordToSubtypeMap.insert(tuple.first.toLower(), tuple.second); } -void TextScanner::setOperators(const QList > &operators) +void TextScanner::setOperators(const QList> &operators) { d->m_operatorToSubtypeMap.clear(); d->m_maxOperatorLength = 0; diff --git a/src/libs/modelinglib/qmt/config/textscanner.h b/src/libs/modelinglib/qmt/config/textscanner.h index 55d6ca798b5..1a2df9540f5 100644 --- a/src/libs/modelinglib/qmt/config/textscanner.h +++ b/src/libs/modelinglib/qmt/config/textscanner.h @@ -36,8 +36,8 @@ public: explicit TextScanner(QObject *parent = nullptr); ~TextScanner() override; - void setKeywords(const QList > &keywords); - void setOperators(const QList > &operators); + void setKeywords(const QList> &keywords); + void setOperators(const QList> &operators); void setSource(ITextSource *textSource); SourcePos sourcePos() const; diff --git a/src/libs/modelinglib/qmt/infrastructure/handles.h b/src/libs/modelinglib/qmt/infrastructure/handles.h index 738aeec195f..94a5827a042 100644 --- a/src/libs/modelinglib/qmt/infrastructure/handles.h +++ b/src/libs/modelinglib/qmt/infrastructure/handles.h @@ -15,7 +15,7 @@ template class Handles { public: - typedef QList > value_type; + typedef QList> value_type; typedef typename value_type::iterator iterator; typedef typename value_type::const_iterator const_iterator; diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp index 5c3a6340239..73fca46572a 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp +++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp @@ -1146,7 +1146,7 @@ void PropertiesView::MView::visitDSwimlane(const DSwimlane *swimlane) void PropertiesView::MView::onStereotypesChanged(const QString &stereotypes) { QList set = m_stereotypesController->fromString(stereotypes); - assignModelElement >(m_modelElements, SelectionMulti, set, + assignModelElement>(m_modelElements, SelectionMulti, set, &MElement::stereotypes, &MElement::setStereotypes); } @@ -1164,7 +1164,7 @@ void PropertiesView::MView::onNamespaceChanged(const QString ¨Namespace) void PropertiesView::MView::onTemplateParametersChanged(const QString &templateParameters) { QList templateParametersList = splitTemplateParameters(templateParameters); - assignModelElement >(m_modelElements, SelectionSingle, templateParametersList, + assignModelElement>(m_modelElements, SelectionSingle, templateParametersList, &MClass::templateParameters, &MClass::setTemplateParameters); } @@ -1191,7 +1191,7 @@ void PropertiesView::MView::onClassMembersChanged(QList &classMemb showMembers.insert(klass->uid()); } } - assignModelElement >(m_modelElements, SelectionSingle, classMembers, + assignModelElement>(m_modelElements, SelectionSingle, classMembers, &MClass::members, &MClass::setMembers); foreach (DElement *element, m_diagramElements) { if (showMembers.contains(element->modelUid())) { diff --git a/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.cpp b/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.cpp index 5695fda3df1..800046d4655 100644 --- a/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.cpp +++ b/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.cpp @@ -117,12 +117,14 @@ QString StereotypeController::findStereotypeIconId(StereotypeIcon::Element eleme const QList &stereotypes) const { foreach (const QString &stereotype, stereotypes) { - if (d->m_stereotypeToIconIdMap.contains(qMakePair(element, stereotype))) - return d->m_stereotypeToIconIdMap.value(qMakePair(element, stereotype)); - else if (d->m_stereotypeToIconIdMap.contains(qMakePair(StereotypeIcon::ElementAny, stereotype))) - return d->m_stereotypeToIconIdMap.value(qMakePair(StereotypeIcon::ElementAny, stereotype)); + auto it = d->m_stereotypeToIconIdMap.constFind({element, stereotype}); + if (it != d->m_stereotypeToIconIdMap.constEnd()) + return it.value(); + it = d->m_stereotypeToIconIdMap.constFind({StereotypeIcon::ElementAny, stereotype}); + if (it != d->m_stereotypeToIconIdMap.constEnd()) + return it.value(); } - return QString(); + return {}; } QList StereotypeController::filterStereotypesByIconId(const QString &stereotypeIconId, @@ -232,11 +234,11 @@ void StereotypeController::addStereotypeIcon(const StereotypeIcon &stereotypeIco { if (stereotypeIcon.elements().isEmpty()) { foreach (const QString &stereotype, stereotypeIcon.stereotypes()) - d->m_stereotypeToIconIdMap.insert(qMakePair(StereotypeIcon::ElementAny, stereotype), stereotypeIcon.id()); + d->m_stereotypeToIconIdMap.insert({StereotypeIcon::ElementAny, stereotype}, stereotypeIcon.id()); } else { foreach (StereotypeIcon::Element element, stereotypeIcon.elements()) { foreach (const QString &stereotype, stereotypeIcon.stereotypes()) - d->m_stereotypeToIconIdMap.insert(qMakePair(element, stereotype), stereotypeIcon.id()); + d->m_stereotypeToIconIdMap.insert({element, stereotype}, stereotypeIcon.id()); } } d->m_iconIdToStereotypeIconsMap.insert(stereotypeIcon.id(), stereotypeIcon); diff --git a/src/libs/sqlite/sqlitevalue.h b/src/libs/sqlite/sqlitevalue.h index 46467cf745c..82f1076b084 100644 --- a/src/libs/sqlite/sqlitevalue.h +++ b/src/libs/sqlite/sqlitevalue.h @@ -333,7 +333,7 @@ private: if (value.isNull()) return VariantType{NullValue{}}; - switch (value.type()) { + switch (value.userType()) { case QVariant::Int: return VariantType{static_cast(value.toInt())}; case QVariant::LongLong: diff --git a/src/libs/utils/differ.cpp b/src/libs/utils/differ.cpp index d71e18f4935..7e06359d14b 100644 --- a/src/libs/utils/differ.cpp +++ b/src/libs/utils/differ.cpp @@ -496,7 +496,7 @@ static QString encodeExpandedWhitespace(const QString &leftEquality, *ok = false; if (!leftCodeMap || !rightCodeMap) - return QString(); + return {}; leftCodeMap->clear(); rightCodeMap->clear(); @@ -520,27 +520,25 @@ static QString encodeExpandedWhitespace(const QString &leftEquality, if (leftIndex < leftCount && rightIndex < rightCount) { if (leftEquality.at(leftIndex) != rightEquality.at(rightIndex)) - return QString(); // equalities broken + return {}; // equalities broken } else if (leftIndex == leftCount && rightIndex == rightCount) { ; // do nothing, the last iteration } else { - return QString(); // equalities broken + return {}; // equalities broken } - if (leftWhitespaces.isEmpty() ^ rightWhitespaces.isEmpty()) { + if (leftWhitespaces.isEmpty() != rightWhitespaces.isEmpty()) { // there must be at least 1 corresponding whitespace, equalities broken - return QString(); + return {}; } if (!leftWhitespaces.isEmpty() && !rightWhitespaces.isEmpty()) { const int replacementPosition = output.count(); const int replacementSize = qMax(leftWhitespaces.count(), rightWhitespaces.count()); const QString replacement(replacementSize, ' '); - leftCodeMap->insert(replacementPosition, - qMakePair(replacementSize, leftWhitespaces)); - rightCodeMap->insert(replacementPosition, - qMakePair(replacementSize, rightWhitespaces)); + leftCodeMap->insert(replacementPosition, {replacementSize, leftWhitespaces}); + rightCodeMap->insert(replacementPosition, {replacementSize, rightWhitespaces}); output.append(replacement); } @@ -1235,8 +1233,7 @@ QStringList Differ::encode(const QString &text1, QString *encodedText1, QString *encodedText2) { - QStringList lines; - lines.append(QString()); // don't use code: 0 + QStringList lines{{}}; // don't use code: 0 QMap lineToCode; *encodedText1 = encode(text1, &lines, &lineToCode); diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index d79c2dbe6cd..57b3b197244 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -61,7 +61,7 @@ void Environment::appendOrSet(const QString &key, const QString &value, const QS QTC_ASSERT(!key.contains('='), return ); const auto it = m_dict.findKey(key); if (it == m_dict.m_values.end()) { - m_dict.m_values.insert(DictKey(key, m_dict.nameCaseSensitivity()), qMakePair(value, true)); + m_dict.m_values.insert(DictKey(key, m_dict.nameCaseSensitivity()), {value, true}); } else { // Append unless it is already there const QString toAppend = sep + value; @@ -75,7 +75,7 @@ void Environment::prependOrSet(const QString &key, const QString &value, const Q QTC_ASSERT(!key.contains('='), return ); const auto it = m_dict.findKey(key); if (it == m_dict.m_values.end()) { - m_dict.m_values.insert(DictKey(key, m_dict.nameCaseSensitivity()), qMakePair(value, true)); + m_dict.m_values.insert(DictKey(key, m_dict.nameCaseSensitivity()), {value, true}); } else { // Prepend unless it is already there const QString toPrepend = value + sep; diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index fe2f6cbc6e3..6ba842a9fed 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -176,39 +176,39 @@ bool FilePath::isRootPath() const QString FilePath::encodedHost() const { - QString host = m_host; - host.replace('%', "%25"); - host.replace('/', "%2f"); - return host; + QString result = host().toString(); + result.replace('%', "%25"); + result.replace('/', "%2f"); + return result; } /// \returns a QString for passing on to QString based APIs QString FilePath::toString() const { - if (m_scheme.isEmpty()) - return m_path; + if (!needsDevice()) + return path(); if (isRelativePath()) - return m_scheme + "://" + encodedHost() + "/./" + m_path; - return m_scheme + "://" + encodedHost() + m_path; + return scheme() + "://" + encodedHost() + "/./" + path(); + return scheme() + "://" + encodedHost() + path(); } QString FilePath::toFSPathString() const { - if (m_scheme.isEmpty()) - return m_path; + if (scheme().isEmpty()) + return path(); if (isRelativePath()) - return specialPath(SpecialPathComponent::RootPath) + "/" + m_scheme + "/" + encodedHost() + "/./" + m_path; - return specialPath(SpecialPathComponent::RootPath) + "/" + m_scheme + "/" + encodedHost() + m_path; + return specialPath(SpecialPathComponent::RootPath) + "/" + scheme() + "/" + encodedHost() + "/./" + path(); + return specialPath(SpecialPathComponent::RootPath) + "/" + scheme() + "/" + encodedHost() + path(); } QUrl FilePath::toUrl() const { QUrl url; - url.setScheme(m_scheme); - url.setHost(m_host); - url.setPath(m_path); + url.setScheme(scheme().toString()); + url.setHost(host().toString()); + url.setPath(path()); return url; } @@ -217,13 +217,10 @@ QUrl FilePath::toUrl() const /// this path belongs to. QString FilePath::toUserOutput() const { - if (needsDevice()) { - if (isRelativePath()) - return m_scheme + "://" + encodedHost() + "/./" + m_path; - return m_scheme + "://" + encodedHost() + m_path; - } - QString tmp = toString(); + if (needsDevice()) + return tmp; + if (osType() == OsTypeWindows) tmp.replace('/', '\\'); return tmp; @@ -333,25 +330,29 @@ QString FilePath::completeSuffix() const QStringView FilePath::scheme() const { - return m_scheme; + return QStringView{m_data}.mid(m_pathLen, m_schemeLen); } QStringView FilePath::host() const { - return m_host; + return QStringView{m_data}.mid(m_pathLen + m_schemeLen, m_hostLen); } QString FilePath::path() const { - return m_path; + if (m_data.startsWith("/./")) + return m_data.mid(3, m_pathLen - 3); + return m_data.left(m_pathLen); } void FilePath::setParts(const QStringView scheme, const QStringView host, const QStringView path) { - QTC_CHECK(!m_scheme.contains('/')); - m_scheme = scheme.toString(); - m_host = host.toString(); - setPath(path); + QTC_CHECK(!scheme.contains('/')); + + m_data = path.toString() + scheme.toString() + host.toString(); + m_schemeLen = scheme.size(); + m_hostLen = host.size(); + m_pathLen = path.size(); } /// \returns a bool indicating whether a file with this @@ -611,7 +612,7 @@ void FilePath::asyncWriteFileContents(const Continuation &cont, const QByt bool FilePath::needsDevice() const { - return !m_scheme.isEmpty(); + return m_schemeLen != 0; } bool FilePath::isSameDevice(const FilePath &other) const @@ -764,7 +765,7 @@ FilePath FilePath::normalizedPathName() const { FilePath result = *this; if (!needsDevice()) // FIXME: Assumes no remote Windows and Mac for now. - result.m_path = FileUtils::normalizedPathName(result.m_path); + result.setParts(scheme(), host(), FileUtils::normalizedPathName(path())); return result; } @@ -833,15 +834,13 @@ bool isWindowsDriveLetter(QChar ch) void FilePath::setPath(QStringView path) { - if (path.startsWith(QStringLiteral("/./"))) - path = path.mid(3); - m_path = path.toString(); + setParts(scheme(), host(), path); } void FilePath::setFromString(const QString &unnormalizedFileName) { - static const QLatin1String qtcDevSlash("__qtc_devices__/"); - static const QLatin1String colonSlashSlash("://"); + static const QStringView qtcDevSlash(u"__qtc_devices__/"); + static const QStringView colonSlashSlash(u"://"); QString fileName = unnormalizedFileName; if (fileName.contains('\\')) @@ -865,23 +864,21 @@ void FilePath::setFromString(const QString &unnormalizedFileName) const int firstSlash = withoutQtcDeviceRoot.indexOf(slash); if (firstSlash != -1) { - m_scheme = withoutQtcDeviceRoot.left(firstSlash).toString(); + QString scheme = withoutQtcDeviceRoot.left(firstSlash).toString(); const int secondSlash = withoutQtcDeviceRoot.indexOf(slash, firstSlash + 1); - m_host = withoutQtcDeviceRoot.mid(firstSlash + 1, secondSlash - firstSlash - 1) + QString host = withoutQtcDeviceRoot.mid(firstSlash + 1, secondSlash - firstSlash - 1) .toString(); if (secondSlash != -1) { QStringView path = withoutQtcDeviceRoot.mid(secondSlash); - setPath(path); + setParts(scheme, host, path); return; } - m_path = slash; + setParts(scheme, host, u"/"); return; } - m_scheme.clear(); - m_host.clear(); - m_path = fileName; + setParts({}, {}, fileName); return; } @@ -889,16 +886,14 @@ void FilePath::setFromString(const QString &unnormalizedFileName) const int schemeEnd = fileName.indexOf(colonSlashSlash); if (schemeEnd != -1 && schemeEnd < firstSlash) { // This is a pseudo Url, we can't use QUrl here sadly. - m_scheme = fileName.left(schemeEnd); + QString scheme = fileName.left(schemeEnd); const int hostEnd = fileName.indexOf(slash, schemeEnd + 3); - m_host = fileName.mid(schemeEnd + 3, hostEnd - schemeEnd - 3); - if (hostEnd != -1) - setPath(QStringView(fileName).mid(hostEnd)); + QString host = fileName.mid(schemeEnd + 3, hostEnd - schemeEnd - 3); + setParts(scheme, host, hostEnd != -1 ? QStringView(fileName).mid(hostEnd) : QStringView()); return; } - setPath(fileName); - return; + setParts({}, {}, fileName); } /// Constructs a FilePath from \a filePath. The \a defaultExtension is appended @@ -951,9 +946,9 @@ QVariant FilePath::toVariant() const bool FilePath::operator==(const FilePath &other) const { - return QString::compare(m_path, other.m_path, caseSensitivity()) == 0 - && m_host == other.m_host - && m_scheme == other.m_scheme; + return QString::compare(path(), other.path(), caseSensitivity()) == 0 + && host() == other.host() + && scheme() == other.scheme(); } bool FilePath::operator!=(const FilePath &other) const @@ -963,12 +958,12 @@ bool FilePath::operator!=(const FilePath &other) const bool FilePath::operator<(const FilePath &other) const { - const int cmp = QString::compare(m_path, other.m_path, caseSensitivity()); + const int cmp = QString::compare(path(), other.path(), caseSensitivity()); if (cmp != 0) return cmp < 0; - if (m_host != other.m_host) - return m_host < other.m_host; - return m_scheme < other.m_scheme; + if (host() != other.host()) + return host() < other.host(); + return scheme() < other.scheme(); } bool FilePath::operator<=(const FilePath &other) const @@ -996,15 +991,15 @@ bool FilePath::isChildOf(const FilePath &s) const { if (s.isEmpty()) return false; - if (!m_path.startsWith(s.m_path, caseSensitivity())) + if (!path().startsWith(s.path(), caseSensitivity())) return false; - if (m_path.size() <= s.m_path.size()) + if (path().size() <= s.path().size()) return false; // s is root, '/' was already tested in startsWith - if (s.m_path.endsWith(QLatin1Char('/'))) + if (s.path().endsWith(QLatin1Char('/'))) return true; // s is a directory, next character should be '/' (/tmpdir is NOT a child of /tmp) - return s.m_path.isEmpty() || m_path.at(s.m_path.size()) == QLatin1Char('/'); + return s.path().isEmpty() || path().at(s.path().size()) == QLatin1Char('/'); } /// \returns whether path() startsWith \a s @@ -1029,7 +1024,7 @@ bool FilePath::endsWith(const QString &s) const */ bool FilePath::startsWithDriveLetter() const { - return !needsDevice() && m_path.size() >= 2 && isWindowsDriveLetter(m_path[0]) && m_path.at(1) == ':'; + return !needsDevice() && path().size() >= 2 && isWindowsDriveLetter(path()[0]) && path().at(1) == ':'; } /*! @@ -1043,11 +1038,10 @@ FilePath FilePath::relativeChildPath(const FilePath &parent) const { FilePath res; if (isChildOf(parent)) { - res.m_scheme = m_scheme; - res.m_host = m_host; - res.m_path = m_path.mid(parent.m_path.size()); - if (res.m_path.startsWith('/')) - res.m_path = res.m_path.mid(1); + QString p = path().mid(parent.path().size()); + if (p.startsWith('/')) + p = p.mid(1); + res.setParts(scheme(), host(), p); } return res; } @@ -1164,15 +1158,13 @@ QString FilePath::calcRelativePath(const QString &absolutePath, const QString &a */ FilePath FilePath::onDevice(const FilePath &deviceTemplate) const { - const bool sameDevice = m_scheme == deviceTemplate.m_scheme && m_host == deviceTemplate.m_host; + const bool sameDevice = scheme() == deviceTemplate.scheme() && host() == deviceTemplate.host(); if (sameDevice) return *this; // TODO: converting paths between different non local devices is still unsupported QTC_CHECK(!needsDevice()); FilePath res; - res.m_scheme = deviceTemplate.m_scheme; - res.m_host = deviceTemplate.m_host; - res.m_path = m_path; + res.setParts(deviceTemplate.scheme(), deviceTemplate.host(), path()); res.setPath(res.mapToDevicePath()); return res; } @@ -1191,9 +1183,7 @@ FilePath FilePath::onDevice(const FilePath &deviceTemplate) const FilePath FilePath::withNewPath(const QString &newPath) const { FilePath res; - res.setPath(newPath); - res.m_host = m_host; - res.m_scheme = m_scheme; + res.setParts(scheme(), host(), newPath); return res; } @@ -1286,9 +1276,11 @@ FilePath FilePath::pathAppended(const QString &path) const if (isEmpty()) { return other; } - FilePath fn = *this; - join(fn.m_path, other.path()); - return fn; + + QString p = this->path(); + join(p, other.path()); + + return withNewPath(p); } FilePath FilePath::stringAppended(const QString &str) const @@ -1506,7 +1498,7 @@ bool FilePath::isNewerThan(const QDateTime &timeStamp) const */ Qt::CaseSensitivity FilePath::caseSensitivity() const { - if (m_scheme.isEmpty()) + if (scheme().isEmpty()) return HostOsInfo::fileNameCaseSensitivity(); // FIXME: This could or possibly should the target device's file name case sensitivity @@ -1606,7 +1598,7 @@ void FilePath::clear() */ bool FilePath::isEmpty() const { - return m_path.isEmpty(); + return m_pathLen == 0; } /*! @@ -1634,9 +1626,9 @@ QString FilePath::shortNativePath() const */ bool FilePath::isRelativePath() const { - if (m_path.startsWith('/')) + if (path().startsWith('/')) return false; - if (m_path.size() > 1 && isWindowsDriveLetter(m_path[0]) && m_path.at(1) == ':') + if (path().size() > 1 && isWindowsDriveLetter(path()[0]) && path().at(1) == ':') return false; return true; } diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index 7227aa519a0..75491b96c62 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -219,9 +219,10 @@ private: [[nodiscard]] QString mapToDevicePath() const; [[nodiscard]] QString encodedHost() const; - QString m_scheme; - QString m_host; // May contain raw slashes. - QString m_path; // Includes the root bits + QString m_data; // Concatenated m_path, m_scheme, m_host + unsigned int m_pathLen = 0; + unsigned short m_schemeLen = 0; + unsigned short m_hostLen = 0; }; inline size_t qHash(const Utils::FilePath &a, uint seed = 0) diff --git a/src/libs/utils/fsengine/fsenginehandler.cpp b/src/libs/utils/fsengine/fsenginehandler.cpp index f2b649c48da..36cd0950ad6 100644 --- a/src/libs/utils/fsengine/fsenginehandler.cpp +++ b/src/libs/utils/fsengine/fsenginehandler.cpp @@ -52,11 +52,11 @@ QAbstractFileEngine *FSEngineHandler::create(const QString &fileName) const FilePath filePath = FilePath::fromString(fixedFileName); if (filePath.needsDevice()) return new FSEngineImpl(filePath); - - if (fixedFileName.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0) - return new RootInjectFSEngine(fixedFileName); } + if (fixedFileName.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0) + return new RootInjectFSEngine(fixedFileName); + return nullptr; } diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 7f4841476f7..5d95d32d934 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -82,17 +82,20 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) : d->m_pathChooser->setDisabled(d->m_forceSubProject); d->m_projectsDirectoryCheckBox = new QCheckBox(tr("Use as default project location")); + d->m_projectsDirectoryCheckBox->setObjectName("projectsDirectoryCheckBox"); d->m_projectsDirectoryCheckBox->setDisabled(d->m_forceSubProject); d->m_projectComboBox = new QComboBox; d->m_projectComboBox->setVisible(d->m_forceSubProject); d->m_stateLabel = new Utils::InfoLabel(this); + d->m_stateLabel->setObjectName("stateLabel"); d->m_stateLabel->setWordWrap(true); d->m_stateLabel->setFilled(true); hideStatusLabel(); d->m_nameLineEdit->setPlaceholderText(tr("Enter project name")); + d->m_nameLineEdit->setObjectName("nameLineEdit"); d->m_nameLineEdit->setFocus(); d->m_nameLineEdit->setValidationFunction([this](FancyLineEdit *edit, QString *errorString) { return validateProjectName(edit->text(), errorString); diff --git a/src/libs/utils/settingsaccessor.h b/src/libs/utils/settingsaccessor.h index bf8b15ce943..f5965626de9 100644 --- a/src/libs/utils/settingsaccessor.h +++ b/src/libs/utils/settingsaccessor.h @@ -207,7 +207,7 @@ public: virtual QVariantMap upgrade(const QVariantMap &data) = 0; protected: - using Change = QPair; + using Change = QPair; QVariantMap renameKeys(const QList &changes, QVariantMap map) const; private: diff --git a/src/libs/utils/theme/theme.cpp b/src/libs/utils/theme/theme.cpp index 2896938aebc..0d0908c539a 100644 --- a/src/libs/utils/theme/theme.cpp +++ b/src/libs/utils/theme/theme.cpp @@ -3,7 +3,6 @@ #include "theme.h" #include "theme_p.h" -#include "../algorithm.h" #include "../hostosinfo.h" #include "../qtcassert.h" #ifdef Q_OS_MACOS @@ -11,7 +10,6 @@ #endif #include -#include #include #include #include @@ -133,17 +131,18 @@ QString Theme::imageFile(Theme::ImageFile imageFile, const QString &fallBack) co QPair Theme::readNamedColor(const QString &color) const { - if (d->palette.contains(color)) - return qMakePair(d->palette[color], color); + const auto it = d->palette.constFind(color); + if (it != d->palette.constEnd()) + return {it.value(), color}; if (color == QLatin1String("style")) - return qMakePair(QColor(), QString()); + return {}; const QColor col('#' + color); if (!col.isValid()) { qWarning("Color \"%s\" is neither a named color nor a valid color", qPrintable(color)); - return qMakePair(Qt::black, QString()); + return {Qt::black, {}}; } - return qMakePair(col, QString()); + return {col, {}}; } QString Theme::filePath() const @@ -222,11 +221,13 @@ bool Theme::systemUsesDarkMode() constexpr char regkey[] = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; bool ok; - const auto setting = QSettings(regkey, QSettings::NativeFormat).value("AppsUseLightTheme").toInt(&ok); + const int setting = QSettings(regkey, QSettings::NativeFormat).value("AppsUseLightTheme").toInt(&ok); return ok && setting == 0; - } else if (HostOsInfo::isMacHost()) { - return macOSSystemIsDark(); } + + if (HostOsInfo::isMacHost()) + return macOSSystemIsDark(); + return false; } diff --git a/src/libs/utils/wizard.cpp b/src/libs/utils/wizard.cpp index b1072267f67..31ef7dce28e 100644 --- a/src/libs/utils/wizard.cpp +++ b/src/libs/utils/wizard.cpp @@ -208,8 +208,8 @@ void LinearProgressWidget::recreateLayout() { disableUpdates(); - QMap::ConstIterator it = m_itemToItemWidget.constBegin(); - QMap::ConstIterator itEnd = m_itemToItemWidget.constEnd(); + auto it = m_itemToItemWidget.constBegin(); + const auto itEnd = m_itemToItemWidget.constEnd(); while (it != itEnd) { it.value()->setVisible(false); ++it; @@ -243,8 +243,8 @@ void LinearProgressWidget::updateProgress() QList visitedItems = m_wizardProgress->visitedItems(); - QMap::ConstIterator it = m_itemToItemWidget.constBegin(); - QMap::ConstIterator itEnd = m_itemToItemWidget.constEnd(); + auto it = m_itemToItemWidget.constBegin(); + const auto itEnd = m_itemToItemWidget.constEnd(); while (it != itEnd) { WizardProgressItem *item = it.key(); ProgressItemWidget *itemWidget = it.value(); @@ -636,12 +636,12 @@ QList WizardProgressPrivate::singlePathBetween(WizardProgr if (item->nextItems().contains(toItem)) return {toItem}; - QHash > visitedItemsToParents; - QList > workingItems; // next to prev item + QHash> visitedItemsToParents; + QList> workingItems; // next to prev item - QList items = item->nextItems(); - for (int i = 0; i < items.count(); i++) - workingItems.append(qMakePair(items.at(i), item)); + const QList items = item->nextItems(); + for (WizardProgressItem *i : items) + workingItems.push_back({i, item}); while (!workingItems.isEmpty()) { QPair workingItem = workingItems.takeFirst(); @@ -651,16 +651,16 @@ QList WizardProgressPrivate::singlePathBetween(WizardProgr if (parents.count() > 1) continue; - QList items = workingItem.first->nextItems(); - for (int i = 0; i < items.count(); i++) - workingItems.append(qMakePair(items.at(i), workingItem.first)); + const QList items = workingItem.first->nextItems(); + for (WizardProgressItem *i : items) + workingItems.push_back({i, workingItem.first}); } QList path; WizardProgressItem *it = toItem; - QHash >::ConstIterator itItem = visitedItemsToParents.constFind(it); - QHash >::ConstIterator itEnd = visitedItemsToParents.constEnd(); + auto itItem = visitedItemsToParents.constFind(it); + const auto itEnd = visitedItemsToParents.constEnd(); while (itItem != itEnd) { path.prepend(itItem.key()); if (itItem.value().count() != 1) @@ -702,8 +702,8 @@ WizardProgress::~WizardProgress() { Q_D(WizardProgress); - QMap::ConstIterator it = d->m_itemToItem.constBegin(); - QMap::ConstIterator itEnd = d->m_itemToItem.constEnd(); + auto it = d->m_itemToItem.constBegin(); + const auto itEnd = d->m_itemToItem.constEnd(); while (it != itEnd) { delete it.key(); ++it; diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 8daa59c34e2..47ac8a746b3 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -567,14 +567,16 @@ bool AndroidBuildApkStep::init() if (m_buildAAB) arguments << "--aab" << "--jarsigner"; + if (buildType() == BuildConfiguration::Release) { + arguments << "--release"; + } + QStringList argumentsPasswordConcealed = arguments; if (m_signPackage) { - arguments << "--release" - << "--sign" << m_keystorePath.toString() << m_certificateAlias + arguments << "--sign" << m_keystorePath.toString() << m_certificateAlias << "--storepass" << m_keystorePasswd; - argumentsPasswordConcealed << "--release" - << "--sign" << "******" + argumentsPasswordConcealed << "--sign" << "******" << "--storepass" << "******"; if (!m_certificatePasswd.isEmpty()) { arguments << "--keypass" << m_certificatePasswd; diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 03795b4d349..128de01afea 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -240,6 +240,9 @@ bool AndroidDeployQtStep::init() m_androiddeployqtArgs.addArg("--gradle"); + if (buildType() == BuildConfiguration::Release) + m_androiddeployqtArgs.addArgs({"--release"}); + if (androidBuildApkStep && androidBuildApkStep->signPackage()) { // The androiddeployqt tool is not really written to do stand-alone installations. // This hack forces it to use the correct filename for the apk file when installing diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 74b40b2b02b..04bd7446b52 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -689,7 +689,7 @@ void AndroidManifestEditorWidget::updateInfoBar() void AndroidManifestEditorWidget::updateSdkVersions() { - static const QPair sdkPair = qMakePair(16, 31); + static const QPair sdkPair{16, 31}; int minSdk = sdkPair.first; const int targetSdk = sdkPair.second; const Target *target = androidTarget(m_textEditorWidget->textDocument()->filePath()); diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index b318c2b1f03..0fed77d2312 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -706,7 +706,7 @@ QPair SdkManagerOutputParser::parseSystemImage(const QString image->setDisplayText(packageData.description); image->setDescriptionText(packageData.description); image->setApiLevel(apiLevel); - result = qMakePair(image, apiLevel); + result = {image, apiLevel}; } else { qCDebug(sdkManagerLog) << "System-image: Minimum required data unavailable: "<< data; } diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp index d180d690944..a96c5bba21c 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp @@ -4,6 +4,7 @@ #include "autogenstep.h" #include "autotoolsprojectconstants.h" +#include "autotoolsprojectmanagertr.h" #include #include @@ -19,8 +20,7 @@ using namespace ProjectExplorer; using namespace Utils; -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { // AutogenStep @@ -35,8 +35,6 @@ namespace Internal { class AutogenStep final : public AbstractProcessStep { - Q_DECLARE_TR_FUNCTIONS(AutotoolsProjectManager::Internal::AutogenStep) - public: AutogenStep(BuildStepList *bsl, Id id); @@ -50,7 +48,7 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, i { auto arguments = addAspect(); arguments->setSettingsKey("AutotoolsProjectManager.AutogenStep.AdditionalArguments"); - arguments->setLabelText(tr("Arguments:")); + arguments->setLabelText(Tr::tr("Arguments:")); arguments->setDisplayStyle(StringAspect::LineEditDisplay); arguments->setHistoryCompleter("AutotoolsPM.History.AutogenStepArgs"); @@ -86,7 +84,8 @@ void AutogenStep::doRun() } if (!m_runAutogen) { - emit addOutput(tr("Configuration unchanged, skipping autogen step."), BuildStep::OutputFormat::NormalMessage); + emit addOutput(Tr::tr("Configuration unchanged, skipping autogen step."), + OutputFormat::NormalMessage); emit finished(true); return; } @@ -106,10 +105,9 @@ void AutogenStep::doRun() AutogenStepFactory::AutogenStepFactory() { registerStep(Constants::AUTOGEN_STEP_ID); - setDisplayName(AutogenStep::tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id.")); + setDisplayName(Tr::tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id.")); setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID); setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); } -} // Internal -} // AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.h b/src/plugins/autotoolsprojectmanager/autogenstep.h index ecb1cbc6917..05185d62cbe 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.h +++ b/src/plugins/autotoolsprojectmanager/autogenstep.h @@ -5,8 +5,7 @@ #include -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { class AutogenStepFactory final : public ProjectExplorer::BuildStepFactory { @@ -14,5 +13,4 @@ public: AutogenStepFactory(); }; -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp index 6ffb12cc51c..65caaf13876 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp @@ -4,6 +4,7 @@ #include "autoreconfstep.h" #include "autotoolsprojectconstants.h" +#include "autotoolsprojectmanagertr.h" #include #include @@ -17,8 +18,7 @@ using namespace ProjectExplorer; using namespace Utils; -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { // AutoreconfStep class @@ -33,8 +33,6 @@ namespace Internal { class AutoreconfStep final : public AbstractProcessStep { - Q_DECLARE_TR_FUNCTIONS(AutotoolsProjectManager::Internal::AutoreconfStep) - public: AutoreconfStep(BuildStepList *bsl, Id id); @@ -49,7 +47,7 @@ AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Id id) { auto arguments = addAspect(); arguments->setSettingsKey("AutotoolsProjectManager.AutoreconfStep.AdditionalArguments"); - arguments->setLabelText(tr("Arguments:")); + arguments->setLabelText(Tr::tr("Arguments:")); arguments->setValue("--force --install"); arguments->setDisplayStyle(StringAspect::LineEditDisplay); arguments->setHistoryCompleter("AutotoolsPM.History.AutoreconfStepArgs"); @@ -80,7 +78,8 @@ void AutoreconfStep::doRun() m_runAutoreconf = true; if (!m_runAutoreconf) { - emit addOutput(tr("Configuration unchanged, skipping autoreconf step."), OutputFormat::NormalMessage); + emit addOutput(Tr::tr("Configuration unchanged, skipping autoreconf step."), + OutputFormat::NormalMessage); emit finished(true); return; } @@ -100,10 +99,9 @@ void AutoreconfStep::doRun() AutoreconfStepFactory::AutoreconfStepFactory() { registerStep(Constants::AUTORECONF_STEP_ID); - setDisplayName(AutoreconfStep::tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id.")); + setDisplayName(Tr::tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id.")); setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID); setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); } -} // Internal -} // AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.h b/src/plugins/autotoolsprojectmanager/autoreconfstep.h index 7c6ba164f10..9d97ecb99b1 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.h +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.h @@ -5,8 +5,7 @@ #include -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { class AutoreconfStepFactory final : public ProjectExplorer::BuildStepFactory { @@ -14,5 +13,4 @@ public: AutoreconfStepFactory(); }; -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index cbf997dc435..8081905d124 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -4,6 +4,7 @@ #include "autotoolsbuildconfiguration.h" #include "autotoolsprojectconstants.h" +#include "autotoolsprojectmanagertr.h" #include #include @@ -14,15 +15,12 @@ using namespace ProjectExplorer; using namespace Utils; -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { // AutotoolsBuildConfiguration class AutotoolsBuildConfiguration : public BuildConfiguration { - Q_DECLARE_TR_FUNCTIONS(AutotoolsProjectManager::Internal::AutotoolsBuildConfiguration) - public: AutotoolsBuildConfiguration(Target *target, Id id) : BuildConfiguration(target, id) @@ -31,7 +29,7 @@ public: // The leading / is to avoid the relative the path expansion in BuildConfiguration::buildDirectory. setBuildDirectory("/"); setBuildDirectoryHistoryCompleter("AutoTools.BuildDir.History"); - setConfigWidgetDisplayName(tr("Autotools Manager")); + setConfigWidgetDisplayName(Tr::tr("Autotools Manager")); // ### Build Steps Build ### const FilePath autogenFile = target->project()->projectDirectory() / "autogen.sh"; @@ -69,5 +67,4 @@ AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory() }); } -} // Internal -} // AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h index db25b711fc7..e5246ddd43a 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h @@ -5,8 +5,7 @@ #include -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { class AutotoolsBuildConfigurationFactory final : public ProjectExplorer::BuildConfigurationFactory { @@ -14,5 +13,4 @@ public: AutotoolsBuildConfigurationFactory(); }; -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.cpp index 74077fdc4ff..4d38b63fe47 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.cpp @@ -4,7 +4,6 @@ #include "autotoolsbuildsystem.h" #include "makefileparserthread.h" -#include "makestep.h" #include #include @@ -12,19 +11,18 @@ #include #include +#include using namespace ProjectExplorer; -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { AutotoolsBuildSystem::AutotoolsBuildSystem(Target *target) : BuildSystem(target) , m_cppCodeModelUpdater(new CppEditor::CppProjectUpdater) { - connect(target, &Target::activeBuildConfigurationChanged, this, [this]() { requestParse(); }); - - connect(target->project(), &Project::projectFileIsDirty, this, [this]() { requestParse(); }); + connect(target, &Target::activeBuildConfigurationChanged, this, [this] { requestParse(); }); + connect(target->project(), &Project::projectFileIsDirty, this, [this] { requestParse(); }); } AutotoolsBuildSystem::~AutotoolsBuildSystem() @@ -158,5 +156,4 @@ void AutotoolsBuildSystem::updateCppCodeModel() m_cppCodeModelUpdater->update({project(), kitInfo, activeParseEnvironment(), {rpp}}); } -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.h index 145244bab09..50cb077044a 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsystem.h @@ -9,8 +9,7 @@ namespace CppEditor { class CppProjectUpdater; } -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { class MakefileParserThread; @@ -46,5 +45,4 @@ private: CppEditor::CppProjectUpdater *m_cppCodeModelUpdater = nullptr; }; -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp index 56f0e8f2e27..3f4bfdded44 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp @@ -14,23 +14,36 @@ #include #include +#include #include #include -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { -AutotoolsProject::AutotoolsProject(const Utils::FilePath &fileName) - : Project(Constants::MAKEFILE_MIMETYPE, fileName) +/** + * @brief Implementation of the ProjectExplorer::Project interface. + * + * Loads the autotools project and embeds it into the QtCreator project tree. + * The class AutotoolsProject is the core of the autotools project plugin. + * It is responsible to parse the Makefile.am files and do trigger project + * updates if a Makefile.am file or a configure.ac file has been changed. + */ +class AutotoolsProject : public ProjectExplorer::Project { - setId(Constants::AUTOTOOLS_PROJECT_ID); - setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID)); - setDisplayName(projectDirectory().fileName()); +public: + explicit AutotoolsProject(const Utils::FilePath &fileName) + : Project(Constants::MAKEFILE_MIMETYPE, fileName) + { + setId(Constants::AUTOTOOLS_PROJECT_ID); + setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID)); + setDisplayName(projectDirectory().fileName()); - setHasMakeInstallEquivalent(true); + setHasMakeInstallEquivalent(true); + + setBuildSystemCreator([](ProjectExplorer::Target *t) { return new AutotoolsBuildSystem(t); }); + } +}; - setBuildSystemCreator([](ProjectExplorer::Target *t) { return new AutotoolsBuildSystem(t); }); -} class AutotoolsProjectPluginPrivate { @@ -50,8 +63,7 @@ AutotoolsProjectPlugin::~AutotoolsProjectPlugin() void AutotoolsProjectPlugin::extensionsInitialized() { } -bool AutotoolsProjectPlugin::initialize(const QStringList &arguments, - QString *errorString) +bool AutotoolsProjectPlugin::initialize(const QStringList &arguments, QString *errorString) { Q_UNUSED(arguments) Q_UNUSED(errorString) @@ -62,5 +74,4 @@ bool AutotoolsProjectPlugin::initialize(const QStringList &arguments, return true; } -} // namespace Internal -} // AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h index 6bd0fd64053..2c8eff6aa47 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.h @@ -3,12 +3,9 @@ #pragma once -#include - #include -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { /** * @brief Implementation of the ExtensionsSystem::IPlugin interface. @@ -51,19 +48,4 @@ class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin class AutotoolsProjectPluginPrivate *d; }; -/** - * @brief Implementation of the ProjectExplorer::Project interface. - * - * Loads the autotools project and embeds it into the QtCreator project tree. - * The class AutotoolsProject is the core of the autotools project plugin. - * It is responsible to parse the Makefile.am files and do trigger project - * updates if a Makefile.am file or a configure.ac file has been changed. - */ -class AutotoolsProject : public ProjectExplorer::Project -{ -public: - explicit AutotoolsProject(const Utils::FilePath &fileName); -}; - -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp index 9926c7ab697..e2abc5c6569 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.cpp +++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp @@ -3,8 +3,8 @@ #include "configurestep.h" -#include "autotoolsbuildconfiguration.h" #include "autotoolsprojectconstants.h" +#include "autotoolsprojectmanagertr.h" #include #include @@ -20,8 +20,7 @@ using namespace ProjectExplorer; using namespace Utils; -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { // Helper Function @@ -52,8 +51,6 @@ static QString projectDirRelativeToBuildDir(BuildConfiguration *bc) class ConfigureStep final : public AbstractProcessStep { - Q_DECLARE_TR_FUNCTIONS(AutotoolsProjectManager::Internal::ConfigureStep) - public: ConfigureStep(BuildStepList *bsl, Id id); @@ -73,7 +70,7 @@ ConfigureStep::ConfigureStep(BuildStepList *bsl, Id id) auto arguments = addAspect(); arguments->setDisplayStyle(StringAspect::LineEditDisplay); arguments->setSettingsKey("AutotoolsProjectManager.ConfigureStep.AdditionalArguments"); - arguments->setLabelText(tr("Arguments:")); + arguments->setLabelText(Tr::tr("Arguments:")); arguments->setHistoryCompleter("AutotoolsPM.History.ConfigureArgs"); connect(arguments, &BaseAspect::changed, this, [this] { @@ -116,7 +113,7 @@ void ConfigureStep::doRun() } if (!m_runConfigure) { - emit addOutput(tr("Configuration unchanged, skipping configure step."), OutputFormat::NormalMessage); + emit addOutput(Tr::tr("Configuration unchanged, skipping configure step."), OutputFormat::NormalMessage); emit finished(true); return; } @@ -142,10 +139,9 @@ void ConfigureStep::doRun() ConfigureStepFactory::ConfigureStepFactory() { registerStep(Constants::CONFIGURE_STEP_ID); - setDisplayName(ConfigureStep::tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id.")); + setDisplayName(Tr::tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id.")); setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID); setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); } -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/configurestep.h b/src/plugins/autotoolsprojectmanager/configurestep.h index 76864fe2ec3..ed59a3e53c8 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.h +++ b/src/plugins/autotoolsprojectmanager/configurestep.h @@ -5,8 +5,7 @@ #include -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { class ConfigureStepFactory final : public ProjectExplorer::BuildStepFactory { @@ -14,5 +13,4 @@ public: ConfigureStepFactory(); }; -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp index 85a9cb00b42..91169bb8f2e 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp +++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp @@ -3,6 +3,8 @@ #include "makefileparser.h" +#include "autotoolsprojectmanagertr.h" + #include #include #include @@ -11,7 +13,7 @@ #include #include -using namespace AutotoolsProjectManager::Internal; +namespace AutotoolsProjectManager::Internal { MakefileParser::MakefileParser(const QString &makefile) : m_makefile(makefile) { } @@ -40,7 +42,7 @@ bool MakefileParser::parse() QFileInfo info(m_makefile); m_makefiles.append(info.fileName()); - emit status(tr("Parsing %1 in directory %2").arg(info.fileName()).arg(info.absolutePath())); + emit status(Tr::tr("Parsing %1 in directory %2").arg(info.fileName()).arg(info.absolutePath())); m_textStream.setDevice(file); @@ -237,7 +239,7 @@ void MakefileParser::parseSubDirs() // Delegate the parsing of all sub directories to a local // makefile parser and merge the results - foreach (const QString& subDir, subDirs) { + for (const QString &subDir : qAsConst(subDirs)) { const QChar slash = QLatin1Char('/'); const QString subDirMakefile = path + slash + subDir + slash + makefileName; @@ -298,7 +300,7 @@ QStringList MakefileParser::directorySources(const QString &directory, return QStringList(); } - emit status(tr("Parsing directory %1").arg(directory)); + emit status(Tr::tr("Parsing directory %1").arg(directory)); QStringList list; // return value @@ -550,3 +552,5 @@ void MakefileParser::parseIncludePaths() m_cflags.removeDuplicates(); m_cxxflags.removeDuplicates(); } + +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.h b/src/plugins/autotoolsprojectmanager/makefileparser.h index 275340b321d..4ffb94de4c2 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.h +++ b/src/plugins/autotoolsprojectmanager/makefileparser.h @@ -14,8 +14,7 @@ QT_FORWARD_DECLARE_CLASS(QDir) -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { /** * @brief Parses the autotools makefile Makefile.am. @@ -258,5 +257,4 @@ private: QTextStream m_textStream; ///< Textstream that represents the makefile }; -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/makefileparserthread.cpp b/src/plugins/autotoolsprojectmanager/makefileparserthread.cpp index 685b73a70ed..6321db32d33 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparserthread.cpp +++ b/src/plugins/autotoolsprojectmanager/makefileparserthread.cpp @@ -5,7 +5,7 @@ #include -using namespace AutotoolsProjectManager::Internal; +namespace AutotoolsProjectManager::Internal { MakefileParserThread::MakefileParserThread(ProjectExplorer::BuildSystem *bs) : m_parser(bs->projectFilePath().toString()), @@ -92,3 +92,5 @@ void MakefileParserThread::run() m_cflags = m_parser.cflags(); m_cxxflags = m_parser.cxxflags(); } + +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/makefileparserthread.h b/src/plugins/autotoolsprojectmanager/makefileparserthread.h index 43cb6c67b6d..23901ecafa8 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparserthread.h +++ b/src/plugins/autotoolsprojectmanager/makefileparserthread.h @@ -13,8 +13,7 @@ #include #include -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { /** * @brief Executes the makefile parser in the thread. @@ -129,5 +128,4 @@ private: ProjectExplorer::BuildSystem::ParseGuard m_guard; }; -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/makestep.cpp b/src/plugins/autotoolsprojectmanager/makestep.cpp index dba3e01825a..20ebe5b630e 100644 --- a/src/plugins/autotoolsprojectmanager/makestep.cpp +++ b/src/plugins/autotoolsprojectmanager/makestep.cpp @@ -9,28 +9,25 @@ using namespace AutotoolsProjectManager::Constants; -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { // MakeStep class MakeStep : public ProjectExplorer::MakeStep { public: - MakeStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); -}; - -MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id) - : ProjectExplorer::MakeStep(bsl, id) -{ - setAvailableBuildTargets({"all", "clean"}); - if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) { - setSelectedBuildTarget("clean"); - setIgnoreReturnValue(true); - } else { - setSelectedBuildTarget("all"); + MakeStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id) + : ProjectExplorer::MakeStep(bsl, id) + { + setAvailableBuildTargets({"all", "clean"}); + if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) { + setSelectedBuildTarget("clean"); + setIgnoreReturnValue(true); + } else { + setSelectedBuildTarget("all"); + } } -} +}; // MakeStepFactory @@ -41,5 +38,4 @@ MakeStepFactory::MakeStepFactory() setSupportedProjectType(AUTOTOOLS_PROJECT_ID); } -} // Internal -} // AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/autotoolsprojectmanager/makestep.h b/src/plugins/autotoolsprojectmanager/makestep.h index 5ea0572fc9c..96c19d94832 100644 --- a/src/plugins/autotoolsprojectmanager/makestep.h +++ b/src/plugins/autotoolsprojectmanager/makestep.h @@ -5,8 +5,7 @@ #include -namespace AutotoolsProjectManager { -namespace Internal { +namespace AutotoolsProjectManager::Internal { class MakeStepFactory final : public ProjectExplorer::BuildStepFactory { @@ -14,5 +13,4 @@ public: MakeStepFactory(); }; -} // namespace Internal -} // namespace AutotoolsProjectManager +} // AutotoolsProjectManager::Internal diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index 87db4074fb2..b0bdef80d50 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -834,7 +834,8 @@ bool BazaarPluginPrivate::submitEditorAboutToClose() if (!commitWidget->committer().isEmpty()) extraOptions.append(QLatin1String("--author=") + commitWidget->committer()); // Fixed bugs - foreach (const QString &fix, commitWidget->fixedBugs()) { + const QStringList fixes = commitWidget->fixedBugs(); + for (const QString &fix : fixes) { if (!fix.isEmpty()) extraOptions << QLatin1String("--fixes") << fix; } @@ -864,7 +865,7 @@ void BazaarPluginPrivate::updateActions(VcsBasePluginPrivate::ActionState as) m_revertFile->setParameter(filename); m_statusFile->setParameter(filename); - foreach (QAction *repoAction, m_repositoryActionList) + for (QAction *repoAction : qAsConst(m_repositoryActionList)) repoAction->setEnabled(repoEnabled); } diff --git a/src/plugins/bazaar/commiteditor.cpp b/src/plugins/bazaar/commiteditor.cpp index 2ceb0b6c939..a26cc682bef 100644 --- a/src/plugins/bazaar/commiteditor.cpp +++ b/src/plugins/bazaar/commiteditor.cpp @@ -26,9 +26,9 @@ BazaarCommitWidget *CommitEditor::commitWidget() return static_cast(widget()); } -void CommitEditor::setFields(const QString &repositoryRoot, - const BranchInfo &branch, const QString &userName, - const QString &email, const QList &repoStatus) +void CommitEditor::setFields(const QString &repositoryRoot, const BranchInfo &branch, + const QString &userName, const QString &email, + const QList &repoStatus) { BazaarCommitWidget *bazaarWidget = commitWidget(); if (!bazaarWidget) @@ -50,7 +50,7 @@ void CommitEditor::setFields(const QString &repositoryRoot, return VcsBase::SubmitFileModel::FileStatusUnknown; } ); - foreach (const VcsBase::VcsBaseClient::StatusItem &item, repoStatus) + for (const VcsBase::VcsBaseClient::StatusItem &item : repoStatus) if (item.flags != QLatin1String("Unknown")) m_fileModel->addFile(item.file, item.flags); setFileModel(m_fileModel); diff --git a/src/plugins/bineditor/bineditorconstants.h b/src/plugins/bineditor/bineditorconstants.h index 53e1281e719..4c8ef9b50c6 100644 --- a/src/plugins/bineditor/bineditorconstants.h +++ b/src/plugins/bineditor/bineditorconstants.h @@ -3,13 +3,10 @@ #pragma once -namespace BinEditor { -namespace Constants { +namespace BinEditor::Constants { const char C_BINEDITOR[] = "BinEditor.BinaryEditor"; -const char C_BINEDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Binary Editor"); const char C_BINEDITOR_MIMETYPE[] = "application/octet-stream"; const char C_ENCODING_SETTING[] = "BinEditor/TextEncoding"; -} // namespace Constants -} // namespace BinEditor +} // BinEditor::Constants diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 13bb6d5c963..0cdb355537b 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -2,26 +2,24 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "bineditorplugin.h" -#include "bineditorwidget.h" + #include "bineditorconstants.h" #include "bineditorservice.h" +#include "bineditortr.h" +#include "bineditorwidget.h" +#include #include + #include -#include -#include -#include -#include -#include -#include - -#include #include -#include #include #include +#include +#include #include +#include #include #include @@ -30,6 +28,7 @@ #include #include #include + #include #include @@ -38,13 +37,16 @@ using namespace Utils; using namespace Core; -namespace BinEditor { -namespace Internal { +namespace BinEditor::Internal { + +class BinEditorFactory final : public IEditorFactory +{ +public: + BinEditorFactory(); +}; class BinEditorFind : public IFindSupport { - Q_OBJECT - public: BinEditorFind(BinEditorWidget *widget) { @@ -232,31 +234,31 @@ public: { const qint64 size = filePath.fileSize(); if (size < 0) { - QString msg = tr("Cannot open %1: %2").arg(filePath.toUserOutput(), tr("File Error")); + QString msg = Tr::tr("Cannot open %1: %2").arg(filePath.toUserOutput(), Tr::tr("File Error")); // FIXME: Was: file.errorString(), but we don't have a file anymore. if (errorString) *errorString = msg; else - QMessageBox::critical(ICore::dialogParent(), tr("File Error"), msg); + QMessageBox::critical(ICore::dialogParent(), Tr::tr("File Error"), msg); return OpenResult::ReadError; } if (size == 0) { - QString msg = tr("The Binary Editor cannot open empty files."); + QString msg = Tr::tr("The Binary Editor cannot open empty files."); if (errorString) *errorString = msg; else - QMessageBox::critical(ICore::dialogParent(), tr("File Error"), msg); + QMessageBox::critical(ICore::dialogParent(), Tr::tr("File Error"), msg); return OpenResult::CannotHandle; } if (size / 16 >= qint64(1) << 31) { // The limit is 2^31 lines (due to QText* interfaces) * 16 bytes per line. - QString msg = tr("The file is too big for the Binary Editor (max. 32GB)."); + QString msg = Tr::tr("The file is too big for the Binary Editor (max. 32GB)."); if (errorString) *errorString = msg; else - QMessageBox::critical(ICore::dialogParent(), tr("File Error"), msg); + QMessageBox::critical(ICore::dialogParent(), Tr::tr("File Error"), msg); return OpenResult::CannotHandle; } @@ -279,8 +281,8 @@ public: if (dataSize != blockSize) data += QByteArray(blockSize - dataSize, 0); m_widget->addData(address, data); -// QMessageBox::critical(ICore::dialogParent(), tr("File Error"), -// tr("Cannot open %1: %2").arg( +// QMessageBox::critical(ICore::dialogParent(), Tr::tr("File Error"), +// Tr::tr("Cannot open %1: %2").arg( // fn.toUserOutput(), file.errorString())); } @@ -415,7 +417,7 @@ BinEditorPluginPrivate::BinEditorPluginPrivate() ExtensionSystem::PluginManager::addObject(&m_editorFactory); m_undoAction = new QAction(BinEditorPlugin::tr("&Undo"), this); - m_redoAction = new QAction(BinEditorPlugin::tr("&Redo"), this); + m_redoAction = new QAction(Tr::tr("&Redo"), this); m_copyAction = new QAction(this); m_selectAllAction = new QAction(this); @@ -442,7 +444,7 @@ static BinEditorPluginPrivate *dd = nullptr; BinEditorFactory::BinEditorFactory() { setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID); - setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::C_BINEDITOR_DISPLAY_NAME)); + setDisplayName(QCoreApplication::translate("OpenWith::Editors", "Binary Editor")); addMimeType(Constants::C_BINEDITOR_MIMETYPE); setEditorCreator([] { @@ -510,7 +512,6 @@ bool BinEditorPlugin::initialize(const QStringList &arguments, QString *errorMes return true; } -} // namespace Internal -} // namespace BinEditor +} // BinEditor::Internal #include "bineditorplugin.moc" diff --git a/src/plugins/bineditor/bineditorplugin.h b/src/plugins/bineditor/bineditorplugin.h index ecba761123d..8be06a521a4 100644 --- a/src/plugins/bineditor/bineditorplugin.h +++ b/src/plugins/bineditor/bineditorplugin.h @@ -6,10 +6,8 @@ #include "bineditorservice.h" #include -#include -namespace BinEditor { -namespace Internal { +namespace BinEditor::Internal { class BinEditorPlugin : public ExtensionSystem::IPlugin { @@ -22,12 +20,6 @@ class BinEditorPlugin : public ExtensionSystem::IPlugin void extensionsInitialized() final {} }; -class BinEditorFactory final : public Core::IEditorFactory -{ -public: - BinEditorFactory(); -}; - class FactoryServiceImpl : public QObject, public FactoryService { Q_OBJECT @@ -37,5 +29,4 @@ public: EditorService *createEditorService(const QString &title0, bool wantsEditor) final; }; -} // namespace Internal -} // namespace BinEditor +} // BinEditor::Internal diff --git a/src/plugins/bineditor/bineditortr.h b/src/plugins/bineditor/bineditortr.h index fd13b1cb81f..630d4d56e18 100644 --- a/src/plugins/bineditor/bineditortr.h +++ b/src/plugins/bineditor/bineditortr.h @@ -12,4 +12,4 @@ struct Tr Q_DECLARE_TR_FUNCTIONS(BinEditor) }; -} // namespace BinEditor +} // BinEditor diff --git a/src/plugins/bineditor/bineditorwidget.cpp b/src/plugins/bineditor/bineditorwidget.cpp index a6f77425ca9..5a3e47229ce 100644 --- a/src/plugins/bineditor/bineditorwidget.cpp +++ b/src/plugins/bineditor/bineditorwidget.cpp @@ -2,8 +2,10 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "bineditorwidget.h" + #include "bineditorconstants.h" #include "bineditorservice.h" +#include "bineditortr.h" #include "markup.h" #include @@ -42,8 +44,7 @@ using namespace Core; using namespace Utils; -namespace BinEditor { -namespace Internal { +namespace BinEditor::Internal { const QChar MidpointChar(u'\u00B7'); @@ -1218,7 +1219,7 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const QString msg; QTextStream str(&msg); str << "

" - << tr("Memory at 0x%1").arg(address, 0, 16) << "

"; + << Tr::tr("Memory at 0x%1").arg(address, 0, 16) << "

"; for (const Markup &m : qAsConst(m_markup)) { if (m.covers(address) && !m.toolTip.isEmpty()) { @@ -1226,16 +1227,16 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const break; } } - const QString msgDecimalUnsigned = tr("Decimal unsigned value:"); - const QString msgDecimalSigned = tr("Decimal signed value:"); - const QString msgOldDecimalUnsigned = tr("Previous decimal unsigned value:"); - const QString msgOldDecimalSigned = tr("Previous decimal signed value:"); + const QString msgDecimalUnsigned = Tr::tr("Decimal unsigned value:"); + const QString msgDecimalSigned = Tr::tr("Decimal signed value:"); + const QString msgOldDecimalUnsigned = Tr::tr("Previous decimal unsigned value:"); + const QString msgOldDecimalSigned = Tr::tr("Previous decimal signed value:"); // Table showing little vs. big endian integers for multi-byte if (intSize > 1) { str << ""; + << Tr::tr("%1-bit Integer Type").arg(8 * intSize) << ""; str << tableRowStartC << msgDecimalUnsigned << numericTableRowSepC << littleEndianValue << numericTableRowSepC << bigEndianValue << tableRowEndC << tableRowStartC << msgDecimalSigned @@ -1261,14 +1262,14 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const str << tableRowStartC << msgDecimalSigned << numericTableRowSepC << littleEndianSigned << tableRowEndC; } - str << tableRowStartC << tr("Binary value:") << numericTableRowSepC; + str << tableRowStartC << Tr::tr("Binary value:") << numericTableRowSepC; str.setIntegerBase(2); str.setFieldWidth(8); str.setPadChar(QLatin1Char('0')); str << littleEndianValue; str.setFieldWidth(0); str << tableRowEndC << tableRowStartC - << tr("Octal value:") << numericTableRowSepC; + << Tr::tr("Octal value:") << numericTableRowSepC; str.setIntegerBase(8); str.setFieldWidth(3); str << littleEndianValue << tableRowEndC; @@ -1281,13 +1282,13 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const str << tableRowStartC << msgOldDecimalSigned << numericTableRowSepC << littleEndianSignedOld << tableRowEndC; } - str << tableRowStartC << tr("Previous binary value:") + str << tableRowStartC << Tr::tr("Previous binary value:") << numericTableRowSepC; str.setIntegerBase(2); str.setFieldWidth(8); str << littleEndianValueOld; str.setFieldWidth(0); - str << tableRowEndC << tableRowStartC << tr("Previous octal value:") + str << tableRowEndC << tableRowStartC << Tr::tr("Previous octal value:") << numericTableRowSepC; str.setIntegerBase(8); str.setFieldWidth(3); @@ -1303,10 +1304,10 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const double doubleValue, doubleValueOld; asDouble(selStart, doubleValue, false); asDouble(selStart, doubleValueOld, true); - str << tableRowStartC << tr("double value:") << numericTableRowSepC + str << tableRowStartC << Tr::tr("double value:") << numericTableRowSepC << doubleValue << tableRowEndC; if (doubleValue != doubleValueOld) - str << tableRowStartC << tr("Previous double value:") << numericTableRowSepC + str << tableRowStartC << Tr::tr("Previous double value:") << numericTableRowSepC << doubleValueOld << tableRowEndC; str << "
" - << tr("%1-bit Integer Type").arg(8 * intSize) << "" - << tr("Little Endian") << "" << tr("Big Endian") << "
" + << Tr::tr("Little Endian") << "" << Tr::tr("Big Endian") << "
"; } @@ -1317,10 +1318,10 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const float floatValue, floatValueOld; asFloat(selStart, floatValue, false); asFloat(selStart, floatValueOld, true); - str << tableRowStartC << tr("float value:") << numericTableRowSepC + str << tableRowStartC << Tr::tr("float value:") << numericTableRowSepC << floatValue << tableRowEndC; if (floatValue != floatValueOld) - str << tableRowStartC << tr("Previous float value:") << numericTableRowSepC + str << tableRowStartC << Tr::tr("Previous float value:") << numericTableRowSepC << floatValueOld << tableRowEndC; str << ""; @@ -1441,8 +1442,7 @@ void BinEditorWidget::keyPressEvent(QKeyEvent *e) static void showZoomIndicator(QWidget *editor, const int newZoom) { Utils::FadingIndicator::showText(editor, - QCoreApplication::translate("BinEditorWidget::TextEditorWidget", - "Zoom: %1%").arg(newZoom), + Tr::tr("Zoom: %1%").arg(newZoom), Utils::FadingIndicator::SmallText); } @@ -1465,8 +1465,8 @@ void BinEditorWidget::copy(bool raw) int selEnd = selectionEnd(); const int selectionLength = selEnd - selStart + 1; if (selectionLength >> 22) { - QMessageBox::warning(this, tr("Copying Failed"), - tr("You cannot copy more than 4 MB of binary data.")); + QMessageBox::warning(this, Tr::tr("Copying Failed"), + Tr::tr("You cannot copy more than 4 MB of binary data.")); return; } QByteArray data = dataMid(selStart, selectionLength); @@ -1577,15 +1577,15 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event) QPointer contextMenu(new QMenu(this)); - auto copyAsciiAction = new QAction(tr("Copy Selection as ASCII Characters"), contextMenu); - auto copyHexAction = new QAction(tr("Copy Selection as Hex Values"), contextMenu); + auto copyAsciiAction = new QAction(Tr::tr("Copy Selection as ASCII Characters"), contextMenu); + auto copyHexAction = new QAction(Tr::tr("Copy Selection as Hex Values"), contextMenu); auto copyBeValue = new QAction(contextMenu); auto copyLeValue = new QAction(contextMenu); auto jumpToBeAddressHereAction = new QAction(contextMenu); auto jumpToBeAddressNewWindowAction = new QAction(contextMenu); auto jumpToLeAddressHereAction = new QAction(contextMenu); auto jumpToLeAddressNewWindowAction = new QAction(contextMenu); - auto addWatchpointAction = new QAction(tr("Set Data Breakpoint on Selection"), contextMenu); + auto addWatchpointAction = new QAction(Tr::tr("Set Data Breakpoint on Selection"), contextMenu); contextMenu->addAction(copyAsciiAction); contextMenu->addAction(copyHexAction); contextMenu->addAction(addWatchpointAction); @@ -1596,11 +1596,11 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event) quint64 leAddress = 0; if (byteCount <= 8) { asIntegers(selStart, byteCount, beAddress, leAddress); - copyBeValue->setText(tr("Copy 0x%1").arg(QString::number(beAddress, 16))); + copyBeValue->setText(Tr::tr("Copy 0x%1").arg(QString::number(beAddress, 16))); contextMenu->addAction(copyBeValue); // If the menu entries would be identical, show only one of them. if (beAddress != leAddress) { - copyLeValue->setText(tr("Copy 0x%1").arg(QString::number(leAddress, 16))); + copyLeValue->setText(Tr::tr("Copy 0x%1").arg(QString::number(leAddress, 16))); contextMenu->addAction(copyLeValue); } setupJumpToMenuAction(contextMenu, jumpToBeAddressHereAction, @@ -1611,9 +1611,9 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event) jumpToLeAddressNewWindowAction, leAddress); } } else { - jumpToBeAddressHereAction->setText(tr("Jump to Address in This Window")); - jumpToBeAddressNewWindowAction->setText(tr("Jump to Address in New Window")); - copyBeValue->setText(tr("Copy Value")); + jumpToBeAddressHereAction->setText(Tr::tr("Jump to Address in This Window")); + jumpToBeAddressNewWindowAction->setText(Tr::tr("Jump to Address in New Window")); + copyBeValue->setText(Tr::tr("Copy Value")); jumpToBeAddressHereAction->setEnabled(false); jumpToBeAddressNewWindowAction->setEnabled(false); copyBeValue->setEnabled(false); @@ -1650,9 +1650,9 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event) void BinEditorWidget::setupJumpToMenuAction(QMenu *menu, QAction *actionHere, QAction *actionNew, quint64 addr) { - actionHere->setText(tr("Jump to Address 0x%1 in This Window") + actionHere->setText(Tr::tr("Jump to Address 0x%1 in This Window") .arg(QString::number(addr, 16))); - actionNew->setText(tr("Jump to Address 0x%1 in New Window") + actionNew->setText(Tr::tr("Jump to Address 0x%1 in New Window") .arg(QString::number(addr, 16))); menu->addAction(actionHere); menu->addAction(actionNew); @@ -1735,5 +1735,4 @@ void BinEditorWidget::setMarkup(const QList &markup) viewport()->update(); } -} // namespace Internal -} // namespace BinEditor +} // BinEditor::Internal diff --git a/src/plugins/bineditor/bineditorwidget.h b/src/plugins/bineditor/bineditorwidget.h index 596f98b3c3f..c09885575df 100644 --- a/src/plugins/bineditor/bineditorwidget.h +++ b/src/plugins/bineditor/bineditorwidget.h @@ -31,8 +31,7 @@ namespace Core { class IEditor; } namespace TextEditor { class FontSettings; } -namespace BinEditor { -namespace Internal { +namespace BinEditor::Internal { class BinEditorWidgetPrivate; @@ -228,5 +227,4 @@ private: QList m_markup; }; -} // namespace Internal -} // namespace BinEditor +} // BinEditor::Internal diff --git a/src/plugins/bineditor/markup.h b/src/plugins/bineditor/markup.h index 026fa7e1e89..cbda93b1428 100644 --- a/src/plugins/bineditor/markup.h +++ b/src/plugins/bineditor/markup.h @@ -23,6 +23,6 @@ public: QString toolTip; }; -} // namespace BinEditor +} // BinEditor Q_DECLARE_METATYPE(BinEditor::Markup) diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp index fead3df3ed9..e99a2214357 100644 --- a/src/plugins/bookmarks/bookmark.cpp +++ b/src/plugins/bookmarks/bookmark.cpp @@ -2,25 +2,26 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "bookmark.h" + #include "bookmarkmanager.h" #include "bookmarks_global.h" +#include "bookmarkstr.h" #include -#include -#include #include -using namespace Bookmarks::Internal; using namespace Utils; +namespace Bookmarks::Internal { + Bookmark::Bookmark(int lineNumber, BookmarkManager *manager) : TextMark(FilePath(), lineNumber, Constants::BOOKMARKS_TEXT_MARK_CATEGORY), m_manager(manager) { - setColor(Utils::Theme::Bookmarks_TextMarkColor); - setIcon(Utils::Icons::BOOKMARK_TEXTEDITOR.icon()); - setDefaultToolTip(QApplication::translate("BookmarkManager", "Bookmark")); + setColor(Theme::Bookmarks_TextMarkColor); + setIcon(Icons::BOOKMARK_TEXTEDITOR.icon()); + setDefaultToolTip(Tr::tr("Bookmark")); setPriority(TextEditor::TextMark::NormalPriority); } @@ -94,3 +95,5 @@ QString Bookmark::note() const { return toolTip(); } + +} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h index 38a177e484a..93f5b8a88ae 100644 --- a/src/plugins/bookmarks/bookmark.h +++ b/src/plugins/bookmarks/bookmark.h @@ -5,8 +5,7 @@ #include -namespace Bookmarks { -namespace Internal { +namespace Bookmarks::Internal { class BookmarkManager; @@ -35,5 +34,4 @@ private: QString m_lineText; }; -} // namespace Internal -} // namespace Bookmarks +} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarkfilter.cpp b/src/plugins/bookmarks/bookmarkfilter.cpp index c17c134b379..493c5916d32 100644 --- a/src/plugins/bookmarks/bookmarkfilter.cpp +++ b/src/plugins/bookmarks/bookmarkfilter.cpp @@ -9,10 +9,11 @@ #include -using namespace Bookmarks::Internal; using namespace Core; using namespace Utils; +namespace Bookmarks::Internal { + BookmarkFilter::BookmarkFilter(BookmarkManager *manager) : m_manager(manager) { @@ -114,3 +115,5 @@ void BookmarkFilter::accept(const LocatorFilterEntry &selection, QString *newTex m_manager->gotoBookmark(bookmark); } } + +} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarkfilter.h b/src/plugins/bookmarks/bookmarkfilter.h index fc7262bdfd4..bc068ac176b 100644 --- a/src/plugins/bookmarks/bookmarkfilter.h +++ b/src/plugins/bookmarks/bookmarkfilter.h @@ -5,14 +5,12 @@ #include -namespace Bookmarks { -namespace Internal { +namespace Bookmarks::Internal { class BookmarkManager; class BookmarkFilter : public Core::ILocatorFilter { - Q_OBJECT public: explicit BookmarkFilter(BookmarkManager *manager); void prepareSearch(const QString &entry) override; @@ -26,5 +24,4 @@ private: QList m_results; }; -} // namespace Internal -} // namespace Bookmarks +} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index f3693ed51c3..41a46590b66 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -43,8 +43,7 @@ using namespace ProjectExplorer; using namespace Core; using namespace Utils; -namespace Bookmarks { -namespace Internal { +namespace Bookmarks::Internal { BookmarkDelegate::BookmarkDelegate(QObject *parent) : QStyledItemDelegate(parent) @@ -794,5 +793,4 @@ NavigationView BookmarkViewFactory::createWidget() return {view, view->createToolBarWidgets()}; } -} // namespace Internal -} // namespace Bookmarks +} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarkmanager.h b/src/plugins/bookmarks/bookmarkmanager.h index da34b54dd31..0667c9633a3 100644 --- a/src/plugins/bookmarks/bookmarkmanager.h +++ b/src/plugins/bookmarks/bookmarkmanager.h @@ -16,8 +16,7 @@ namespace Core { class IContext; } -namespace Bookmarks { -namespace Internal { +namespace Bookmarks::Internal { class Bookmark; class BookmarksPlugin; @@ -102,17 +101,13 @@ private: class BookmarkView final : public Utils::ListView { - Q_OBJECT - public: explicit BookmarkView(BookmarkManager *manager); QList createToolBarWidgets(); -public slots: void gotoBookmark(const QModelIndex &index); -protected slots: void removeFromContextMenu(); void removeAll(); @@ -129,8 +124,6 @@ private: class BookmarkViewFactory : public Core::INavigationWidgetFactory { - Q_OBJECT - public: BookmarkViewFactory(BookmarkManager *bm); @@ -142,8 +135,6 @@ private: class BookmarkDelegate : public QStyledItemDelegate { - Q_OBJECT - public: BookmarkDelegate(QObject *parent = nullptr); @@ -156,5 +147,4 @@ private: mutable QPixmap m_selectedPixmap; }; -} // namespace Internal -} // namespace Bookmarks +} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index 33da6d8e798..f1b6a78ddf3 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -31,8 +31,7 @@ using namespace Utils; using namespace Bookmarks::Constants; -namespace Bookmarks { -namespace Internal { +namespace Bookmarks::Internal { class BookmarksPluginPrivate : public QObject { @@ -225,5 +224,4 @@ void BookmarksPluginPrivate::requestContextMenu(TextEditorWidget *widget, menu->addAction(&m_editBookmarkAction); } -} // namespace Internal -} // namespace Bookmarks +} // Bookmarks::Internal diff --git a/src/plugins/bookmarks/bookmarksplugin.h b/src/plugins/bookmarks/bookmarksplugin.h index 5a3172819b4..30e81a96857 100644 --- a/src/plugins/bookmarks/bookmarksplugin.h +++ b/src/plugins/bookmarks/bookmarksplugin.h @@ -5,8 +5,7 @@ #include -namespace Bookmarks { -namespace Internal { +namespace Bookmarks::Internal { class BookmarksPlugin final : public ExtensionSystem::IPlugin { @@ -20,5 +19,4 @@ class BookmarksPlugin final : public ExtensionSystem::IPlugin class BookmarksPluginPrivate *d = nullptr; }; -} // namespace Internal -} // namespace Bookmarks +} // Bookmarks::Internal diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 36bf395a0a8..0474d1d6ed4 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -212,7 +212,7 @@ template class VersionedDataCache public: void insert(const DocType &doc, const DataType &data) { - m_data.emplace(std::make_pair(doc, VersionedDocData(doc, data))); + m_data.emplace(doc, VersionedDocData(doc, data)); } void remove(const DocType &doc) { m_data.erase(doc); } std::optional> take(const DocType &doc) @@ -531,7 +531,7 @@ QTextCursor ClangdClient::adjustedCursorForHighlighting(const QTextCursor &curso const LanguageClient::Client::CustomInspectorTabs ClangdClient::createCustomInspectorTabs() { - return {std::make_pair(new ClangdMemoryUsageWidget(this), tr("Memory Usage"))}; + return {{new ClangdMemoryUsageWidget(this), tr("Memory Usage")}}; } class ClangdDiagnosticManager : public LanguageClient::DiagnosticManager @@ -1332,9 +1332,7 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc, data->previousTokens.first = tokens; data->previousTokens.second = version; } else { - HighlightingData data; - data.previousTokens = qMakePair(tokens, version); - highlightingData.insert(doc, data); + highlightingData.insert(doc, {{tokens, version}, {}}); } for (const ExpandedSemanticToken &t : tokens) qCDebug(clangdLogHighlight()) << '\t' << t.line << t.column << t.length << t.type diff --git a/src/plugins/clangcodemodel/clangdcompletion.cpp b/src/plugins/clangcodemodel/clangdcompletion.cpp index d99e9ae92f4..442a3fb2401 100644 --- a/src/plugins/clangcodemodel/clangdcompletion.cpp +++ b/src/plugins/clangcodemodel/clangdcompletion.cpp @@ -493,7 +493,7 @@ QList CustomAssistProcessor::completeInclude( for (AssistProposalItemInterface * const item : qAsConst(completions)) { QString s = item->text(); s.replace('/', QChar(0)); // The dir separator should compare less than anything else. - completionsForSorting << qMakePair(item, s); + completionsForSorting.push_back({item, s}); } Utils::sort(completionsForSorting, [](const auto &left, const auto &right) { return left.second < right.second; diff --git a/src/plugins/clangcodemodel/clangdfindreferences.cpp b/src/plugins/clangcodemodel/clangdfindreferences.cpp index aa26808259c..c48c0caebea 100644 --- a/src/plugins/clangcodemodel/clangdfindreferences.cpp +++ b/src/plugins/clangcodemodel/clangdfindreferences.cpp @@ -200,7 +200,7 @@ void ClangdFindReferences::Private::handleFindUsagesResult(const QList }); for (const Location &loc : locations) - fileData[loc.uri()].rangesAndLineText << qMakePair(loc.range(), QString()); + fileData[loc.uri()].rangesAndLineText.push_back({loc.range(), {}}); for (auto it = fileData.begin(); it != fileData.end();) { const Utils::FilePath filePath = it.key().toFilePath(); if (!filePath.exists()) { // https://github.com/clangd/clangd/issues/935 diff --git a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp index 21dc5352cc2..2e138bc96d5 100644 --- a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp +++ b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp @@ -454,7 +454,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult( if (!sentinel) return; if (!name.isEmpty()) - symbolsToDisplay << qMakePair(prefix + name, link); + symbolsToDisplay.push_back({prefix + name, link}); pendingSymbolInfoRequests.removeOne(reqId); virtualFuncAssistProcessor->update(); if (pendingSymbolInfoRequests.isEmpty() && pendingGotoDefRequests.isEmpty() diff --git a/src/plugins/clangcodemodel/clangdmemoryusagewidget.cpp b/src/plugins/clangcodemodel/clangdmemoryusagewidget.cpp index 06ec53d621c..fcceebe06ea 100644 --- a/src/plugins/clangcodemodel/clangdmemoryusagewidget.cpp +++ b/src/plugins/clangcodemodel/clangdmemoryusagewidget.cpp @@ -39,7 +39,7 @@ public: for (auto it = obj.begin(); it != obj.end(); ++it) { if (it.key() == totalKey() || it.key() == selfKey()) continue; - components << std::make_pair(MemoryTree(it.value()), it.key()); + components.push_back({MemoryTree(it.value()), it.key()}); } return components; } @@ -81,11 +81,9 @@ private: QString memString() const { - static const QList> factors{ - std::make_pair(1000000000, QString("GB")), - std::make_pair(1000000, QString("MB")), - std::make_pair(1000, QString("KB")), - }; + static const QList> factors{{1000000000, "GB"}, + {1000000, "MB"}, + {1000, "KB"}}; for (const auto &factor : factors) { if (m_bytesUsed > factor.first) return QString::number(qint64(std::round(double(m_bytesUsed) / factor.first))) diff --git a/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp b/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp index bf9a6927bec..a395de05bc2 100644 --- a/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp +++ b/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp @@ -190,14 +190,12 @@ static QString createExplainingStepToolTipString(const ExplainingStep &step) QList lines; if (!step.message.isEmpty()) { - lines << qMakePair( - QCoreApplication::translate("ClangTools::ExplainingStep", "Message:"), - step.message.toHtmlEscaped()); + lines.push_back({QCoreApplication::translate("ClangTools::ExplainingStep", "Message:"), + step.message.toHtmlEscaped()}); } - lines << qMakePair( - QCoreApplication::translate("ClangTools::ExplainingStep", "Location:"), - createFullLocationString(step.location)); + lines.push_back({QCoreApplication::translate("ClangTools::ExplainingStep", "Location:"), + createFullLocationString(step.location)}); QString html = QLatin1String("" "" diff --git a/src/plugins/clangtools/clangtoolsutils.cpp b/src/plugins/clangtools/clangtoolsutils.cpp index 741e5de9f94..9eeaed31d4b 100644 --- a/src/plugins/clangtools/clangtoolsutils.cpp +++ b/src/plugins/clangtools/clangtoolsutils.cpp @@ -61,30 +61,26 @@ QString createDiagnosticToolTipString( QList lines; if (!diagnostic.category.isEmpty()) { - lines << qMakePair( - QCoreApplication::translate("ClangTools::Diagnostic", "Category:"), - diagnostic.category.toHtmlEscaped()); + lines.push_back({QCoreApplication::translate("ClangTools::Diagnostic", "Category:"), + diagnostic.category.toHtmlEscaped()}); } if (!diagnostic.type.isEmpty()) { - lines << qMakePair( - QCoreApplication::translate("ClangTools::Diagnostic", "Type:"), - diagnostic.type.toHtmlEscaped()); + lines.push_back({QCoreApplication::translate("ClangTools::Diagnostic", "Type:"), + diagnostic.type.toHtmlEscaped()}); } if (!diagnostic.description.isEmpty()) { - lines << qMakePair( - QCoreApplication::translate("ClangTools::Diagnostic", "Description:"), - diagnostic.description.toHtmlEscaped()); + lines.push_back({QCoreApplication::translate("ClangTools::Diagnostic", "Description:"), + diagnostic.description.toHtmlEscaped()}); } - lines << qMakePair( - QCoreApplication::translate("ClangTools::Diagnostic", "Location:"), - createFullLocationString(diagnostic.location)); + lines.push_back({QCoreApplication::translate("ClangTools::Diagnostic", "Location:"), + createFullLocationString(diagnostic.location)}); if (status) { - lines << qMakePair(QCoreApplication::translate("ClangTools::Diagnostic", "Fixit status:"), - fixitStatus(*status)); + lines.push_back({QCoreApplication::translate("ClangTools::Diagnostic", "Fixit status:"), + fixitStatus(*status)}); } if (showSteps && !diagnostic.explainingSteps.isEmpty()) { @@ -103,8 +99,8 @@ QString createDiagnosticToolTipString( const QString url = documentationUrl(diagnostic.name); if (!url.isEmpty()) { - lines << qMakePair(QCoreApplication::translate("ClangTools::Diagnostic", "Documentation:"), - QString("%1").arg(url)); + lines.push_back({QCoreApplication::translate("ClangTools::Diagnostic", "Documentation:"), + QString("%1").arg(url)}); } QString html = QLatin1String("" diff --git a/src/plugins/clangtools/executableinfo.cpp b/src/plugins/clangtools/executableinfo.cpp index eb9d47e0855..148411c85ce 100644 --- a/src/plugins/clangtools/executableinfo.cpp +++ b/src/plugins/clangtools/executableinfo.cpp @@ -147,7 +147,7 @@ ClazyStandaloneInfo ClazyStandaloneInfo::getInfo(const FilePath &executablePath) const auto it = cache.find(executablePath); if (it == cache.end()) { const ClazyStandaloneInfo info(executablePath); - cache.insert(executablePath, qMakePair(timeStamp, info)); + cache.insert(executablePath, {timeStamp, info}); return info; } if (it->first != timeStamp) { @@ -219,8 +219,8 @@ QPair getClangIncludeDirAndVersion(const FilePath &clangToolP const FilePath dynamicResourceDir = queryResourceDir(clangToolPath); const QString dynamicVersion = queryVersion(clangToolPath, QueryFailMode::Noisy); if (dynamicResourceDir.isEmpty() || dynamicVersion.isEmpty()) - return qMakePair(FilePath::fromString(CLANG_INCLUDE_DIR), QString(CLANG_VERSION)); - return qMakePair(dynamicResourceDir + "/include", dynamicVersion); + return {FilePath::fromString(CLANG_INCLUDE_DIR), QString(CLANG_VERSION)}; + return {dynamicResourceDir + "/include", dynamicVersion}; } QHash> ClazyStandaloneInfo::cache; diff --git a/src/plugins/classview/classviewmanager.cpp b/src/plugins/classview/classviewmanager.cpp index e72bbb29954..90301a7c87c 100644 --- a/src/plugins/classview/classviewmanager.cpp +++ b/src/plugins/classview/classviewmanager.cpp @@ -99,7 +99,7 @@ void ManagerPrivate::resetParser() QHash> projectData; for (const Project *project : SessionManager::projects()) { projectData.insert(project->projectFilePath(), - qMakePair(project->displayName(), project->files(Project::SourceFiles))); + {project->displayName(), project->files(Project::SourceFiles)}); } QMetaObject::invokeMethod(m_parser, [this, projectData]() { m_parser->resetData(projectData); diff --git a/src/plugins/clearcase/clearcasesync.cpp b/src/plugins/clearcase/clearcasesync.cpp index d1e0dccc7de..feb52726943 100644 --- a/src/plugins/clearcase/clearcasesync.cpp +++ b/src/plugins/clearcase/clearcasesync.cpp @@ -126,7 +126,7 @@ void ClearCaseSync::updateTotalFilesCount(const QString &view, ClearCaseSettings void ClearCaseSync::updateStatusForNotManagedFiles(const QStringList &files) { - foreach (const QString &file, files) { + for (const QString &file : files) { QString absFile = QFileInfo(file).absoluteFilePath(); if (!m_statusMap->contains(absFile)) ClearCasePlugin::setStatus(absFile, FileStatus::NotManaged, false); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 119a5c1d3f8..784ebe419b2 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1168,7 +1168,8 @@ static CommandLine defaultInitialCMakeCommand(const Kit *k, const QString buildT static void addCMakeConfigurePresetToInitialArguments(QStringList &initialArguments, const CMakeProject *project, const Kit *k, - const Utils::Environment &env) + const Utils::Environment &env, + const Utils::FilePath &buildDirectory) { const CMakeConfigItem presetItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k); @@ -1230,6 +1231,11 @@ static void addCMakeConfigurePresetToInitialArguments(QStringList &initialArgume initialArguments.append("--debug-output"); } + CMakePresets::Macros::updateToolchainFile(configurePreset, + env, + project->projectDirectory(), + buildDirectory); + // Merge the presets cache variables CMakeConfig cache; if (configurePreset.cacheVariables) @@ -1547,15 +1553,16 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) CMakeProject *cmakeProject = static_cast(target->project()); setUserConfigureEnvironmentChanges(getEnvironmentItemsFromCMakeConfigurePreset(cmakeProject, k)); + updateAndEmitConfigureEnvironmentChanged(); QStringList initialCMakeArguments = cmd.splitArguments(); addCMakeConfigurePresetToInitialArguments(initialCMakeArguments, cmakeProject, k, - configureEnvironment()); + configureEnvironment(), + info.buildDirectory); m_buildSystem->setInitialCMakeArguments(initialCMakeArguments); m_buildSystem->setCMakeBuildType(buildType); - updateAndEmitConfigureEnvironmentChanged(); setBuildPresetToBuildSteps(target); }); @@ -1825,24 +1832,31 @@ void CMakeBuildConfiguration::setInitialBuildAndCleanSteps(const ProjectExplorer const CMakeConfigItem presetItem = CMakeConfigurationKitAspect::cmakePresetConfigItem( target->kit()); + int buildSteps = 1; if (!presetItem.isNull()) { const QString presetName = presetItem.expandedValue(target->kit()); const CMakeProject *project = static_cast(target->project()); const auto buildPresets = project->presetsData().buildPresets; - const int count = std::count_if(buildPresets.begin(), - buildPresets.end(), - [presetName](const PresetsDetails::BuildPreset &preset) { - return preset.configurePreset == presetName - && !preset.hidden.value(); - }); + const int count + = std::count_if(buildPresets.begin(), + buildPresets.end(), + [presetName, project](const PresetsDetails::BuildPreset &preset) { + bool enabled = true; + if (preset.condition) + enabled = CMakePresets::Macros::evaluatePresetCondition( + preset, project->projectDirectory()); - for (int i = 0; i < count; ++i) - appendInitialBuildStep(Constants::CMAKE_BUILD_STEP_ID); - - } else { - appendInitialBuildStep(Constants::CMAKE_BUILD_STEP_ID); + return preset.configurePreset == presetName + && !preset.hidden.value() && enabled; + }); + if (count != 0) + buildSteps = count; } + + for (int i = 0; i < buildSteps; ++i) + appendInitialBuildStep(Constants::CMAKE_BUILD_STEP_ID); + appendInitialCleanStep(Constants::CMAKE_BUILD_STEP_ID); } @@ -1858,10 +1872,15 @@ void CMakeBuildConfiguration::setBuildPresetToBuildSteps(const ProjectExplorer:: const CMakeProject *project = static_cast(target->project()); const auto allBuildPresets = project->presetsData().buildPresets; - const auto buildPresets - = Utils::filtered(allBuildPresets, [presetName](const PresetsDetails::BuildPreset &preset) { - return preset.configurePreset == presetName && !preset.hidden.value(); - }); + const auto buildPresets = Utils::filtered( + allBuildPresets, [presetName, project](const PresetsDetails::BuildPreset &preset) { + bool enabled = true; + if (preset.condition) + enabled = CMakePresets::Macros::evaluatePresetCondition(preset, + project->projectDirectory()); + + return preset.configurePreset == presetName && !preset.hidden.value() && enabled; + }); const QList buildStepList = Utils::filtered(buildSteps()->steps(), [](const BuildStep *bs) { diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 1608a454d60..875971a1cfa 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -300,7 +300,7 @@ void CMakeBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter) emit progress(percent, {}); }); formatter->addLineParser(progressParser); - cmakeParser->setSourceDirectory(project()->projectDirectory().toString()); + cmakeParser->setSourceDirectory(project()->projectDirectory()); formatter->addLineParsers({cmakeParser, new GnuMakeParser}); ToolChain *tc = ToolChainKitAspect::cxxToolChain(kit()); OutputTaskParser *xcodeBuildParser = nullptr; diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 22e963a1be4..9ddeb279914 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -1145,11 +1145,14 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const { QTC_ASSERT(k, return Tasks()); + const CMakeTool *const cmake = CMakeKitAspect::cmakeTool(k); + if (!cmake) + return Tasks(); + const QtSupport::QtVersion *const version = QtSupport::QtKitAspect::qtVersion(k); const ToolChain *const tcC = ToolChainKitAspect::cToolChain(k); const ToolChain *const tcCxx = ToolChainKitAspect::cxxToolChain(k); const CMakeConfig config = configuration(k); - const CMakeTool *const cmake = CMakeKitAspect::cmakeTool(k); const bool isQt4 = version && version->qtVersion() < QVersionNumber(5, 0, 0); FilePath qmakePath; // This is relative to the cmake used for building. diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index e4a1c7b093e..1b6573869dc 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -32,12 +32,19 @@ CMakeParser::CMakeParser() QTC_CHECK(m_locationLine.isValid()); } -void CMakeParser::setSourceDirectory(const QString &sourceDir) +void CMakeParser::setSourceDirectory(const FilePath &sourceDir) { if (m_sourceDirectory) - emit searchDirExpired(FilePath::fromString(m_sourceDirectory.value().path())); - m_sourceDirectory = QDir(sourceDir); - emit newSearchDirFound(FilePath::fromString(sourceDir)); + emit searchDirExpired(m_sourceDirectory.value()); + m_sourceDirectory = sourceDir; + emit newSearchDirFound(sourceDir); +} + +FilePath CMakeParser::resolvePath(const QString &path) const +{ + if (m_sourceDirectory) + return m_sourceDirectory->resolvePath(path); + return FilePath::fromUserInput(path); } OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputFormat type) @@ -69,12 +76,11 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm match = m_commonError.match(trimmedLine); if (match.hasMatch()) { - QString path = m_sourceDirectory ? m_sourceDirectory->absoluteFilePath( - QDir::fromNativeSeparators(match.captured(1))) - : QDir::fromNativeSeparators(match.captured(1)); + const FilePath path = resolvePath(match.captured(1)); + m_lastTask = BuildSystemTask(Task::Error, QString(), - absoluteFilePath(FilePath::fromUserInput(path)), + absoluteFilePath(path), match.captured(2).toInt()); m_lines = 1; LinkSpecs linkSpecs; @@ -94,12 +100,10 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm } match = m_commonWarning.match(trimmedLine); if (match.hasMatch()) { - QString path = m_sourceDirectory ? m_sourceDirectory->absoluteFilePath( - QDir::fromNativeSeparators(match.captured(2))) - : QDir::fromNativeSeparators(match.captured(2)); + const FilePath path = resolvePath(match.captured(2)); m_lastTask = BuildSystemTask(Task::Warning, QString(), - absoluteFilePath(FilePath::fromUserInput(path)), + absoluteFilePath(path), match.captured(3).toInt()); m_lines = 1; LinkSpecs linkSpecs; diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.h b/src/plugins/cmakeprojectmanager/cmakeparser.h index 686840575ee..e9d28b78e75 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.h +++ b/src/plugins/cmakeprojectmanager/cmakeparser.h @@ -8,7 +8,8 @@ #include #include -#include +#include + #include #include @@ -21,17 +22,18 @@ class CMAKE_EXPORT CMakeParser : public ProjectExplorer::OutputTaskParser public: explicit CMakeParser(); - void setSourceDirectory(const QString &sourceDir); + void setSourceDirectory(const Utils::FilePath &sourceDir); private: Result handleLine(const QString &line, Utils::OutputFormat type) override; void flush() override; + Utils::FilePath resolvePath(const QString &path) const; enum TripleLineError { NONE, LINE_LOCATION, LINE_DESCRIPTION, LINE_DESCRIPTION2 }; TripleLineError m_expectTripleLineErrorData = NONE; - std::optional m_sourceDirectory; + std::optional m_sourceDirectory; ProjectExplorer::Task m_lastTask; QRegularExpression m_commonError; QRegularExpression m_nextSubError; @@ -41,4 +43,4 @@ private: int m_lines = 0; }; -} // namespace CMakeProjectManager +} // CMakeProjectManager diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 00a958b5496..4960b2e5c09 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -55,10 +55,19 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & const FilePath cmakeExecutable = cmake->cmakeExecutable(); - if (!cmakeExecutable.ensureReachable(parameters.sourceDirectory) - || !cmakeExecutable.ensureReachable(parameters.buildDirectory)) { + if (!cmakeExecutable.ensureReachable(parameters.sourceDirectory)) { QString msg = ::CMakeProjectManager::Tr::tr( - "The source or build directory is not reachable by the CMake executable."); + "The source directory %1 is not reachable by the CMake executable %2.") + .arg(parameters.sourceDirectory.displayName()).arg(cmakeExecutable.displayName()); + BuildSystem::appendBuildSystemOutput(msg + '\n'); + emit finished(); + return; + } + + if (!cmakeExecutable.ensureReachable(parameters.buildDirectory)) { + QString msg = ::CMakeProjectManager::Tr::tr( + "The build directory %1 is not reachable by the CMake executable %2.") + .arg(parameters.buildDirectory.displayName()).arg(cmakeExecutable.displayName()); BuildSystem::appendBuildSystemOutput(msg + '\n'); emit finished(); return; @@ -88,7 +97,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & } const auto parser = new CMakeParser; - parser->setSourceDirectory(parameters.sourceDirectory.path()); + parser->setSourceDirectory(parameters.sourceDirectory); m_parser.addLineParser(parser); // Always use the sourceDir: If we are triggered because the build directory is getting deleted diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index be51a7d47cb..3e6b0ece8e4 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -123,6 +123,11 @@ FilePaths CMakeProjectImporter::importCandidates() if (configPreset.hidden.value()) continue; + if (configPreset.condition) { + if (!CMakePresets::Macros::evaluatePresetCondition(configPreset, projectFilePath())) + continue; + } + const FilePath configPresetDir = m_presetsTempDir.filePath(configPreset.name); configPresetDir.createDir(); candidates << configPresetDir; @@ -165,6 +170,14 @@ static CMakeConfig configurationFromPresetProbe( args.emplace_back("-G"); args.emplace_back(configurePreset.generator.value()); } + if (configurePreset.architecture && configurePreset.architecture.value().value) { + args.emplace_back("-A"); + args.emplace_back(configurePreset.architecture.value().value.value()); + } + if (configurePreset.toolset && configurePreset.toolset.value().value) { + args.emplace_back("-T"); + args.emplace_back(configurePreset.toolset.value().value.value()); + } if (configurePreset.cacheVariables) { const CMakeConfig cache = configurePreset.cacheVariables @@ -233,7 +246,9 @@ static FilePath qmakeFromCMakeCache(const CMakeConfig &config) prefixPath = config.stringValueOf("CMAKE_PREFIX_PATH"); } qCDebug(cmInputLog) << "PrefixPath:" << prefixPath; - if (prefixPath.isEmpty()) + + FilePath toolchainFile = config.filePathValueOf(QByteArray("CMAKE_TOOLCHAIN_FILE")); + if (prefixPath.isEmpty() && toolchainFile.isEmpty()) return FilePath(); // Run a CMake project that would do qmake probing @@ -284,9 +299,10 @@ static FilePath qmakeFromCMakeCache(const CMakeConfig &config) cmake.setTimeOutMessageBoxEnabled(false); QString cmakeGenerator = config.stringValueOf(QByteArray("CMAKE_GENERATOR")); + QString cmakeGeneratorPlatform = config.stringValueOf(QByteArray("CMAKE_GENERATOR_PLATFORM")); + QString cmakeGeneratorToolset = config.stringValueOf(QByteArray("CMAKE_GENERATOR_TOOLSET")); FilePath cmakeExecutable = config.filePathValueOf(QByteArray("CMAKE_COMMAND")); FilePath cmakeMakeProgram = config.filePathValueOf(QByteArray("CMAKE_MAKE_PROGRAM")); - FilePath toolchainFile = config.filePathValueOf(QByteArray("CMAKE_TOOLCHAIN_FILE")); FilePath hostPath = config.filePathValueOf(QByteArray("QT_HOST_PATH")); QStringList args; @@ -296,6 +312,14 @@ static FilePath qmakeFromCMakeCache(const CMakeConfig &config) args.push_back(qtcQMakeProbeDir.filePath("build").path()); args.push_back("-G"); args.push_back(cmakeGenerator); + if (!cmakeGeneratorPlatform.isEmpty()) { + args.push_back("-A"); + args.push_back(cmakeGeneratorPlatform); + } + if (!cmakeGeneratorToolset.isEmpty()) { + args.push_back("-T"); + args.push_back(cmakeGeneratorToolset); + } if (!cmakeMakeProgram.isEmpty()) { args.push_back(QStringLiteral("-DCMAKE_MAKE_PROGRAM=%1").arg(cmakeMakeProgram.toString())); @@ -303,7 +327,8 @@ static FilePath qmakeFromCMakeCache(const CMakeConfig &config) if (toolchainFile.isEmpty()) { args.push_back(QStringLiteral("-DCMAKE_PREFIX_PATH=%1").arg(prefixPath)); } else { - args.push_back(QStringLiteral("-DCMAKE_FIND_ROOT_PATH=%1").arg(prefixPath)); + if (!prefixPath.isEmpty()) + args.push_back(QStringLiteral("-DCMAKE_FIND_ROOT_PATH=%1").arg(prefixPath)); args.push_back(QStringLiteral("-DCMAKE_TOOLCHAIN_FILE=%1").arg(toolchainFile.toString())); } if (!hostPath.isEmpty()) { @@ -383,13 +408,15 @@ QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, auto data = std::make_unique(); const QString presetName = importPath.fileName(); - PresetsDetails::ConfigurePreset configurePreset = Utils::findOrDefault(m_presetsData.configurePresets, [presetName](const PresetsDetails::ConfigurePreset &preset) { return preset.name == presetName; }); + Environment env = Environment::systemEnvironment(); + CMakePresets::Macros::expand(configurePreset, env, projectDirectory()); + if (configurePreset.displayName) data->cmakePresetDisplayname = configurePreset.displayName.value(); else @@ -415,14 +442,16 @@ QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, QString binaryDir = importPath.toString(); if (configurePreset.binaryDir) { binaryDir = configurePreset.binaryDir.value(); - CMakePresets::Macros::expand(configurePreset, - Environment::systemEnvironment(), - projectDirectory(), - binaryDir); + CMakePresets::Macros::expand(configurePreset, env, projectDirectory(), binaryDir); } data->buildDirectory = Utils::FilePath::fromString(binaryDir); + CMakePresets::Macros::updateToolchainFile(configurePreset, + env, + projectDirectory(), + data->buildDirectory); + const CMakeConfig cache = configurePreset.cacheVariables ? configurePreset.cacheVariables.value() : CMakeConfig(); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 5d82561d68b..4cef534ff1d 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -173,13 +173,14 @@ bool CMakeTool::isValid() const void CMakeTool::runCMake(QtcProcess &cmake, const QStringList &args, int timeoutS) const { + const FilePath executable = cmakeExecutable(); cmake.setTimeoutS(timeoutS); cmake.setDisableUnixTerminal(); - Environment env = Environment::systemEnvironment(); + Environment env = executable.deviceEnvironment(); env.setupEnglishOutput(); cmake.setEnvironment(env); cmake.setTimeOutMessageBoxEnabled(false); - cmake.setCommand({cmakeExecutable(), args}); + cmake.setCommand({executable, args}); cmake.runBlocking(); } @@ -541,13 +542,11 @@ void CMakeTool::parseFromCapabilities(const QString &input) const const QVariantMap object = r.toMap(); const QString kind = object.value("kind").toString(); const QVariantList versionList = object.value("version").toList(); - std::pair highestVersion = std::make_pair(-1, -1); + std::pair highestVersion{-1, -1}; for (const QVariant &v : versionList) { const QVariantMap versionObject = v.toMap(); - const std::pair version = std::make_pair(getVersion(versionObject, - "major"), - getVersion(versionObject, - "minor")); + const std::pair version{getVersion(versionObject, "major"), + getVersion(versionObject, "minor")}; if (version.first > highestVersion.first || (version.first == highestVersion.first && version.second > highestVersion.second)) @@ -566,9 +565,9 @@ void CMakeTool::parseFromCapabilities(const QString &input) const // Fix up fileapi support for cmake 3.14: if (m_introspection->m_version.major == 3 && m_introspection->m_version.minor == 14) { - m_introspection->m_fileApis.append({QString("codemodel"), std::make_pair(2, 0)}); - m_introspection->m_fileApis.append({QString("cache"), std::make_pair(2, 0)}); - m_introspection->m_fileApis.append({QString("cmakefiles"), std::make_pair(1, 0)}); + m_introspection->m_fileApis.append({QString("codemodel"), {2, 0}}); + m_introspection->m_fileApis.append({QString("cache"), {2, 0}}); + m_introspection->m_fileApis.append({QString("cmakefiles"), {1, 0}}); } } diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 804f6a0841b..4abee299646 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -699,7 +699,7 @@ void setupLocationInfoForTargets(CMakeProjectNode *rootNode, const QList result; for (const FolderNode::LocationInfo &i : bt) { int count = locations.count(); - locations.insert(std::make_pair(i.path, i.line)); + locations.insert({i.path, i.line}); if (count != locations.count()) { result.append(i); } diff --git a/src/plugins/cmakeprojectmanager/fileapiparser.cpp b/src/plugins/cmakeprojectmanager/fileapiparser.cpp index ea323931559..adf05be72ea 100644 --- a/src/plugins/cmakeprojectmanager/fileapiparser.cpp +++ b/src/plugins/cmakeprojectmanager/fileapiparser.cpp @@ -52,7 +52,7 @@ static std::pair cmakeVersion(const QJsonObject &obj) const QJsonObject version = obj.value("version").toObject(); const int major = version.value("major").toInt(-1); const int minor = version.value("minor").toInt(-1); - return std::make_pair(major, minor); + return {major, minor}; } static bool checkJsonObject(const QJsonObject &obj, const QString &kind, int major, int minor = -1) @@ -67,7 +67,7 @@ static bool checkJsonObject(const QJsonObject &obj, const QString &kind, int maj static std::pair nameValue(const QJsonObject &obj) { - return std::make_pair(obj.value("name").toString(), obj.value("value").toString()); + return {obj.value("name").toString(), obj.value("value").toString()}; } static QJsonDocument readJsonFile(const FilePath &filePath) diff --git a/src/plugins/cmakeprojectmanager/presetsmacros.cpp b/src/plugins/cmakeprojectmanager/presetsmacros.cpp index 29ecdf946bf..37ef043c12e 100644 --- a/src/plugins/cmakeprojectmanager/presetsmacros.cpp +++ b/src/plugins/cmakeprojectmanager/presetsmacros.cpp @@ -12,6 +12,25 @@ namespace CMakeProjectManager::Internal::CMakePresets::Macros { +QString getHostSystemName() +{ + Utils::OsType osType = Utils::HostOsInfo::hostOs(); + + switch (osType) { + case Utils::OsTypeWindows: + return "Windows"; + case Utils::OsTypeLinux: + return "Linux"; + case Utils::OsTypeMac: + return "Darwin"; + case Utils::OsTypeOtherUnix: + return "Unix"; + case Utils::OsTypeOther: + return "Other"; + } + return "Other"; +} + void expandAllButEnv(const PresetsDetails::ConfigurePreset &preset, const Utils::FilePath &sourceDirectory, QString &value) @@ -25,6 +44,8 @@ void expandAllButEnv(const PresetsDetails::ConfigurePreset &preset, value.replace("${presetName}", preset.name); if (preset.generator) value.replace("${generator}", preset.generator.value()); + + value.replace("${hostSystemName}", getHostSystemName()); } void expandAllButEnv(const PresetsDetails::BuildPreset &preset, @@ -141,6 +162,106 @@ void expand(const PresetType &preset, value.replace(match.captured(1), env.value(match.captured(2))); } +void updateToolchainFile( + CMakeProjectManager::Internal::PresetsDetails::ConfigurePreset &configurePreset, + const Utils::Environment &env, + const Utils::FilePath &sourceDirectory, + const Utils::FilePath &buildDirectory) +{ + if (!configurePreset.toolchainFile) + return; + + QString toolchainFileName = configurePreset.toolchainFile.value(); + CMakePresets::Macros::expand(configurePreset, env, sourceDirectory, toolchainFileName); + + // Resolve the relative path first to source and afterwards to build directory + Utils::FilePath toolchainFile = Utils::FilePath::fromString(toolchainFileName); + if (toolchainFile.isRelativePath()) { + for (const auto &path : {sourceDirectory, buildDirectory}) { + Utils::FilePath probePath = toolchainFile.resolvePath(path); + if (probePath.exists() && probePath != path) { + toolchainFile = probePath; + break; + } + } + } + + if (!toolchainFile.exists()) + return; + + // toolchainFile takes precedence to CMAKE_TOOLCHAIN_FILE + CMakeConfig cache = configurePreset.cacheVariables ? configurePreset.cacheVariables.value() + : CMakeConfig(); + + auto it = std::find_if(cache.begin(), cache.end(), [](const CMakeConfigItem &item) { + return item.key == "CMAKE_TOOLCHAIN_FILE"; + }); + if (it != cache.end()) + it->value = toolchainFile.toString().toUtf8(); + else + cache << CMakeConfigItem("CMAKE_TOOLCHAIN_FILE", + CMakeConfigItem::FILEPATH, + toolchainFile.toString().toUtf8()); + + configurePreset.cacheVariables = cache; +} + +template +void expandConditionValues(const PresetType &preset, + const Utils::Environment &env, + const Utils::FilePath &sourceDirectory, + PresetsDetails::Condition &condition) +{ + if (condition.isEquals() || condition.isNotEquals()) { + if (condition.lhs) + expand(preset, env, sourceDirectory, condition.lhs.value()); + if (condition.rhs) + expand(preset, env, sourceDirectory, condition.rhs.value()); + } + + if (condition.isInList() || condition.isNotInList()) { + if (condition.string) + expand(preset, env, sourceDirectory, condition.string.value()); + if (condition.list) + for (QString &listValue : condition.list.value()) + expand(preset, env, sourceDirectory, listValue); + } + + if (condition.isMatches() || condition.isNotMatches()) { + if (condition.string) + expand(preset, env, sourceDirectory, condition.string.value()); + if (condition.regex) + expand(preset, env, sourceDirectory, condition.regex.value()); + } + + if (condition.isAnyOf() || condition.isAllOf()) { + if (condition.conditions) + for (PresetsDetails::Condition::ConditionPtr &c : condition.conditions.value()) + expandConditionValues(preset, env, sourceDirectory, *c); + } + + if (condition.isNot()) { + if (condition.condition) + expandConditionValues(preset, env, sourceDirectory, *condition.condition.value()); + } +} + +template +bool evaluatePresetCondition(const PresetType &preset, const Utils::FilePath &sourceDirectory) +{ + if (!preset.condition) + return true; + + Utils::Environment env = Utils::Environment::systemEnvironment(); + expand(preset, env, sourceDirectory); + + PresetsDetails::Condition condition = preset.condition.value(); + expandConditionValues(preset, env, sourceDirectory, condition); + + return condition.evaluate(); +} + + // Expand for PresetsDetails::ConfigurePreset template void expand(const PresetsDetails::ConfigurePreset &preset, Utils::Environment &env, @@ -155,6 +276,9 @@ template void expand(const PresetsDetails::Conf const Utils::FilePath &sourceDirectory, QString &value); +template bool evaluatePresetCondition( + const PresetsDetails::ConfigurePreset &preset, const Utils::FilePath &sourceDirectory); + // Expand for PresetsDetails::BuildPreset template void expand(const PresetsDetails::BuildPreset &preset, Utils::Environment &env, @@ -169,4 +293,7 @@ template void expand(const PresetsDetails::BuildPre const Utils::FilePath &sourceDirectory, QString &value); +template bool evaluatePresetCondition( + const PresetsDetails::BuildPreset &preset, const Utils::FilePath &sourceDirectory); + } // namespace CMakeProjectManager::Internal::CMakePresets::Macros diff --git a/src/plugins/cmakeprojectmanager/presetsmacros.h b/src/plugins/cmakeprojectmanager/presetsmacros.h index 9da2734da2a..0acf4d37cb6 100644 --- a/src/plugins/cmakeprojectmanager/presetsmacros.h +++ b/src/plugins/cmakeprojectmanager/presetsmacros.h @@ -12,6 +12,10 @@ class FilePath; namespace CMakeProjectManager::Internal { +namespace PresetsDetails { +class ConfigurePreset; +} + namespace CMakePresets::Macros { /** * Expands the CMakePresets Macros using Utils::Environment as target and source for parent environment values. @@ -40,6 +44,22 @@ void expand(const PresetType &preset, const Utils::FilePath &sourceDirectory, QString &value); +/** + * Updates the cacheVariables parameter of the configurePreset with the expandned toolchainFile parameter. + * Including macro expansion and relative paths resolving. + */ +void updateToolchainFile(PresetsDetails::ConfigurePreset &configurePreset, + const Utils::Environment &env, + const Utils::FilePath &sourceDirectory, + const Utils::FilePath &buildDirectory); + +/** + * Expands the condition values and then evaluates the condition object of the preset and returns + * the boolean result. + */ +template +bool evaluatePresetCondition(const PresetType &preset, const Utils::FilePath &sourceDirectory); + } // namespace CMakePresets::Macros } // namespace CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/presetsparser.cpp b/src/plugins/cmakeprojectmanager/presetsparser.cpp index 970b05921a5..441709109db 100644 --- a/src/plugins/cmakeprojectmanager/presetsparser.cpp +++ b/src/plugins/cmakeprojectmanager/presetsparser.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "presetsparser.h" +#include "utils/algorithm.h" #include "cmakeprojectmanagertr.h" @@ -34,6 +35,102 @@ bool parseCMakeMinimumRequired(const QJsonValue &jsonValue, QVersionNumber &vers return true; } +std::optional parseCondition(const QJsonValue &jsonValue) +{ + std::optional condition; + + if (jsonValue.isUndefined()) + return condition; + + condition = PresetsDetails::Condition(); + + if (jsonValue.isNull()) { + condition->type = "null"; + return condition; + } + + if (jsonValue.isBool()) { + condition->type = "const"; + condition->constValue = jsonValue.toBool(); + return condition; + } + + if (!jsonValue.isObject()) + return condition; + + QJsonObject object = jsonValue.toObject(); + QString type = object.value("type").toString(); + if (type.isEmpty()) + return condition; + + if (type == "const") { + condition->type = type; + condition->constValue = object.value("const").toBool(); + return condition; + } + + for (const auto &equals : {QString("equals"), QString("notEquals")}) { + if (type == equals) { + condition->type = equals; + condition->lhs = object.value("lhs").toString(); + condition->rhs = object.value("rhs").toString(); + } + } + if (!condition->type.isEmpty()) + return condition; + + for (const auto &inList : {QString("inList"), QString("notInList")}) { + if (type == inList) { + condition->type = inList; + condition->string = object.value("string").toString(); + if (object.value("list").isArray()) { + condition->list = QStringList(); + const QJsonArray listArray = object.value("list").toArray(); + for (const QJsonValue &listValue : listArray) + condition->list.value() << listValue.toString(); + } + } + } + if (!condition->type.isEmpty()) + return condition; + + for (const auto &matches : {QString("matches"), QString("notMatches")}) { + if (type == matches) { + condition->type = matches; + condition->string = object.value("string").toString(); + condition->regex = object.value("regex").toString(); + } + } + if (!condition->type.isEmpty()) + return condition; + + for (const auto &anyOf : {QString("anyOf"), QString("allOf")}) { + if (type == anyOf) { + condition->type = anyOf; + if (object.value("conditions").isArray()) { + condition->conditions = std::vector(); + const QJsonArray conditionsArray = object.value("conditions").toArray(); + for (const QJsonValue &conditionsValue : conditionsArray) { + condition->conditions.value().emplace_back( + std::make_shared( + parseCondition(conditionsValue).value())); + } + } + } + } + if (!condition->type.isEmpty()) + return condition; + + if (type == "not") { + condition->type = type; + condition->condition = std::make_shared( + parseCondition(object.value("condition")).value()); + return condition; + } + + return condition; +} + bool parseConfigurePresets(const QJsonValue &jsonValue, QList &configurePresets) { @@ -68,6 +165,10 @@ bool parseConfigurePresets(const QJsonValue &jsonValue, preset.inherits.value() << inheritsValue; } } + + if (object.contains("condition")) + preset.condition = parseCondition(object.value("condition")); + if (object.contains("displayName")) preset.displayName = object.value("displayName").toString(); if (object.contains("description")) @@ -76,6 +177,8 @@ bool parseConfigurePresets(const QJsonValue &jsonValue, preset.generator = object.value("generator").toString(); if (object.contains("binaryDir")) preset.binaryDir = object.value("binaryDir").toString(); + if (object.contains("toolchainFile")) + preset.toolchainFile = object.value("toolchainFile").toString(); if (object.contains("cmakeExecutable")) preset.cmakeExecutable = object.value("cmakeExecutable").toString(); @@ -218,6 +321,10 @@ bool parseBuildPresets(const QJsonValue &jsonValue, preset.inherits.value() << inheritsValue; } } + + if (object.contains("condition")) + preset.condition = parseCondition(object.value("condition")); + if (object.contains("displayName")) preset.displayName = object.value("displayName").toString(); if (object.contains("description")) @@ -334,6 +441,9 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage void PresetsDetails::ConfigurePreset::inheritFrom(const ConfigurePreset &other) { + if (!condition && other.condition && !other.condition.value().isNull()) + condition = other.condition; + if (!vendor && other.vendor) vendor = other.vendor; @@ -346,6 +456,9 @@ void PresetsDetails::ConfigurePreset::inheritFrom(const ConfigurePreset &other) if (!toolset && other.toolset) toolset = other.toolset; + if (!toolchainFile && other.toolchainFile) + toolchainFile = other.toolchainFile; + if (!binaryDir && other.binaryDir) binaryDir = other.binaryDir; @@ -370,6 +483,9 @@ void PresetsDetails::ConfigurePreset::inheritFrom(const ConfigurePreset &other) void PresetsDetails::BuildPreset::inheritFrom(const BuildPreset &other) { + if (!condition && other.condition && !other.condition.value().isNull()) + condition = other.condition; + if (!vendor && other.vendor) vendor = other.vendor; @@ -401,4 +517,46 @@ void PresetsDetails::BuildPreset::inheritFrom(const BuildPreset &other) nativeToolOptions = other.nativeToolOptions; } +bool PresetsDetails::Condition::evaluate() const +{ + if (isNull()) + return true; + + if (isConst() && constValue) + return constValue.value(); + + if (isEquals() && lhs && rhs) + return lhs.value() == rhs.value(); + + if (isNotEquals() && lhs && rhs) + return lhs.value() != rhs.value(); + + if (isInList() && string && list) + return list.value().contains(string.value()); + + if (isNotInList() && string && list) + return !list.value().contains(string.value()); + + if (isMatches() && string && regex) { + QRegularExpression qRegex(regex.value()); + return qRegex.match(string.value()).hasMatch(); + } + + if (isNotMatches() && string && regex) { + QRegularExpression qRegex(regex.value()); + return !qRegex.match(string.value()).hasMatch(); + } + + if (isAnyOf() && conditions) + return Utils::anyOf(conditions.value(), [](const ConditionPtr &c) { return c->evaluate(); }); + + if (isAllOf() && conditions) + return Utils::allOf(conditions.value(), [](const ConditionPtr &c) { return c->evaluate(); }); + + if (isNot() && condition) + return !condition.value()->evaluate(); + + return false; +} + } // CMakeProjectManager::Internal diff --git a/src/plugins/cmakeprojectmanager/presetsparser.h b/src/plugins/cmakeprojectmanager/presetsparser.h index 0dd65be7caa..5577620d5d8 100644 --- a/src/plugins/cmakeprojectmanager/presetsparser.h +++ b/src/plugins/cmakeprojectmanager/presetsparser.h @@ -43,6 +43,47 @@ public: std::optional find = false; }; +class Condition { +public: + QString type; + + bool isNull() const { return type == "null"; } + bool isConst() const { return type == "const"; } + bool isEquals() const { return type == "equals"; } + bool isNotEquals() const { return type == "notEquals"; } + bool isInList() const { return type == "inList"; } + bool isNotInList() const { return type == "notInList"; } + bool isMatches() const { return type == "matches"; } + bool isNotMatches() const { return type == "notMatches"; } + bool isAnyOf() const { return type == "anyOf"; } + bool isAllOf() const { return type == "allOf"; } + bool isNot() const { return type == "not"; } + + bool evaluate() const; + + // const + std::optional constValue; + + // equals, notEquals + std::optional lhs; + std::optional rhs; + + // inList, notInList + std::optional string; + std::optional list; + + // matches, notMatches + std::optional regex; + + using ConditionPtr = std::shared_ptr; + + // anyOf, allOf + std::optional> conditions; + + // not + std::optional condition; +}; + class ConfigurePreset { public: void inheritFrom(const ConfigurePreset &other); @@ -50,12 +91,14 @@ public: QString name; std::optional hidden = false; std::optional inherits; + std::optional condition; std::optional> vendor; std::optional displayName; std::optional description; std::optional generator; std::optional architecture; std::optional toolset; + std::optional toolchainFile; std::optional binaryDir; std::optional cmakeExecutable; std::optional cacheVariables; @@ -72,6 +115,7 @@ public: QString name; std::optional hidden = false; std::optional inherits; + std::optional condition; std::optional> vendor; std::optional displayName; std::optional description; diff --git a/src/plugins/coreplugin/dialogs/newdialogwidget.cpp b/src/plugins/coreplugin/dialogs/newdialogwidget.cpp index 8a2d50a838b..962255eb379 100644 --- a/src/plugins/coreplugin/dialogs/newdialogwidget.cpp +++ b/src/plugins/coreplugin/dialogs/newdialogwidget.cpp @@ -177,6 +177,7 @@ NewDialogWidget::NewDialogWidget(QWidget *parent) auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok, Qt::Horizontal); + m_templateCategoryView->setObjectName("templateCategoryView"); m_templateCategoryView->setStyleSheet(QString::fromUtf8(" QTreeView::branch {\n" " background: transparent;\n" " }")); @@ -186,10 +187,12 @@ NewDialogWidget::NewDialogWidget(QWidget *parent) m_templateCategoryView->setHeaderHidden(true); m_templateCategoryView->header()->setVisible(false); + m_templatesView->setObjectName("templatesView"); m_templatesView->setSelectionBehavior(QAbstractItemView::SelectRows); m_templatesView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_templatesView->setUniformItemSizes(false); + m_templateDescription->setObjectName("templateDescription"); m_templateDescription->setFocusPolicy(Qt::NoFocus); m_templateDescription->setFrameShape(QFrame::NoFrame); diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index 512939911c8..b9777b48da2 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -55,8 +55,8 @@ std::pair positionEntry(const QList &list, const auto to_insert = static_cast(std::distance(begin, std::lower_bound(begin, end, entry, &compare))); if (to_remove == to_insert) - return std::make_pair(-1, -1); - return std::make_pair(to_remove, to_insert); + return {-1, -1}; + return {to_remove, to_insert}; } } // namespace diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index bd4f9e91f5e..d6cc32d53e2 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -120,15 +120,6 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind) m_advancedButton->setText(QCoreApplication::translate("Core::Internal::FindWidget", "Advanced...")); m_advancedButton->setToolButtonStyle(Qt::ToolButtonTextOnly); - QWidget::setTabOrder(m_findEdit, m_replaceEdit); - QWidget::setTabOrder(m_replaceEdit, m_findPreviousButton); - QWidget::setTabOrder(m_findPreviousButton, m_findNextButton); - QWidget::setTabOrder(m_findNextButton, m_replaceButton); - QWidget::setTabOrder(m_replaceButton, m_replaceNextButton); - QWidget::setTabOrder(m_replaceNextButton, m_replaceAllButton); - QWidget::setTabOrder(m_replaceAllButton, m_advancedButton); - QWidget::setTabOrder(m_advancedButton, m_close); - auto replaceButtonsLayout = new QHBoxLayout(m_replaceButtonsWidget); replaceButtonsLayout->setSpacing(3); replaceButtonsLayout->setContentsMargins(0, 0, 0, 0); @@ -168,6 +159,15 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind) setProperty("topBorder", true); setSingleRow(false); + QWidget::setTabOrder(m_findEdit, m_replaceEdit); + QWidget::setTabOrder(m_replaceEdit, m_findPreviousButton); + QWidget::setTabOrder(m_findPreviousButton, m_findNextButton); + QWidget::setTabOrder(m_findNextButton, m_replaceButton); + QWidget::setTabOrder(m_replaceButton, m_replaceNextButton); + QWidget::setTabOrder(m_replaceNextButton, m_replaceAllButton); + QWidget::setTabOrder(m_replaceAllButton, m_advancedButton); + QWidget::setTabOrder(m_advancedButton, m_close); + connect(m_findEdit, &Utils::FancyLineEdit::editingFinished, this, &FindToolBar::invokeResetIncrementalSearch); connect(m_findEdit, &Utils::FancyLineEdit::textChanged, diff --git a/src/plugins/coreplugin/locator/commandlocator.cpp b/src/plugins/coreplugin/locator/commandlocator.cpp index 88acac6eaae..24842f443f3 100644 --- a/src/plugins/coreplugin/locator/commandlocator.cpp +++ b/src/plugins/coreplugin/locator/commandlocator.cpp @@ -61,7 +61,7 @@ void CommandLocator::prepareSearch(const QString &entry) continue; QAction *action = command->action(); if (action && action->isEnabled()) - d->commandsData.append(qMakePair(i, action->text())); + d->commandsData.append({i, action->text()}); } } diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 7a9991eb6ea..df8ef17c33a 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -1125,7 +1125,7 @@ void MainWindow::addContextObject(IContext *context) if (m_contextWidgets.find(widget) != m_contextWidgets.end()) return; - m_contextWidgets.insert(std::make_pair(widget, context)); + m_contextWidgets.insert({widget, context}); connect(context, &QObject::destroyed, this, [this, context] { removeContextObject(context); }); } diff --git a/src/plugins/coreplugin/mimetypemagicdialog.h b/src/plugins/coreplugin/mimetypemagicdialog.h index 023f878a53e..c45b9b70a92 100644 --- a/src/plugins/coreplugin/mimetypemagicdialog.h +++ b/src/plugins/coreplugin/mimetypemagicdialog.h @@ -75,7 +75,6 @@ private: QSpinBox *m_prioritySpinBox; QSpinBox *m_startRangeSpinBox; QSpinBox *m_endRangeSpinBox; - QSpacerItem *verticalSpacer; }; } // Core::Internal diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index 92c7be20366..b2ae43059f4 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -465,7 +465,7 @@ int OutputWindow::maxCharCount() const void OutputWindow::appendMessage(const QString &output, OutputFormat format) { if (d->queuedOutput.isEmpty() || d->queuedOutput.last().second != format) - d->queuedOutput << qMakePair(output, format); + d->queuedOutput.push_back({output, format}); else d->queuedOutput.last().first.append(output); if (!d->queueTimer.isActive()) @@ -482,7 +482,7 @@ void OutputWindow::registerPositionOf(unsigned taskId, int linkedOutputLines, in const int firstLine = blocknumber - linkedOutputLines - skipLines; const int lastLine = firstLine + linkedOutputLines - 1; - d->taskPositions.insert(taskId, qMakePair(firstLine, lastLine)); + d->taskPositions.insert(taskId, {firstLine, lastLine}); } bool OutputWindow::knowsPositionOf(unsigned taskId) const diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index 27a77ec42c7..de63fd0c4e2 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -44,16 +44,6 @@ class VcsManagerPrivate public: class VcsInfo { public: - VcsInfo() = default; - VcsInfo(IVersionControl *vc, const QString &tl) : - versionControl(vc), topLevel(tl) - { } - - bool operator == (const VcsInfo &other) const - { - return versionControl == other.versionControl && topLevel == other.topLevel; - } - IVersionControl *versionControl = nullptr; QString topLevel; }; @@ -99,7 +89,7 @@ public: QString tmpDir = dir; const QChar slash = QLatin1Char('/'); while (tmpDir.count() >= topLevel.count() && !tmpDir.isEmpty()) { - m_cachedMatches.insert(tmpDir, VcsInfo(vc, topLevel)); + m_cachedMatches.insert(tmpDir, {vc, topLevel}); // if no vc was found, this might mean we're inside a repo internal directory (.git) // Cache only input directory, not parents if (!vc) @@ -196,7 +186,7 @@ void VcsManager::resetVersionControlForDirectory(const FilePath &inputDirectory) } IVersionControl* VcsManager::findVersionControlForDirectory(const FilePath &inputDirectory, - QString *topLevelDirectory) + FilePath *topLevelDirectory) { using StringVersionControlPair = QPair; using StringVersionControlPairs = QList; @@ -217,7 +207,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const FilePath &inpu auto cachedData = d->findInCache(directory); if (cachedData) { if (topLevelDirectory) - *topLevelDirectory = cachedData->topLevel; + *topLevelDirectory = FilePath::fromString(cachedData->topLevel); return cachedData->versionControl; } @@ -273,7 +263,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const FilePath &inpu // return result if (topLevelDirectory) - *topLevelDirectory = allThatCanManage.first().first; + *topLevelDirectory = FilePath::fromString(allThatCanManage.first().first); IVersionControl *versionControl = allThatCanManage.first().second; const bool isVcsConfigured = versionControl->isConfigured(); if (!isVcsConfigured || d->m_unconfiguredVcs) { @@ -308,9 +298,9 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const FilePath &inpu FilePath VcsManager::findTopLevelForDirectory(const FilePath &directory) { - QString result; + FilePath result; findVersionControlForDirectory(directory, &result); - return FilePath::fromString(result); + return result; } QStringList VcsManager::repositories(const IVersionControl *vc) @@ -568,14 +558,12 @@ void CorePlugin::testVcsManager() vcsA->setManagedDirectories(makeHash(dirsVcsA)); vcsB->setManagedDirectories(makeHash(dirsVcsB)); - QString realTopLevel = QLatin1String("ABC"); // Make sure this gets cleared if needed. - // From VCSes: int expectedCount = 0; for (const QString &result : qAsConst(results)) { // qDebug() << "Expecting:" << result; - QStringList split = result.split(QLatin1Char(':')); + const QStringList split = result.split(QLatin1Char(':')); QCOMPARE(split.count(), 4); QVERIFY(split.at(3) == QLatin1String("*") || split.at(3) == QLatin1String("-")); @@ -589,9 +577,10 @@ void CorePlugin::testVcsManager() ++expectedCount; IVersionControl *vcs; + FilePath realTopLevel; vcs = VcsManager::findVersionControlForDirectory( FilePath::fromString(makeString(directory)), &realTopLevel); - QCOMPARE(realTopLevel, makeString(topLevel)); + QCOMPARE(realTopLevel.toString(), makeString(topLevel)); if (vcs) QCOMPARE(vcs->id().toString(), vcsId); else diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 3975a3201fe..952d0e34e37 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -43,7 +43,7 @@ public: static void resetVersionControlForDirectory(const Utils::FilePath &inputDirectory); static IVersionControl *findVersionControlForDirectory(const Utils::FilePath &directory, - QString *topLevelDirectory = nullptr); + Utils::FilePath *topLevelDirectory = nullptr); static Utils::FilePath findTopLevelForDirectory(const Utils::FilePath &directory); static QStringList repositories(const IVersionControl *); diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index eaeb1e5c302..edc3913ccdc 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -3,6 +3,7 @@ #include "cpasterplugin.h" +#include "cpastertr.h" #include "dpastedotcomprotocol.h" #include "fileshareprotocol.h" #include "pastebindotcomprotocol.h" @@ -44,8 +45,6 @@ namespace CodePaster { class CodePasterPluginPrivate : public QObject { - Q_DECLARE_TR_FUNCTIONS(CodePaster::CodepasterPlugin) - public: CodePasterPluginPrivate(); @@ -149,24 +148,24 @@ CodePasterPluginPrivate::CodePasterPluginPrivate() ActionContainer *toolsContainer = ActionManager::actionContainer(Core::Constants::M_TOOLS); ActionContainer *cpContainer = ActionManager::createMenu("CodePaster"); - cpContainer->menu()->setTitle(tr("&Code Pasting")); + cpContainer->menu()->setTitle(Tr::tr("&Code Pasting")); toolsContainer->addMenu(cpContainer); Command *command; - m_postEditorAction = new QAction(tr("Paste Snippet..."), this); + m_postEditorAction = new QAction(Tr::tr("Paste Snippet..."), this); command = ActionManager::registerAction(m_postEditorAction, "CodePaster.Post"); - command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+P") : tr("Alt+C,Alt+P"))); + command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+C,Meta+P") : Tr::tr("Alt+C,Alt+P"))); connect(m_postEditorAction, &QAction::triggered, this, &CodePasterPluginPrivate::pasteSnippet); cpContainer->addAction(command); - m_fetchAction = new QAction(tr("Fetch Snippet..."), this); + m_fetchAction = new QAction(Tr::tr("Fetch Snippet..."), this); command = ActionManager::registerAction(m_fetchAction, "CodePaster.Fetch"); - command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+F") : tr("Alt+C,Alt+F"))); + command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+C,Meta+F") : Tr::tr("Alt+C,Alt+F"))); connect(m_fetchAction, &QAction::triggered, this, &CodePasterPluginPrivate::fetch); cpContainer->addAction(command); - m_fetchUrlAction = new QAction(tr("Fetch from URL..."), this); + m_fetchUrlAction = new QAction(Tr::tr("Fetch from URL..."), this); command = ActionManager::registerAction(m_fetchUrlAction, "CodePaster.FetchUrl"); connect(m_fetchUrlAction, &QAction::triggered, this, &CodePasterPluginPrivate::fetchUrl); cpContainer->addAction(command); @@ -268,7 +267,7 @@ void CodePasterPluginPrivate::fetchUrl() QUrl url; do { bool ok = true; - url = QUrl(QInputDialog::getText(ICore::dialogParent(), tr("Fetch from URL"), tr("Enter URL:"), QLineEdit::Normal, QString(), &ok)); + url = QUrl(QInputDialog::getText(ICore::dialogParent(), Tr::tr("Fetch from URL"), Tr::tr("Enter URL:"), QLineEdit::Normal, QString(), &ok)); if (!ok) return; } while (!url.isValid()); @@ -357,7 +356,7 @@ void CodePasterPluginPrivate::finishFetch(const QString &titleDescription, } if (content.isEmpty()) { MessageManager::writeDisrupting( - tr("Empty snippet received for \"%1\".").arg(titleDescription)); + Tr::tr("Empty snippet received for \"%1\".").arg(titleDescription)); return; } // If the mime type has a preferred suffix (cpp/h/patch...), use that for diff --git a/src/plugins/cpaster/dpastedotcomprotocol.cpp b/src/plugins/cpaster/dpastedotcomprotocol.cpp index 3f87884e652..107343f8236 100644 --- a/src/plugins/cpaster/dpastedotcomprotocol.cpp +++ b/src/plugins/cpaster/dpastedotcomprotocol.cpp @@ -3,6 +3,8 @@ #include "dpastedotcomprotocol.h" +#include "cpastertr.h" + #include #include @@ -124,8 +126,8 @@ bool DPasteDotComProtocol::checkConfiguration(QString * /*errorMessage*/) void DPasteDotComProtocol::reportError(const QString &message) { - const QString fullMessage = tr("%1: %2").arg(protocolName(), message); + const QString fullMessage = Tr::tr("%1: %2").arg(protocolName(), message); Core::MessageManager::writeDisrupting(fullMessage); } -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/dpastedotcomprotocol.h b/src/plugins/cpaster/dpastedotcomprotocol.h index 34842dda877..88662243a60 100644 --- a/src/plugins/cpaster/dpastedotcomprotocol.h +++ b/src/plugins/cpaster/dpastedotcomprotocol.h @@ -9,7 +9,6 @@ namespace CodePaster { class DPasteDotComProtocol : public NetworkProtocol { - Q_OBJECT public: static QString protocolName(); @@ -30,4 +29,4 @@ private: static void reportError(const QString &message); }; -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/fileshareprotocol.cpp b/src/plugins/cpaster/fileshareprotocol.cpp index 0212924c932..5251c18538b 100644 --- a/src/plugins/cpaster/fileshareprotocol.cpp +++ b/src/plugins/cpaster/fileshareprotocol.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "fileshareprotocol.h" + +#include "cpastertr.h" #include "fileshareprotocolsettingspage.h" #include @@ -74,7 +76,7 @@ static bool parse(const QString &fileName, QFile file(fileName); if (!file.open(QIODevice::ReadOnly|QIODevice::Text)) { - *errorMessage = FileShareProtocol::tr("Cannot open %1: %2").arg(fileName, file.errorString()); + *errorMessage = Tr::tr("Cannot open %1: %2").arg(fileName, file.errorString()); return false; } QXmlStreamReader reader(&file); @@ -83,7 +85,7 @@ static bool parse(const QString &fileName, const auto elementName = reader.name(); // Check start element if (elementCount == 0 && elementName != QLatin1String(pasterElementC)) { - *errorMessage = FileShareProtocol::tr("%1 does not appear to be a paster file.").arg(fileName); + *errorMessage = Tr::tr("%1 does not appear to be a paster file.").arg(fileName); return false; } // Parse elements @@ -97,7 +99,7 @@ static bool parse(const QString &fileName, } } if (reader.hasError()) { - *errorMessage = FileShareProtocol::tr("Error in %1 at %2: %3") + *errorMessage = Tr::tr("Error in %1 at %2: %3") .arg(fileName).arg(reader.lineNumber()).arg(reader.errorString()); return false; } @@ -108,7 +110,7 @@ bool FileShareProtocol::checkConfiguration(QString *errorMessage) { if (m_settings.path.value().isEmpty()) { if (errorMessage) - *errorMessage = tr("Please configure a path."); + *errorMessage = Tr::tr("Please configure a path."); return false; } return true; diff --git a/src/plugins/cpaster/fileshareprotocol.h b/src/plugins/cpaster/fileshareprotocol.h index 00820122cfe..262a8f77c58 100644 --- a/src/plugins/cpaster/fileshareprotocol.h +++ b/src/plugins/cpaster/fileshareprotocol.h @@ -15,8 +15,6 @@ class FileShareProtocolSettingsPage; class FileShareProtocol : public Protocol { - Q_OBJECT - public: FileShareProtocol(); ~FileShareProtocol() override; @@ -40,4 +38,4 @@ private: FileShareProtocolSettingsPage *m_settingsPage; }; -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index 3661f6d9e28..dbbdbb862b7 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "fileshareprotocolsettingspage.h" + +#include "cpastertr.h" #include "cpasterconstants.h" #include @@ -21,13 +23,13 @@ FileShareProtocolSettings::FileShareProtocolSettings() path.setDisplayStyle(StringAspect::PathChooserDisplay); path.setExpectedKind(PathChooser::ExistingDirectory); path.setDefaultValue(TemporaryDirectory::masterDirectoryPath()); - path.setLabelText(tr("&Path:")); + path.setLabelText(Tr::tr("&Path:")); registerAspect(&displayCount); displayCount.setSettingsKey("DisplayCount"); displayCount.setDefaultValue(10); - displayCount.setSuffix(' ' + tr("entries")); - displayCount.setLabelText(tr("&Display:")); + displayCount.setSuffix(' ' + Tr::tr("entries")); + displayCount.setLabelText(Tr::tr("&Display:")); } // Settings page @@ -35,14 +37,14 @@ FileShareProtocolSettings::FileShareProtocolSettings() FileShareProtocolSettingsPage::FileShareProtocolSettingsPage(FileShareProtocolSettings *settings) { setId("X.CodePaster.FileSharePaster"); - setDisplayName(FileShareProtocolSettings::tr("Fileshare")); + setDisplayName(Tr::tr("Fileshare")); setCategory(Constants::CPASTER_SETTINGS_CATEGORY); setSettings(settings); setLayouter([&s = *settings](QWidget *widget) { using namespace Layouting; - auto label = new QLabel(FileShareProtocolSettings::tr( + auto label = new QLabel(Tr::tr( "The fileshare-based paster protocol allows for sharing code snippets using " "simple files on a shared network drive. Files are never deleted.")); label->setWordWrap(true); diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.h b/src/plugins/cpaster/fileshareprotocolsettingspage.h index 78197f75e09..625d8ac071d 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.h +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.h @@ -11,8 +11,6 @@ namespace CodePaster { class FileShareProtocolSettings : public Utils::AspectContainer { - Q_DECLARE_TR_FUNCTIONS(CodePaster::FileShareProtocolSettings) - public: FileShareProtocolSettings(); @@ -26,4 +24,4 @@ public: explicit FileShareProtocolSettingsPage(FileShareProtocolSettings *settings); }; -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/pastebindotcomprotocol.cpp b/src/plugins/cpaster/pastebindotcomprotocol.cpp index 852f41188e6..9aef023ec88 100644 --- a/src/plugins/cpaster/pastebindotcomprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp @@ -14,17 +14,17 @@ enum { debug = 0 }; -static const char PASTEBIN_BASE[]="https://pastebin.com/"; -static const char PASTEBIN_API[]="api/api_post.php"; -static const char PASTEBIN_RAW[]="raw/"; -static const char PASTEBIN_ARCHIVE[]="archive"; - -static const char API_KEY[]="api_dev_key=516686fc461fb7f9341fd7cf2af6f829&"; // user: qtcreator_apikey - -static const char PROTOCOL_NAME[] = "Pastebin.Com"; - namespace CodePaster { +const char PASTEBIN_BASE[]="https://pastebin.com/"; +const char PASTEBIN_API[]="api/api_post.php"; +const char PASTEBIN_RAW[]="raw/"; +const char PASTEBIN_ARCHIVE[]="archive"; + +const char API_KEY[]="api_dev_key=516686fc461fb7f9341fd7cf2af6f829&"; // user: qtcreator_apikey + +const char PROTOCOL_NAME[] = "Pastebin.Com"; + QString PasteBinDotComProtocol::protocolName() { return QLatin1String(PROTOCOL_NAME); @@ -470,4 +470,4 @@ void PasteBinDotComProtocol::listFinished() m_listReply = nullptr; } -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/pastebindotcomprotocol.h b/src/plugins/cpaster/pastebindotcomprotocol.h index 658b26a2812..740fbca7447 100644 --- a/src/plugins/cpaster/pastebindotcomprotocol.h +++ b/src/plugins/cpaster/pastebindotcomprotocol.h @@ -9,7 +9,6 @@ namespace CodePaster { class PasteBinDotComProtocol : public NetworkProtocol { - Q_OBJECT public: static QString protocolName(); QString name() const override { return protocolName(); } @@ -39,4 +38,4 @@ private: bool m_hostChecked = false; }; -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/pasteselectdialog.cpp b/src/plugins/cpaster/pasteselectdialog.cpp index 9c7fc6ae058..3454824fbf4 100644 --- a/src/plugins/cpaster/pasteselectdialog.cpp +++ b/src/plugins/cpaster/pasteselectdialog.cpp @@ -3,6 +3,7 @@ #include "pasteselectdialog.h" +#include "cpastertr.h" #include "protocol.h" #include @@ -37,7 +38,7 @@ PasteSelectDialog::PasteSelectDialog(const QList &protocols, QWidget auto buttons = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - m_refreshButton = buttons->addButton(tr("Refresh"), QDialogButtonBox::ActionRole); + m_refreshButton = buttons->addButton(Tr::tr("Refresh"), QDialogButtonBox::ActionRole); m_listWidget->setSelectionMode(QAbstractItemView::SingleSelection); if (!Utils::HostOsInfo::isMacHost()) @@ -52,8 +53,8 @@ PasteSelectDialog::PasteSelectDialog(const QList &protocols, QWidget using namespace Utils::Layouting; Column { Form { - tr("Protocol:"), m_protocolBox, br, - tr("Paste:"), m_pasteEdit + Tr::tr("Protocol:"), m_protocolBox, br, + Tr::tr("Paste:"), m_pasteEdit }, m_listWidget, buttons @@ -126,7 +127,7 @@ void PasteSelectDialog::list() m_listWidget->clear(); if (Protocol::ensureConfiguration(protocol, this)) { - m_listWidget->addItem(new QListWidgetItem(tr("Waiting for items"))); + m_listWidget->addItem(new QListWidgetItem(Tr::tr("Waiting for items"))); protocol->list(); } } @@ -139,7 +140,8 @@ void PasteSelectDialog::protocolChanged(int i) list(); } else { m_listWidget->clear(); - m_listWidget->addItem(new QListWidgetItem(tr("This protocol does not support listing"))); + m_listWidget->addItem(new QListWidgetItem(Tr::tr("This protocol does not support listing"))); } } -} // namespace CodePaster + +} // CodePaster diff --git a/src/plugins/cpaster/pasteselectdialog.h b/src/plugins/cpaster/pasteselectdialog.h index caf4f581e96..8c82adbe4ac 100644 --- a/src/plugins/cpaster/pasteselectdialog.h +++ b/src/plugins/cpaster/pasteselectdialog.h @@ -19,7 +19,6 @@ class Protocol; class PasteSelectDialog : public QDialog { - Q_OBJECT public: explicit PasteSelectDialog(const QList &protocols, QWidget *parent = nullptr); diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp index e75ee805dab..5d3d9816ef9 100644 --- a/src/plugins/cpaster/pasteview.cpp +++ b/src/plugins/cpaster/pasteview.cpp @@ -4,6 +4,7 @@ #include "pasteview.h" #include "columnindicatortextedit.h" +#include "cpastertr.h" #include "protocol.h" #include @@ -26,36 +27,36 @@ #include #include +namespace CodePaster { + const char groupC[] = "CPaster"; const char heightKeyC[] = "PasteViewHeight"; const char widthKeyC[] = "PasteViewWidth"; -namespace CodePaster { - PasteView::PasteView(const QList &protocols, const QString &mt, QWidget *parent) : QDialog(parent), m_protocols(protocols), - m_commentPlaceHolder(tr("")), + m_commentPlaceHolder(Tr::tr("")), m_mimeType(mt) { resize(670, 678); - setWindowTitle(tr("Send to Codepaster")); + setWindowTitle(Tr::tr("Send to Codepaster")); m_protocolBox = new QComboBox; for (const Protocol *p : protocols) m_protocolBox->addItem(p->name()); m_expirySpinBox = new QSpinBox; - m_expirySpinBox->setSuffix(tr(" Days")); + m_expirySpinBox->setSuffix(Tr::tr(" Days")); m_expirySpinBox->setRange(1, 365); m_uiUsername = new QLineEdit(this); - m_uiUsername->setPlaceholderText(tr("")); + m_uiUsername->setPlaceholderText(Tr::tr("")); m_uiDescription = new QLineEdit(this); - m_uiDescription->setPlaceholderText(tr("")); + m_uiDescription->setPlaceholderText(Tr::tr("")); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -78,7 +79,7 @@ PasteView::PasteView(const QList &protocols, m_uiPatchView->setFont(font); m_uiPatchView->setReadOnly(true); - auto groupBox = new QGroupBox(tr("Parts to Send to Server")); + auto groupBox = new QGroupBox(Tr::tr("Parts to Send to Server")); groupBox->setFlat(true); m_plainTextEdit = new QPlainTextEdit; @@ -89,7 +90,7 @@ PasteView::PasteView(const QList &protocols, m_stackedWidget->setCurrentIndex(0); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Paste")); + buttonBox->button(QDialogButtonBox::Ok)->setText(Tr::tr("Paste")); const bool __sortingEnabled = m_uiPatchList->isSortingEnabled(); m_uiPatchList->setSortingEnabled(false); @@ -104,10 +105,10 @@ PasteView::PasteView(const QList &protocols, Column { Form { - tr("Protocol:"), m_protocolBox, br, - tr("&Expires after:"), m_expirySpinBox, br, - tr("&Username:"), m_uiUsername, br, - tr("&Description:"), m_uiDescription, + Tr::tr("Protocol:"), m_protocolBox, br, + Tr::tr("&Expires after:"), m_expirySpinBox, br, + Tr::tr("&Username:"), m_uiUsername, br, + Tr::tr("&Description:"), m_uiDescription, }, m_uiComment, m_stackedWidget, diff --git a/src/plugins/cpaster/pasteview.h b/src/plugins/cpaster/pasteview.h index 108e8881515..e6c11763857 100644 --- a/src/plugins/cpaster/pasteview.h +++ b/src/plugins/cpaster/pasteview.h @@ -24,8 +24,6 @@ class Protocol; class PasteView : public QDialog { - Q_OBJECT - public: enum Mode { @@ -83,4 +81,4 @@ private: Mode m_mode = DiffChunkMode; }; -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/protocol.cpp b/src/plugins/cpaster/protocol.cpp index 4e0ca214652..7f76f0d81bc 100644 --- a/src/plugins/cpaster/protocol.cpp +++ b/src/plugins/cpaster/protocol.cpp @@ -3,6 +3,8 @@ #include "protocol.h" +#include "cpastertr.h" + #include #include @@ -13,18 +15,16 @@ #include #include +#include +#include +#include #include #include -#include #include - -#include -#include -#include - -#include -#include +#include #include +#include +#include #include @@ -140,7 +140,7 @@ bool Protocol::showConfigurationError(const Protocol *p, if (!parent) parent = Core::ICore::dialogParent(); - const QString title = tr("%1 - Configuration Error").arg(p->name()); + const QString title = Tr::tr("%1 - Configuration Error").arg(p->name()); QMessageBox mb(QMessageBox::Warning, title, message, QMessageBox::Cancel, parent); QPushButton *settingsButton = nullptr; if (showConfig) @@ -197,8 +197,8 @@ bool NetworkProtocol::httpStatus(QString url, QString *errorMessage, bool useHtt } std::unique_ptr reply(httpGet(url)); QMessageBox box(QMessageBox::Information, - tr("Checking connection"), - tr("Connecting to %1...").arg(url), + Tr::tr("Checking connection"), + Tr::tr("Connecting to %1...").arg(url), QMessageBox::Cancel, Core::ICore::dialogParent()); connect(reply.get(), &QNetworkReply::finished, &box, &QWidget::close); @@ -219,4 +219,4 @@ bool NetworkProtocol::httpStatus(QString url, QString *errorMessage, bool useHtt return false; } -} //namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/protocol.h b/src/plugins/cpaster/protocol.h index d4f0db9b396..f5e15dbf3e2 100644 --- a/src/plugins/cpaster/protocol.h +++ b/src/plugins/cpaster/protocol.h @@ -82,8 +82,6 @@ protected: class NetworkProtocol : public Protocol { - Q_OBJECT - public: NetworkProtocol() = default; diff --git a/src/plugins/cpaster/settings.cpp b/src/plugins/cpaster/settings.cpp index b9046d1b526..f86c62029d8 100644 --- a/src/plugins/cpaster/settings.cpp +++ b/src/plugins/cpaster/settings.cpp @@ -4,6 +4,7 @@ #include "settings.h" #include "cpasterconstants.h" +#include "cpastertr.h" #include @@ -19,12 +20,12 @@ Settings::Settings() registerAspect(&username); username.setDisplayStyle(StringAspect::LineEditDisplay); username.setSettingsKey("UserName"); - username.setLabelText(tr("Username:")); + username.setLabelText(Tr::tr("Username:")); registerAspect(&protocols); protocols.setSettingsKey("DefaultProtocol"); protocols.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); - protocols.setLabelText(tr("Default protocol:")); + protocols.setLabelText(Tr::tr("Default protocol:")); protocols.setToSettingsTransformation([this](const QVariant &val) { return protocols.displayForIndex(val.toInt()); }); @@ -35,18 +36,18 @@ Settings::Settings() registerAspect(&expiryDays); expiryDays.setSettingsKey("ExpiryDays"); expiryDays.setDefaultValue(1); - expiryDays.setSuffix(tr(" Days")); - expiryDays.setLabelText(tr("&Expires after:")); + expiryDays.setSuffix(Tr::tr(" Days")); + expiryDays.setLabelText(Tr::tr("&Expires after:")); registerAspect(©ToClipboard); copyToClipboard.setSettingsKey("CopyToClipboard"); copyToClipboard.setDefaultValue(true); - copyToClipboard.setLabelText(tr("Copy-paste URL to clipboard")); + copyToClipboard.setLabelText(Tr::tr("Copy-paste URL to clipboard")); registerAspect(&displayOutput); displayOutput.setSettingsKey("DisplayOutput"); displayOutput.setDefaultValue(true); - displayOutput.setLabelText(tr("Display General Messages after sending a post")); + displayOutput.setLabelText(Tr::tr("Display General Messages after sending a post")); } // SettingsPage @@ -54,9 +55,9 @@ Settings::Settings() SettingsPage::SettingsPage(Settings *settings) { setId("A.CodePaster.General"); - setDisplayName(Settings::tr("General")); + setDisplayName(Tr::tr("General")); setCategory(Constants::CPASTER_SETTINGS_CATEGORY); - setDisplayCategory(Settings::tr("Code Pasting")); + setDisplayCategory(Tr::tr("Code Pasting")); setCategoryIconPath(":/cpaster/images/settingscategory_cpaster.png"); setSettings(settings); @@ -77,4 +78,4 @@ SettingsPage::SettingsPage(Settings *settings) }); } -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/settings.h b/src/plugins/cpaster/settings.h index 17184d45580..1e37f6f8126 100644 --- a/src/plugins/cpaster/settings.h +++ b/src/plugins/cpaster/settings.h @@ -11,8 +11,6 @@ namespace CodePaster { class Settings : public Utils::AspectContainer { - Q_DECLARE_TR_FUNCTIONS(CodePaster::Settings) - public: Settings(); @@ -29,4 +27,4 @@ public: SettingsPage(Settings *settings); }; -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/stickynotespasteprotocol.cpp b/src/plugins/cpaster/stickynotespasteprotocol.cpp index a48a419ed1d..3d7edd41cd1 100644 --- a/src/plugins/cpaster/stickynotespasteprotocol.cpp +++ b/src/plugins/cpaster/stickynotespasteprotocol.cpp @@ -2,8 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "stickynotespasteprotocol.h" -#ifdef CPASTER_PLUGIN_GUI -#endif + +#include "cpastertr.h" #include #include @@ -21,7 +21,9 @@ enum { debug = 0 }; -static inline QByteArray expiryParameter(int daysRequested) +namespace CodePaster { + +static QByteArray expiryParameter(int daysRequested) { // Obtained by 'pastebin.kde.org/api/json/parameter/expire' on 26.03.2014 static const int expiryTimesSec[] = {1800, 21600, 86400, 604800, 2592000, 31536000}; @@ -31,8 +33,6 @@ static inline QByteArray expiryParameter(int daysRequested) return QByteArray("expire=") + QByteArray::number(*match); } -namespace CodePaster { - void StickyNotesPasteProtocol::setHostUrl(const QString &hostUrl) { m_hostUrl = hostUrl; @@ -246,5 +246,4 @@ void StickyNotesPasteProtocol::listFinished() m_listReply = nullptr; } - -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/stickynotespasteprotocol.h b/src/plugins/cpaster/stickynotespasteprotocol.h index 264be22fd06..e497fac2d8d 100644 --- a/src/plugins/cpaster/stickynotespasteprotocol.h +++ b/src/plugins/cpaster/stickynotespasteprotocol.h @@ -9,7 +9,6 @@ namespace CodePaster { class StickyNotesPasteProtocol : public NetworkProtocol { - Q_OBJECT public: unsigned capabilities() const override; @@ -22,15 +21,12 @@ public: const QString &description = QString()) override; void list() override; - - QString hostUrl() const { return m_hostUrl; } void setHostUrl(const QString &hostUrl); -protected: +private: bool checkConfiguration(QString *errorMessage = nullptr) override; -private: void fetchFinished(); void pasteFinished(); void listFinished(); @@ -46,4 +42,4 @@ private: bool m_hostChecked = false; }; -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cpaster/urlopenprotocol.cpp b/src/plugins/cpaster/urlopenprotocol.cpp index 39d1a3beb65..64c2029cabd 100644 --- a/src/plugins/cpaster/urlopenprotocol.cpp +++ b/src/plugins/cpaster/urlopenprotocol.cpp @@ -7,7 +7,7 @@ #include -using namespace CodePaster; +namespace CodePaster { QString UrlOpenProtocol::name() const { @@ -45,3 +45,5 @@ void UrlOpenProtocol::paste(const QString &, ContentType, int, const QString &, const QString &, const QString &) { } + +} // CodePaster diff --git a/src/plugins/cpaster/urlopenprotocol.h b/src/plugins/cpaster/urlopenprotocol.h index d6d16e56b11..8bc5695b018 100644 --- a/src/plugins/cpaster/urlopenprotocol.h +++ b/src/plugins/cpaster/urlopenprotocol.h @@ -9,7 +9,6 @@ namespace CodePaster { class UrlOpenProtocol : public NetworkProtocol { - Q_OBJECT public: QString name() const override; unsigned capabilities() const override; @@ -22,4 +21,4 @@ private: QNetworkReply *m_fetchReply = nullptr; }; -} // namespace CodePaster +} // CodePaster diff --git a/src/plugins/cppeditor/CMakeLists.txt b/src/plugins/cppeditor/CMakeLists.txt index 7f32e3faa7a..98395e52b97 100644 --- a/src/plugins/cppeditor/CMakeLists.txt +++ b/src/plugins/cppeditor/CMakeLists.txt @@ -11,11 +11,10 @@ add_qtc_plugin(CppEditor builtineditordocumentparser.cpp builtineditordocumentparser.h builtineditordocumentprocessor.cpp builtineditordocumentprocessor.h builtinindexingsupport.cpp builtinindexingsupport.h - clangbasechecks.ui clangdiagnosticconfig.cpp clangdiagnosticconfig.h clangdiagnosticconfigsmodel.cpp clangdiagnosticconfigsmodel.h clangdiagnosticconfigsselectionwidget.cpp clangdiagnosticconfigsselectionwidget.h - clangdiagnosticconfigswidget.cpp clangdiagnosticconfigswidget.h clangdiagnosticconfigswidget.ui + clangdiagnosticconfigswidget.cpp clangdiagnosticconfigswidget.h compileroptionsbuilder.cpp compileroptionsbuilder.h cppautocompleter.cpp cppautocompleter.h cppbuiltinmodelmanagersupport.cpp cppbuiltinmodelmanagersupport.h @@ -66,7 +65,7 @@ add_qtc_plugin(CppEditor cppoutlinemodel.cpp cppoutlinemodel.h cppparsecontext.cpp cppparsecontext.h cpppointerdeclarationformatter.cpp cpppointerdeclarationformatter.h - cpppreprocessordialog.cpp cpppreprocessordialog.h cpppreprocessordialog.ui + cpppreprocessordialog.cpp cpppreprocessordialog.h cppprojectfile.cpp cppprojectfile.h cppprojectfilecategorizer.cpp cppprojectfilecategorizer.h cppprojectinfogenerator.cpp cppprojectinfogenerator.h diff --git a/src/plugins/cppeditor/clangbasechecks.ui b/src/plugins/cppeditor/clangbasechecks.ui deleted file mode 100644 index 784771564be..00000000000 --- a/src/plugins/cppeditor/clangbasechecks.ui +++ /dev/null @@ -1,48 +0,0 @@ - - - CppEditor::ClangBaseChecks - - - - 0 - 0 - 665 - 300 - - - - - - - - - - For appropriate options, consult the GCC or Clang manual pages or the <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html">GCC online documentation</a>. - - - true - - - - - - - Use diagnostic flags from build system - - - - - - - - - - - CppEditor::WrappableLineEdit - QLineEdit -
cppeditor/wrappablelineedit.h
-
-
- - -
diff --git a/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp b/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp index f53aca16502..7ffd36d7e01 100644 --- a/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp +++ b/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp @@ -4,20 +4,30 @@ #include "clangdiagnosticconfigswidget.h" #include "clangdiagnosticconfigsmodel.h" -#include "ui_clangdiagnosticconfigswidget.h" -#include "ui_clangbasechecks.h" +#include "wrappablelineedit.h" #include #include +#include +#include #include #include +#include +#include +#include #include +#include #include +#include +#include +#include + +using namespace Utils; namespace CppEditor { -class ConfigNode : public Utils::TreeItem +class ConfigNode : public TreeItem { public: ConfigNode(const ClangDiagnosticConfig &config) @@ -34,11 +44,11 @@ public: ClangDiagnosticConfig config; }; -class GroupNode : public Utils::StaticTreeItem +class GroupNode : public StaticTreeItem { public: GroupNode(const QString &text) - : Utils::StaticTreeItem(text) + : StaticTreeItem(text) {} Qt::ItemFlags flags(int) const final { return {}; } @@ -49,11 +59,11 @@ public: return QApplication::palette().color(QPalette::ColorGroup::Normal, QPalette::ColorRole::Text); } - return Utils::StaticTreeItem::data(column, role); + return StaticTreeItem::data(column, role); } }; -class ConfigsModel : public Utils::TreeModel +class ConfigsModel : public TreeModel { Q_OBJECT @@ -66,7 +76,7 @@ public: rootItem()->appendChild(m_customRoot); for (const ClangDiagnosticConfig &config : configs) { - Utils::TreeItem *parent = config.isReadOnly() ? m_builtinRoot : m_customRoot; + TreeItem *parent = config.isReadOnly() ? m_builtinRoot : m_customRoot; parent->appendChild(new ConfigNode(config)); } } @@ -88,13 +98,13 @@ public: m_customRoot->appendChild(new ConfigNode(config)); } - void removeConfig(const Utils::Id &id) + void removeConfig(const Id &id) { ConfigNode *node = itemForConfigId(id); node->parent()->removeChildAt(node->indexInParent()); } - ConfigNode *itemForConfigId(const Utils::Id &id) const + ConfigNode *itemForConfigId(const Id &id) const { return findItemAtLevel<2>([id](const ConfigNode *node) { return node->config.id() == id; @@ -102,50 +112,94 @@ public: } private: - Utils::TreeItem *m_builtinRoot = nullptr; - Utils::TreeItem *m_customRoot = nullptr; + TreeItem *m_builtinRoot = nullptr; + TreeItem *m_customRoot = nullptr; +}; + +class ClangBaseChecksWidget : public QWidget +{ + Q_DECLARE_TR_FUNCTIONS(CppEditor::ClangBaseChecks) + +public: + ClangBaseChecksWidget() + { + auto label = new QLabel(tr("For appropriate options, consult the GCC or Clang manual " + "pages or the " + "GCC online documentation.")); + label->setOpenExternalLinks(true); + + useFlagsFromBuildSystemCheckBox = new QCheckBox(tr("Use diagnostic flags from build system")); + + diagnosticOptionsTextEdit = new WrappableLineEdit; + + using namespace Layouting; + + Column { + label, + useFlagsFromBuildSystemCheckBox, + diagnosticOptionsTextEdit + }.attachTo(this); + } + + QCheckBox *useFlagsFromBuildSystemCheckBox; + WrappableLineEdit *diagnosticOptionsTextEdit; }; ClangDiagnosticConfigsWidget::ClangDiagnosticConfigsWidget(const ClangDiagnosticConfigs &configs, - const Utils::Id &configToSelect, + const Id &configToSelect, QWidget *parent) : QWidget(parent) - , m_ui(new Ui::ClangDiagnosticConfigsWidget) , m_configsModel(new ConfigsModel(configs)) { - m_ui->setupUi(this); - m_ui->configsView->setHeaderHidden(true); - m_ui->configsView->setUniformRowHeights(true); - m_ui->configsView->setRootIsDecorated(false); - m_ui->configsView->setModel(m_configsModel); - m_ui->configsView->setCurrentIndex(m_configsModel->itemForConfigId(configToSelect)->index()); - m_ui->configsView->setItemsExpandable(false); - m_ui->configsView->expandAll(); - connect(m_ui->configsView->selectionModel(), - &QItemSelectionModel::currentChanged, - this, - &ClangDiagnosticConfigsWidget::sync); + auto copyButton = new QPushButton(tr("Copy...")); + m_renameButton = new QPushButton(tr("Rename...")); + m_removeButton = new QPushButton(tr("Remove")); - m_clangBaseChecks = std::make_unique(); - m_clangBaseChecksWidget = new QWidget(); - m_clangBaseChecks->setupUi(m_clangBaseChecksWidget); + m_infoLabel = new InfoLabel; - m_ui->tabWidget->addTab(m_clangBaseChecksWidget, tr("Clang Warnings")); - m_ui->tabWidget->setCurrentIndex(0); + m_configsView = new QTreeView; + m_configsView->setHeaderHidden(true); + m_configsView->setUniformRowHeights(true); + m_configsView->setRootIsDecorated(false); + m_configsView->setModel(m_configsModel); + m_configsView->setCurrentIndex(m_configsModel->itemForConfigId(configToSelect)->index()); + m_configsView->setItemsExpandable(false); + m_configsView->expandAll(); - connect(m_ui->copyButton, &QPushButton::clicked, + m_clangBaseChecks = new ClangBaseChecksWidget; + + m_tabWidget = new QTabWidget; + m_tabWidget->addTab(m_clangBaseChecks, tr("Clang Warnings")); + + using namespace Layouting; + + Column { + Row { + m_configsView, + Column { + copyButton, + m_renameButton, + m_removeButton, + st + } + }, + m_infoLabel, + m_tabWidget + }.attachTo(this); + + connect(copyButton, &QPushButton::clicked, this, &ClangDiagnosticConfigsWidget::onCopyButtonClicked); - connect(m_ui->renameButton, &QPushButton::clicked, + connect(m_renameButton, &QPushButton::clicked, this, &ClangDiagnosticConfigsWidget::onRenameButtonClicked); - connect(m_ui->removeButton, &QPushButton::clicked, + connect(m_removeButton, &QPushButton::clicked, this, &ClangDiagnosticConfigsWidget::onRemoveButtonClicked); + connect(m_configsView->selectionModel(), &QItemSelectionModel::currentChanged, + this, &ClangDiagnosticConfigsWidget::sync); + connectClangOnlyOptionsChanged(); } -ClangDiagnosticConfigsWidget::~ClangDiagnosticConfigsWidget() -{ - delete m_ui; -} +ClangDiagnosticConfigsWidget::~ClangDiagnosticConfigsWidget() = default; void ClangDiagnosticConfigsWidget::onCopyButtonClicked() { @@ -162,7 +216,7 @@ void ClangDiagnosticConfigsWidget::onCopyButtonClicked() = ClangDiagnosticConfigsModel::createCustomConfig(config, newName); m_configsModel->appendCustomConfig(customConfig); - m_ui->configsView->setCurrentIndex( + m_configsView->setCurrentIndex( m_configsModel->itemForConfigId(customConfig.id())->index()); sync(); m_clangBaseChecks->diagnosticOptionsTextEdit->setFocus(); @@ -188,15 +242,15 @@ void ClangDiagnosticConfigsWidget::onRenameButtonClicked() const ClangDiagnosticConfig ClangDiagnosticConfigsWidget::currentConfig() const { - Utils::TreeItem *item = m_configsModel->itemForIndex(m_ui->configsView->currentIndex()); + TreeItem *item = m_configsModel->itemForIndex(m_configsView->currentIndex()); return static_cast(item)->config; } void ClangDiagnosticConfigsWidget::onRemoveButtonClicked() { - const Utils::Id configToRemove = currentConfig().id(); + const Id configToRemove = currentConfig().id(); if (m_configsModel->customConfigsCount() == 1) - m_ui->configsView->setCurrentIndex(m_configsModel->fallbackConfigIndex()); + m_configsView->setCurrentIndex(m_configsModel->fallbackConfigIndex()); m_configsModel->removeConfig(configToRemove); sync(); } @@ -266,16 +320,16 @@ void ClangDiagnosticConfigsWidget::onClangOnlyOptionsChanged() void ClangDiagnosticConfigsWidget::sync() { - if (!m_ui->configsView->currentIndex().isValid()) + if (!m_configsView->currentIndex().isValid()) return; disconnectClangOnlyOptionsChanged(); - Utils::ExecuteOnDestruction e([this] { connectClangOnlyOptionsChanged(); }); + ExecuteOnDestruction e([this] { connectClangOnlyOptionsChanged(); }); // Update main button row const ClangDiagnosticConfig &config = currentConfig(); - m_ui->removeButton->setEnabled(!config.isReadOnly()); - m_ui->renameButton->setEnabled(!config.isReadOnly()); + m_removeButton->setEnabled(!config.isReadOnly()); + m_renameButton->setEnabled(!config.isReadOnly()); // Update check box m_clangBaseChecks->useFlagsFromBuildSystemCheckBox->setChecked(config.useBuildSystemWarnings()); @@ -285,12 +339,12 @@ void ClangDiagnosticConfigsWidget::sync() ? m_notAcceptedOptions.value(config.id()) : config.clangOptions().join(QLatin1Char(' ')); setDiagnosticOptions(options); - m_clangBaseChecksWidget->setEnabled(!config.isReadOnly()); + m_clangBaseChecks->setEnabled(!config.isReadOnly()); if (config.isReadOnly()) { - m_ui->infoLabel->setType(Utils::InfoLabel::Information); - m_ui->infoLabel->setText(tr("Copy this configuration to customize it.")); - m_ui->infoLabel->setFilled(false); + m_infoLabel->setType(InfoLabel::Information); + m_infoLabel->setText(tr("Copy this configuration to customize it.")); + m_infoLabel->setFilled(false); } syncExtraWidgets(config); @@ -314,13 +368,13 @@ void ClangDiagnosticConfigsWidget::setDiagnosticOptions(const QString &options) void ClangDiagnosticConfigsWidget::updateValidityWidgets(const QString &errorMessage) { if (errorMessage.isEmpty()) { - m_ui->infoLabel->setType(Utils::InfoLabel::Information); - m_ui->infoLabel->setText(tr("Configuration passes sanity checks.")); - m_ui->infoLabel->setFilled(false); + m_infoLabel->setType(InfoLabel::Information); + m_infoLabel->setText(tr("Configuration passes sanity checks.")); + m_infoLabel->setFilled(false); } else { - m_ui->infoLabel->setType(Utils::InfoLabel::Error); - m_ui->infoLabel->setText(tr("%1").arg(errorMessage)); - m_ui->infoLabel->setFilled(true); + m_infoLabel->setType(InfoLabel::Error); + m_infoLabel->setText(tr("%1").arg(errorMessage)); + m_infoLabel->setFilled(true); } } @@ -338,8 +392,7 @@ void ClangDiagnosticConfigsWidget::connectClangOnlyOptionsChanged() void ClangDiagnosticConfigsWidget::disconnectClangOnlyOptionsChanged() { - disconnect(m_clangBaseChecks->useFlagsFromBuildSystemCheckBox, - &QCheckBox::stateChanged, + disconnect(m_clangBaseChecks->useFlagsFromBuildSystemCheckBox, &QCheckBox::stateChanged, this, &ClangDiagnosticConfigsWidget::onClangOnlyOptionsChanged); disconnect(m_clangBaseChecks->diagnosticOptionsTextEdit->document(), @@ -355,7 +408,7 @@ ClangDiagnosticConfigs ClangDiagnosticConfigsWidget::configs() const QTabWidget *ClangDiagnosticConfigsWidget::tabWidget() const { - return m_ui->tabWidget; + return m_tabWidget; } } // CppEditor namespace diff --git a/src/plugins/cppeditor/clangdiagnosticconfigswidget.h b/src/plugins/cppeditor/clangdiagnosticconfigswidget.h index 3bbca8b777b..2b088f6adda 100644 --- a/src/plugins/cppeditor/clangdiagnosticconfigswidget.h +++ b/src/plugins/cppeditor/clangdiagnosticconfigswidget.h @@ -10,20 +10,18 @@ #include #include -#include - QT_BEGIN_NAMESPACE +class QPushButton; class QTabWidget; +class QTreeView; QT_END_NAMESPACE +namespace Utils { class InfoLabel; } + namespace CppEditor { + class ClangDiagnosticConfig; - -namespace Ui { -class ClangDiagnosticConfigsWidget; -class ClangBaseChecks; -} - +class ClangBaseChecksWidget; class ConfigsModel; class CPPEDITOR_EXPORT ClangDiagnosticConfigsWidget : public QWidget @@ -60,12 +58,15 @@ private: void disconnectClangOnlyOptionsChanged(); private: - Ui::ClangDiagnosticConfigsWidget *m_ui; ConfigsModel *m_configsModel = nullptr; QHash m_notAcceptedOptions; - std::unique_ptr m_clangBaseChecks; - QWidget *m_clangBaseChecksWidget = nullptr; + ClangBaseChecksWidget *m_clangBaseChecks = nullptr; + QTreeView *m_configsView; + Utils::InfoLabel *m_infoLabel; + QTabWidget *m_tabWidget; + QPushButton *m_renameButton; + QPushButton *m_removeButton; }; } // CppEditor namespace diff --git a/src/plugins/cppeditor/clangdiagnosticconfigswidget.ui b/src/plugins/cppeditor/clangdiagnosticconfigswidget.ui deleted file mode 100644 index ff3f99d1227..00000000000 --- a/src/plugins/cppeditor/clangdiagnosticconfigswidget.ui +++ /dev/null @@ -1,87 +0,0 @@ - - - CppEditor::ClangDiagnosticConfigsWidget - - - - 0 - 0 - 665 - 300 - - - - - - - - - - - - - - - - - Copy... - - - - - - - Rename... - - - - - - - Remove - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - InfoText - - - - - - - - - - - - - Utils::InfoLabel - QLabel -
utils/infolabel.h
-
-
- - -
diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 36f7ae8d850..18512cf10c4 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -312,7 +312,7 @@ QVersionNumber ClangdSettings::clangdVersion(const FilePath &clangdFilePath) const auto it = versionCache.find(clangdFilePath); if (it == versionCache.end()) { const QVersionNumber version = getClangdVersion(clangdFilePath); - versionCache.insert(clangdFilePath, qMakePair(timeStamp, version)); + versionCache.insert(clangdFilePath, {timeStamp, version}); return version; } if (it->first != timeStamp) { diff --git a/src/plugins/cppeditor/cppeditor.qbs b/src/plugins/cppeditor/cppeditor.qbs index 28f1dc96ac1..5cb82d12a69 100644 --- a/src/plugins/cppeditor/cppeditor.qbs +++ b/src/plugins/cppeditor/cppeditor.qbs @@ -41,7 +41,6 @@ QtcPlugin { "builtineditordocumentprocessor.h", "builtinindexingsupport.cpp", "builtinindexingsupport.h", - "clangbasechecks.ui", // FIXME: Is this used at all? "clangdiagnosticconfig.cpp", "clangdiagnosticconfig.h", "clangdiagnosticconfigsmodel.cpp", @@ -50,7 +49,6 @@ QtcPlugin { "clangdiagnosticconfigsselectionwidget.h", "clangdiagnosticconfigswidget.cpp", "clangdiagnosticconfigswidget.h", - "clangdiagnosticconfigswidget.ui", "compileroptionsbuilder.cpp", "compileroptionsbuilder.h", "cppautocompleter.cpp", @@ -152,7 +150,6 @@ QtcPlugin { "cppprojectpartchooser.h", "cpppreprocessordialog.cpp", "cpppreprocessordialog.h", - "cpppreprocessordialog.ui", "cppprojectfile.cpp", "cppprojectfile.h", "cppprojectfilecategorizer.cpp", diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 94d69382420..55f173c4a5b 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -1321,7 +1321,7 @@ void CppEditorWidget::abortDeclDefLink() void CppEditorWidget::showPreProcessorWidget() { - const QString filePath = textDocument()->filePath().toString(); + const FilePath filePath = textDocument()->filePath(); CppPreProcessorDialog dialog(filePath, this); if (dialog.exec() == QDialog::Accepted) { diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp index 1cb7f41449d..281083f6ebd 100644 --- a/src/plugins/cppeditor/cppelementevaluator.cpp +++ b/src/plugins/cppeditor/cppelementevaluator.cpp @@ -154,7 +154,7 @@ void CppClass::lookupBases(QFutureInterfaceBase &futureInterface, QSet visited; QQueue q; - q.enqueue(qMakePair(clazz, this)); + q.enqueue({clazz, this}); while (!q.isEmpty()) { if (futureInterface.isCanceled()) return; @@ -171,7 +171,7 @@ void CppClass::lookupBases(QFutureInterfaceBase &futureInterface, CppClass baseCppClass(symbol); CppClass *cppClass = current.second; cppClass->bases.append(baseCppClass); - q.enqueue(qMakePair(clazz, &cppClass->bases.last())); + q.enqueue({clazz, &cppClass->bases.last()}); } } } @@ -191,7 +191,7 @@ void CppClass::lookupDerived(QFutureInterfaceBase &futureInterface, = TypeHierarchyBuilder::buildDerivedTypeHierarchy(futureInterface, declaration, snapshot); QQueue q; - q.enqueue(qMakePair(this, completeHierarchy)); + q.enqueue({this, completeHierarchy}); while (!q.isEmpty()) { if (futureInterface.isCanceled()) return; @@ -201,7 +201,7 @@ void CppClass::lookupDerived(QFutureInterfaceBase &futureInterface, const QList hierarchy = classHierarchy.hierarchy(); for (const TypeHierarchy &derivedHierarchy : hierarchy) { clazz->derived.append(CppClass(derivedHierarchy.symbol())); - q.enqueue(qMakePair(&clazz->derived.last(), derivedHierarchy)); + q.enqueue({&clazz->derived.last(), derivedHierarchy}); } } } diff --git a/src/plugins/cppeditor/cppoutlinemodel.cpp b/src/plugins/cppeditor/cppoutlinemodel.cpp index 9c0a8504896..1dbc53d2700 100644 --- a/src/plugins/cppeditor/cppoutlinemodel.cpp +++ b/src/plugins/cppeditor/cppoutlinemodel.cpp @@ -234,7 +234,7 @@ Utils::LineColumn OutlineModel::lineColumnFromIndex(const QModelIndex &sourceInd OutlineModel::Range OutlineModel::rangeFromIndex(const QModelIndex &sourceIndex) const { Utils::LineColumn lineColumn = lineColumnFromIndex(sourceIndex); - return std::make_pair(lineColumn, lineColumn); + return {lineColumn, lineColumn}; } void OutlineModel::buildTree(SymbolItem *root, bool isRoot) diff --git a/src/plugins/cppeditor/cpppreprocessordialog.cpp b/src/plugins/cppeditor/cpppreprocessordialog.cpp index 1b9aedcc575..8183b90c25c 100644 --- a/src/plugins/cppeditor/cpppreprocessordialog.cpp +++ b/src/plugins/cppeditor/cpppreprocessordialog.cpp @@ -2,43 +2,59 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "cpppreprocessordialog.h" -#include "ui_cpppreprocessordialog.h" -#include "cppeditorwidget.h" #include "cppeditorconstants.h" #include "cpptoolsreuse.h" #include -using namespace CppEditor::Internal; +#include -CppPreProcessorDialog::CppPreProcessorDialog(const QString &filePath, QWidget *parent) +#include + +#include + +using namespace Utils; + +namespace CppEditor::Internal { + +CppPreProcessorDialog::CppPreProcessorDialog(const FilePath &filePath, QWidget *parent) : QDialog(parent) - , m_ui(new Ui::CppPreProcessorDialog()) , m_filePath(filePath) { - m_ui->setupUi(this); - m_ui->editorLabel->setText(m_ui->editorLabel->text().arg(Utils::FilePath::fromString(m_filePath).fileName())); - m_ui->editWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + resize(400, 300); + setWindowTitle(tr("Additional C++ Preprocessor Directives")); - decorateCppEditor(m_ui->editWidget); - - const QString key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + m_filePath; + const QString key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + m_filePath.toString(); const QString directives = ProjectExplorer::SessionManager::value(key).toString(); - m_ui->editWidget->setPlainText(directives); + + m_editWidget = new TextEditor::SnippetEditorWidget; + m_editWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + m_editWidget->setPlainText(directives); + decorateCppEditor(m_editWidget); + + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); + + using namespace Layouting; + + Column { + tr("Additional C++ Preprocessor Directives for %1:").arg(m_filePath.fileName()), + m_editWidget, + buttonBox, + }.attachTo(this); + + connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); } -CppPreProcessorDialog::~CppPreProcessorDialog() -{ - delete m_ui; -} +CppPreProcessorDialog::~CppPreProcessorDialog() = default; int CppPreProcessorDialog::exec() { if (QDialog::exec() == Rejected) return Rejected; - const QString key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + m_filePath; + const QString key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + m_filePath.toString(); ProjectExplorer::SessionManager::setValue(key, extraPreprocessorDirectives()); return Accepted; @@ -46,5 +62,7 @@ int CppPreProcessorDialog::exec() QString CppPreProcessorDialog::extraPreprocessorDirectives() const { - return m_ui->editWidget->toPlainText(); + return m_editWidget->toPlainText(); } + +} // CppEditor::Internal diff --git a/src/plugins/cppeditor/cpppreprocessordialog.h b/src/plugins/cppeditor/cpppreprocessordialog.h index d57b4d56275..1207c8f7d3f 100644 --- a/src/plugins/cppeditor/cpppreprocessordialog.h +++ b/src/plugins/cppeditor/cpppreprocessordialog.h @@ -3,19 +3,21 @@ #pragma once +#include + #include #include -namespace CppEditor { -namespace Internal { -namespace Ui { class CppPreProcessorDialog; } +namespace TextEditor { class SnippetEditorWidget; } + +namespace CppEditor::Internal { class CppPreProcessorDialog : public QDialog { Q_OBJECT public: - explicit CppPreProcessorDialog(const QString &filePath, QWidget *parent); + CppPreProcessorDialog(const Utils::FilePath &filePath, QWidget *parent); ~CppPreProcessorDialog() override; int exec() override; @@ -23,10 +25,10 @@ public: QString extraPreprocessorDirectives() const; private: - Ui::CppPreProcessorDialog *m_ui; - const QString m_filePath; + const Utils::FilePath m_filePath; const QString m_projectPartId; + + TextEditor::SnippetEditorWidget *m_editWidget; }; -} // namespace Internal -} // namespace CppEditor +} // CppEditor::Internal diff --git a/src/plugins/cppeditor/cpppreprocessordialog.ui b/src/plugins/cppeditor/cpppreprocessordialog.ui deleted file mode 100644 index 4dbcd968b8c..00000000000 --- a/src/plugins/cppeditor/cpppreprocessordialog.ui +++ /dev/null @@ -1,81 +0,0 @@ - - - CppEditor::Internal::CppPreProcessorDialog - - - - 0 - 0 - 400 - 300 - - - - Additional C++ Preprocessor Directives - - - - - - Additional C++ Preprocessor Directives for %1: - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - TextEditor::SnippetEditorWidget - QPlainTextEdit -
texteditor/snippets/snippeteditor.h
-
-
- - - - buttonBox - accepted() - CppEditor::Internal::CppPreProcessorDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - CppEditor::Internal::CppPreProcessorDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index e1f42967e5a..cdfc4d7878f 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -5037,7 +5037,7 @@ QPair assembleDeclarationData(const QString &specifiers, Decla completeDecl.append(QLatin1Char(' ') + decltrText); else completeDecl.append(decltrText); - return qMakePair(name, completeDecl); + return {name, completeDecl}; } } return QPair(); @@ -5329,7 +5329,7 @@ void ExtractFunction::match(const CppQuickFixInterface &interface, QuickFixOpera if ((usedBeforeExtraction && usedInsideExtraction) || (usedInsideExtraction && refFuncParams.contains(name))) { QTC_ASSERT(analyser.m_knownDecls.contains(name), return); - relevantDecls.append(qMakePair(name, analyser.m_knownDecls.value(name))); + relevantDecls.push_back({name, analyser.m_knownDecls.value(name)}); } // We assume that the first use of a local corresponds to its declaration. @@ -5337,7 +5337,7 @@ void ExtractFunction::match(const CppQuickFixInterface &interface, QuickFixOpera if (!funcReturn) { QTC_ASSERT(analyser.m_knownDecls.contains(name), return); // The return, if any, is stored as the first item in the list. - relevantDecls.prepend(qMakePair(name, analyser.m_knownDecls.value(name))); + relevantDecls.push_front({name, analyser.m_knownDecls.value(name)}); funcReturn = it.key(); } else { // Would require multiple returns. (Unless we do fancy things, as pointed below.) diff --git a/src/plugins/cppeditor/cppworkingcopy.h b/src/plugins/cppeditor/cppworkingcopy.h index 12a6626826e..f94b8c4855b 100644 --- a/src/plugins/cppeditor/cppworkingcopy.h +++ b/src/plugins/cppeditor/cppworkingcopy.h @@ -22,7 +22,7 @@ public: { insert(Utils::FilePath::fromString(fileName), source, revision); } void insert(const Utils::FilePath &fileName, const QByteArray &source, unsigned revision = 0) - { _elements.insert(fileName, qMakePair(source, revision)); } + { _elements.insert(fileName, {source, revision}); } bool contains(const QString &fileName) const { return contains(Utils::FilePath::fromString(fileName)); } diff --git a/src/plugins/cppeditor/symbolfinder.cpp b/src/plugins/cppeditor/symbolfinder.cpp index 598d7f89c50..a2df28b5f77 100644 --- a/src/plugins/cppeditor/symbolfinder.cpp +++ b/src/plugins/cppeditor/symbolfinder.cpp @@ -256,13 +256,13 @@ Symbol *SymbolFinder::findMatchingVarDefinition(Symbol *declaration, const Snaps for (const LookupItem &item : items) { if (item.declaration() == symbol) addFallback = false; - candidates << qMakePair(item.declaration(), - context.lookupType(item.declaration()) == enclosingType); + candidates.push_back({item.declaration(), + context.lookupType(item.declaration()) == enclosingType}); } // TODO: This is a workaround for static member definitions not being found by // the lookup() function. if (addFallback) - fallbacks << qMakePair(symbol, context.lookupType(symbol) == enclosingType); + fallbacks.push_back({symbol, context.lookupType(symbol) == enclosingType}); } } diff --git a/src/plugins/cvs/CMakeLists.txt b/src/plugins/cvs/CMakeLists.txt index 47c91f8a720..1cc14dfc166 100644 --- a/src/plugins/cvs/CMakeLists.txt +++ b/src/plugins/cvs/CMakeLists.txt @@ -2,7 +2,6 @@ add_qtc_plugin(CVS PLUGIN_CLASS CvsPlugin PLUGIN_DEPENDS Core TextEditor VcsBase SOURCES - annotationhighlighter.cpp annotationhighlighter.h cvseditor.cpp cvseditor.h cvsplugin.cpp cvsplugin.h cvssettings.cpp cvssettings.h diff --git a/src/plugins/cvs/annotationhighlighter.cpp b/src/plugins/cvs/annotationhighlighter.cpp deleted file mode 100644 index 9efca576838..00000000000 --- a/src/plugins/cvs/annotationhighlighter.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 - -#include "annotationhighlighter.h" - -using namespace Cvs; -using namespace Cvs::Internal; - -CvsAnnotationHighlighter::CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers, - QTextDocument *document) : - VcsBase::BaseAnnotationHighlighter(changeNumbers, document) -{ } - -QString CvsAnnotationHighlighter::changeNumber(const QString &block) const -{ - const int pos = block.indexOf(QLatin1Char(' ')); - return pos > 1 ? block.left(pos) : QString(); -} diff --git a/src/plugins/cvs/annotationhighlighter.h b/src/plugins/cvs/annotationhighlighter.h deleted file mode 100644 index 2e7e85f1a79..00000000000 --- a/src/plugins/cvs/annotationhighlighter.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 - -#pragma once - -#include - -namespace Cvs { -namespace Internal { - -// Annotation highlighter for cvs triggering on 'changenumber ' -class CvsAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter -{ - Q_OBJECT - -public: - explicit CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers, - QTextDocument *document = nullptr); - -private: - QString changeNumber(const QString &block) const override; -}; - -} // namespace Internal -} // namespace Cvs diff --git a/src/plugins/cvs/cvs.qbs b/src/plugins/cvs/cvs.qbs index cbc1dbaa0f2..53fae819f28 100644 --- a/src/plugins/cvs/cvs.qbs +++ b/src/plugins/cvs/cvs.qbs @@ -11,8 +11,6 @@ QtcPlugin { Depends { name: "VcsBase" } files: [ - "annotationhighlighter.cpp", - "annotationhighlighter.h", "cvseditor.cpp", "cvseditor.h", "cvsplugin.cpp", diff --git a/src/plugins/cvs/cvseditor.cpp b/src/plugins/cvs/cvseditor.cpp index e8f77d6ab6e..147c3345e54 100644 --- a/src/plugins/cvs/cvseditor.cpp +++ b/src/plugins/cvs/cvseditor.cpp @@ -2,24 +2,42 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "cvseditor.h" + +#include "cvstr.h" #include "cvsutils.h" -#include "annotationhighlighter.h" - #include + +#include #include #include #include #include -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { // Match a CVS revision ("1.1.1.1") #define CVS_REVISION_PATTERN "[\\d\\.]+" #define CVS_REVISION_AT_START_PATTERN "^(" CVS_REVISION_PATTERN ") " +// Annotation highlighter for cvs triggering on 'changenumber ' +class CvsAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter +{ +public: + explicit CvsAnnotationHighlighter(const ChangeNumbers &changeNumbers, + QTextDocument *document = nullptr) : + VcsBase::BaseAnnotationHighlighter(changeNumbers, document) + { } + +private: + QString changeNumber(const QString &block) const override + { + const int pos = block.indexOf(QLatin1Char(' ')); + return pos > 1 ? block.left(pos) : QString(); + } +}; + CvsEditorWidget::CvsEditorWidget() : m_revisionAnnotationPattern(CVS_REVISION_AT_START_PATTERN), m_revisionLogPattern("^revision *(" CVS_REVISION_PATTERN ")$") @@ -36,7 +54,7 @@ CvsEditorWidget::CvsEditorWidget() : */ setDiffFilePattern("^[-+]{3} ([^\\t]+)"); setLogEntryPattern("^revision (.+)$"); - setAnnotateRevisionTextFormat(tr("Annotate revision \"%1\"")); + setAnnotateRevisionTextFormat(Tr::tr("Annotate revision \"%1\"")); setAnnotationEntryPattern("^(" CVS_REVISION_PATTERN ") "); } @@ -87,5 +105,4 @@ QStringList CvsEditorWidget::annotationPreviousVersions(const QString &revision) return QStringList(previousRevision(revision)); } -} -} +} // Cvs::Internal diff --git a/src/plugins/cvs/cvseditor.h b/src/plugins/cvs/cvseditor.h index f68fcd68a9d..44c7f209444 100644 --- a/src/plugins/cvs/cvseditor.h +++ b/src/plugins/cvs/cvseditor.h @@ -7,8 +7,7 @@ #include -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { class CvsEditorWidget : public VcsBase::VcsBaseEditorWidget { @@ -28,5 +27,4 @@ private: QString m_diffBaseDir; }; -} // namespace Internal -} // namespace Cvs +} // Cvs::Internal diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 3f25126b0d7..6318f5eb5a6 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -2,10 +2,12 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "cvsplugin.h" + #include "cvseditor.h" -#include "cvssubmiteditor.h" -#include "cvsutils.h" #include "cvssettings.h" +#include "cvssubmiteditor.h" +#include "cvstr.h" +#include "cvsutils.h" #include #include @@ -58,8 +60,7 @@ using namespace VcsBase; using namespace Utils; using namespace std::placeholders; -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { const char CVS_CONTEXT[] = "CVS Context"; const char CMD_ID_CVS_MENU[] = "CVS.Menu"; @@ -151,9 +152,9 @@ public: VcsBaseEditorConfig(toolBar), m_settings(settings) { - mapSetting(addToggleButton("-w", CvsPlugin::tr("Ignore Whitespace")), + mapSetting(addToggleButton("-w", Tr::tr("Ignore Whitespace")), &settings.diffIgnoreWhiteSpace); - mapSetting(addToggleButton("-B", CvsPlugin::tr("Ignore Blank Lines")), + mapSetting(addToggleButton("-B", Tr::tr("Ignore Blank Lines")), &settings.diffIgnoreBlankLines); } @@ -202,8 +203,6 @@ public: class CvsPluginPrivate final : public VcsBasePluginPrivate { - Q_DECLARE_TR_FUNCTIONS(Cvs::Internal::CvsPlugin) - public: CvsPluginPrivate(); ~CvsPluginPrivate() final; @@ -447,7 +446,7 @@ void CvsPluginPrivate::vcsAnnotate(const FilePath &filePath, int line) QString CvsPluginPrivate::vcsOpenText() const { - return tr("&Edit"); + return Tr::tr("&Edit"); } VcsCommand *CvsPluginPrivate::createInitialCheckoutCommand(const QString &url, @@ -461,7 +460,7 @@ VcsCommand *CvsPluginPrivate::createInitialCheckoutCommand(const QString &url, args << QLatin1String("checkout") << url << extraArgs; auto command = VcsBaseClient::createVcsCommand(baseDirectory, Environment::systemEnvironment()); - command->setDisplayName(tr("CVS Checkout")); + command->setDisplayName(Tr::tr("CVS Checkout")); command->addJob({m_settings.binaryPath.filePath(), m_settings.addOptions(args)}, -1); return command; } @@ -519,28 +518,28 @@ CvsPluginPrivate::CvsPluginPrivate() const QString prefix = QLatin1String("cvs"); m_commandLocator = new CommandLocator("CVS", prefix, prefix, this); - m_commandLocator->setDescription(tr("Triggers a CVS version control operation.")); + m_commandLocator->setDescription(Tr::tr("Triggers a CVS version control operation.")); // Register actions ActionContainer *toolsContainer = ActionManager::actionContainer(M_TOOLS); ActionContainer *cvsMenu = ActionManager::createMenu(Id(CMD_ID_CVS_MENU)); - cvsMenu->menu()->setTitle(tr("&CVS")); + cvsMenu->menu()->setTitle(Tr::tr("&CVS")); toolsContainer->addMenu(cvsMenu); m_menuAction = cvsMenu->menu()->menuAction(); Command *command; - m_diffCurrentAction = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this); + m_diffCurrentAction = new ParameterAction(Tr::tr("Diff Current File"), Tr::tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_diffCurrentAction, CMD_ID_DIFF_CURRENT, context); command->setAttribute(Command::CA_UpdateText); - command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+D") : tr("Alt+C,Alt+D"))); + command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+C,Meta+D") : Tr::tr("Alt+C,Alt+D"))); connect(m_diffCurrentAction, &QAction::triggered, this, &CvsPluginPrivate::diffCurrentFile); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_filelogCurrentAction = new ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), ParameterAction::EnabledWithParameter, this); + m_filelogCurrentAction = new ParameterAction(Tr::tr("Filelog Current File"), Tr::tr("Filelog \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, context); command->setAttribute(Command::CA_UpdateText); @@ -548,7 +547,7 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_annotateCurrentAction = new ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this); + m_annotateCurrentAction = new ParameterAction(Tr::tr("Annotate Current File"), Tr::tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_annotateCurrentAction, CMD_ID_ANNOTATE_CURRENT, context); command->setAttribute(Command::CA_UpdateText); @@ -558,25 +557,25 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addSeparator(context); - m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this); + m_addAction = new ParameterAction(Tr::tr("Add"), Tr::tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_addAction, CMD_ID_ADD, context); command->setAttribute(Command::CA_UpdateText); - command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+A") : tr("Alt+C,Alt+A"))); + command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+C,Meta+A") : Tr::tr("Alt+C,Alt+A"))); connect(m_addAction, &QAction::triggered, this, &CvsPluginPrivate::addCurrentFile); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_commitCurrentAction = new ParameterAction(tr("Commit Current File"), tr("Commit \"%1\""), ParameterAction::EnabledWithParameter, this); + m_commitCurrentAction = new ParameterAction(Tr::tr("Commit Current File"), Tr::tr("Commit \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_commitCurrentAction, CMD_ID_COMMIT_CURRENT, context); command->setAttribute(Command::CA_UpdateText); - command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+C,Meta+C") : tr("Alt+C,Alt+C"))); + command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+C,Meta+C") : Tr::tr("Alt+C,Alt+C"))); connect(m_commitCurrentAction, &QAction::triggered, this, &CvsPluginPrivate::startCommitCurrentFile); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_deleteAction = new ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this); + m_deleteAction = new ParameterAction(Tr::tr("Delete..."), Tr::tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_deleteAction, CMD_ID_DELETE_FILE, context); command->setAttribute(Command::CA_UpdateText); @@ -584,7 +583,7 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_revertAction = new ParameterAction(tr("Revert..."), tr("Revert \"%1\"..."), ParameterAction::EnabledWithParameter, this); + m_revertAction = new ParameterAction(Tr::tr("Revert..."), Tr::tr("Revert \"%1\"..."), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_revertAction, CMD_ID_REVERT, context); command->setAttribute(Command::CA_UpdateText); @@ -594,21 +593,21 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addSeparator(context); - m_editCurrentAction = new ParameterAction(tr("Edit"), tr("Edit \"%1\""), ParameterAction::EnabledWithParameter, this); + m_editCurrentAction = new ParameterAction(Tr::tr("Edit"), Tr::tr("Edit \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_editCurrentAction, CMD_ID_EDIT_FILE, context); command->setAttribute(Command::CA_UpdateText); connect(m_editCurrentAction, &QAction::triggered, this, &CvsPluginPrivate::editCurrentFile); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_uneditCurrentAction = new ParameterAction(tr("Unedit"), tr("Unedit \"%1\""), ParameterAction::EnabledWithParameter, this); + m_uneditCurrentAction = new ParameterAction(Tr::tr("Unedit"), Tr::tr("Unedit \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_uneditCurrentAction, CMD_ID_UNEDIT_FILE, context); command->setAttribute(Command::CA_UpdateText); connect(m_uneditCurrentAction, &QAction::triggered, this, &CvsPluginPrivate::uneditCurrentFile); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_uneditRepositoryAction = new QAction(tr("Unedit Repository"), this); + m_uneditRepositoryAction = new QAction(Tr::tr("Unedit Repository"), this); command = ActionManager::registerAction(m_uneditRepositoryAction, CMD_ID_UNEDIT_REPOSITORY, context); connect(m_uneditRepositoryAction, &QAction::triggered, this, &CvsPluginPrivate::uneditCurrentRepository); cvsMenu->addAction(command); @@ -616,7 +615,7 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addSeparator(context); - m_diffProjectAction = new ParameterAction(tr("Diff Project"), tr("Diff Project \"%1\""), ParameterAction::EnabledWithParameter, this); + m_diffProjectAction = new ParameterAction(Tr::tr("Diff Project"), Tr::tr("Diff Project \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, context); command->setAttribute(Command::CA_UpdateText); @@ -624,7 +623,7 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_statusProjectAction = new ParameterAction(tr("Project Status"), tr("Status of Project \"%1\""), ParameterAction::EnabledWithParameter, this); + m_statusProjectAction = new ParameterAction(Tr::tr("Project Status"), Tr::tr("Status of Project \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_statusProjectAction, CMD_ID_STATUS, context); command->setAttribute(Command::CA_UpdateText); @@ -632,21 +631,21 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_logProjectAction = new ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this); + m_logProjectAction = new ParameterAction(Tr::tr("Log Project"), Tr::tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context); command->setAttribute(Command::CA_UpdateText); connect(m_logProjectAction, &QAction::triggered, this, &CvsPluginPrivate::logProject); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_updateProjectAction = new ParameterAction(tr("Update Project"), tr("Update Project \"%1\""), ParameterAction::EnabledWithParameter, this); + m_updateProjectAction = new ParameterAction(Tr::tr("Update Project"), Tr::tr("Update Project \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_updateProjectAction, CMD_ID_UPDATE, context); command->setAttribute(Command::CA_UpdateText); connect(m_updateProjectAction, &QAction::triggered, this, &CvsPluginPrivate::updateProject); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_commitProjectAction = new ParameterAction(tr("Commit Project"), tr("Commit Project \"%1\""), ParameterAction::EnabledWithParameter, this); + m_commitProjectAction = new ParameterAction(Tr::tr("Commit Project"), Tr::tr("Commit Project \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_commitProjectAction, CMD_ID_PROJECTCOMMIT, context); command->setAttribute(Command::CA_UpdateText); connect(m_commitProjectAction, &QAction::triggered, this, &CvsPluginPrivate::commitProject); @@ -655,14 +654,14 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addSeparator(context); - m_updateDirectoryAction = new ParameterAction(tr("Update Directory"), tr("Update Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); + m_updateDirectoryAction = new ParameterAction(Tr::tr("Update Directory"), Tr::tr("Update Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_updateDirectoryAction, CMD_ID_UPDATE_DIRECTORY, context); command->setAttribute(Command::CA_UpdateText); connect(m_updateDirectoryAction, &QAction::triggered, this, &CvsPluginPrivate::updateDirectory); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_commitDirectoryAction = new ParameterAction(tr("Commit Directory"), tr("Commit Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); + m_commitDirectoryAction = new ParameterAction(Tr::tr("Commit Directory"), Tr::tr("Commit Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_commitDirectoryAction, CMD_ID_COMMIT_DIRECTORY, context); command->setAttribute(Command::CA_UpdateText); @@ -672,38 +671,38 @@ CvsPluginPrivate::CvsPluginPrivate() cvsMenu->addSeparator(context); - m_diffRepositoryAction = new QAction(tr("Diff Repository"), this); + m_diffRepositoryAction = new QAction(Tr::tr("Diff Repository"), this); command = ActionManager::registerAction(m_diffRepositoryAction, CMD_ID_REPOSITORYDIFF, context); connect(m_diffRepositoryAction, &QAction::triggered, this, &CvsPluginPrivate::diffRepository); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_statusRepositoryAction = new QAction(tr("Repository Status"), this); + m_statusRepositoryAction = new QAction(Tr::tr("Repository Status"), this); command = ActionManager::registerAction(m_statusRepositoryAction, CMD_ID_REPOSITORYSTATUS, context); connect(m_statusRepositoryAction, &QAction::triggered, this, &CvsPluginPrivate::statusRepository); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_logRepositoryAction = new QAction(tr("Repository Log"), this); + m_logRepositoryAction = new QAction(Tr::tr("Repository Log"), this); command = ActionManager::registerAction(m_logRepositoryAction, CMD_ID_REPOSITORYLOG, context); connect(m_logRepositoryAction, &QAction::triggered, this, &CvsPluginPrivate::logRepository); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_updateRepositoryAction = new QAction(tr("Update Repository"), this); + m_updateRepositoryAction = new QAction(Tr::tr("Update Repository"), this); command = ActionManager::registerAction(m_updateRepositoryAction, CMD_ID_REPOSITORYUPDATE, context); connect(m_updateRepositoryAction, &QAction::triggered, this, &CvsPluginPrivate::updateRepository); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_commitAllAction = new QAction(tr("Commit All Files"), this); + m_commitAllAction = new QAction(Tr::tr("Commit All Files"), this); command = ActionManager::registerAction(m_commitAllAction, CMD_ID_COMMIT_ALL, context); connect(m_commitAllAction, &QAction::triggered, this, &CvsPluginPrivate::startCommitAll); cvsMenu->addAction(command); m_commandLocator->appendCommand(command); - m_revertRepositoryAction = new QAction(tr("Revert Repository..."), this); + m_revertRepositoryAction = new QAction(Tr::tr("Revert Repository..."), this); command = ActionManager::registerAction(m_revertRepositoryAction, CMD_ID_REVERT_ALL, context); connect(m_revertRepositoryAction, &QAction::triggered, this, &CvsPluginPrivate::revertAll); @@ -843,8 +842,8 @@ void CvsPluginPrivate::revertAll() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - const QString title = tr("Revert Repository"); - if (!messageBoxQuestion(title, tr("Revert all pending changes to the repository?"))) + const QString title = Tr::tr("Revert Repository"); + if (!messageBoxQuestion(title, Tr::tr("Revert all pending changes to the repository?"))) return; QStringList args; args << QLatin1String("update") << QLatin1String("-C") << state.topLevel().toString(); @@ -854,7 +853,7 @@ void CvsPluginPrivate::revertAll() emit repositoryChanged(state.topLevel()); else Core::AsynchronousMessageBox::warning(title, - tr("Revert failed: %1").arg(revertResponse.message)); + Tr::tr("Revert failed: %1").arg(revertResponse.message)); } void CvsPluginPrivate::revertCurrentFile() @@ -877,7 +876,7 @@ void CvsPluginPrivate::revertCurrentFile() } if (!messageBoxQuestion(QLatin1String("CVS Revert"), - tr("The file has been changed. Do you want to revert it?"))) + Tr::tr("The file has been changed. Do you want to revert it?"))) return; FileChangeBlocker fcb(FilePath::fromString(state.currentFile())); @@ -942,7 +941,7 @@ void CvsPluginPrivate::startCommit(const FilePath &workingDir, const QString &fi if (raiseSubmitEditor()) return; if (isCommitEditorOpen()) { - VcsOutputWindow::appendWarning(tr("Another commit is currently being executed.")); + VcsOutputWindow::appendWarning(Tr::tr("Another commit is currently being executed.")); return; } @@ -965,7 +964,7 @@ void CvsPluginPrivate::startCommit(const FilePath &workingDir, const QString &fi } } if (statusOutput.empty()) { - VcsOutputWindow::appendWarning(tr("There are no modified files.")); + VcsOutputWindow::appendWarning(Tr::tr("There are no modified files.")); return; } m_commitRepository = workingDir; @@ -1143,9 +1142,9 @@ bool CvsPluginPrivate::unedit(const FilePath &topLevel, const QStringList &files return false; if (modified) { const QString question = files.isEmpty() ? - tr("Would you like to discard your changes to the repository \"%1\"?").arg(topLevel.toUserOutput()) : - tr("Would you like to discard your changes to the file \"%1\"?").arg(files.front()); - if (!messageBoxQuestion(tr("Unedit"), question)) + Tr::tr("Would you like to discard your changes to the repository \"%1\"?").arg(topLevel.toUserOutput()) : + Tr::tr("Would you like to discard your changes to the file \"%1\"?").arg(files.front()); + if (!messageBoxQuestion(Tr::tr("Unedit"), question)) return false; } @@ -1211,7 +1210,7 @@ void CvsPluginPrivate::projectStatus() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return); - status(state.currentProjectTopLevel(), state.relativeCurrentProject(), tr("Project status")); + status(state.currentProjectTopLevel(), state.relativeCurrentProject(), Tr::tr("Project status")); } void CvsPluginPrivate::commitProject() @@ -1232,7 +1231,7 @@ void CvsPluginPrivate::statusRepository() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - status(state.topLevel(), QString(), tr("Repository status")); + status(state.topLevel(), QString(), Tr::tr("Repository status")); } void CvsPluginPrivate::updateRepository() @@ -1248,7 +1247,7 @@ bool CvsPluginPrivate::describe(const QString &file, const QString &changeNr, QS FilePath toplevel; const bool manages = managesDirectory(FilePath::fromString(QFileInfo(file).absolutePath()), &toplevel); if (!manages || toplevel.isEmpty()) { - *errorMessage = tr("Cannot find repository for \"%1\".") + *errorMessage = Tr::tr("Cannot find repository for \"%1\".") .arg(QDir::toNativeSeparators(file)); return false; } @@ -1267,7 +1266,7 @@ bool CvsPluginPrivate::describe(const FilePath &toplevel, const QString &file, c // if desired. // Number must be > 1 if (isFirstRevision(changeNr)) { - *errorMessage = tr("The initial revision %1 cannot be described.").arg(changeNr); + *errorMessage = Tr::tr("The initial revision %1 cannot be described.").arg(changeNr); return false; } // Run log to obtain commit id and details @@ -1280,7 +1279,7 @@ bool CvsPluginPrivate::describe(const FilePath &toplevel, const QString &file, c } const QList fileLog = parseLogEntries(logResponse.stdOut); if (fileLog.empty() || fileLog.front().revisions.empty()) { - *errorMessage = tr("Parsing of the log output failed."); + *errorMessage = Tr::tr("Parsing of the log output failed."); return false; } if (m_settings.describeByCommitId.value()) { @@ -1302,7 +1301,7 @@ bool CvsPluginPrivate::describe(const FilePath &toplevel, const QString &file, c // Describe all files found, pass on dir to obtain correct absolute paths. const QList repoEntries = parseLogEntries(repoLogResponse.stdOut, QString(), commitId); if (repoEntries.empty()) { - *errorMessage = tr("Could not find commits of id \"%1\" on %2.").arg(commitId, dateS); + *errorMessage = Tr::tr("Could not find commits of id \"%1\" on %2.").arg(commitId, dateS); return false; } return describe(toplevel, repoEntries, errorMessage); @@ -1399,7 +1398,7 @@ CvsResponse CvsPluginPrivate::runCvs(const FilePath &workingDirectory, CvsResponse response; if (executable.isEmpty()) { response.result = CvsResponse::OtherError; - response.message =tr("No CVS executable specified."); + response.message = Tr::tr("No CVS executable specified."); return response; } @@ -1559,5 +1558,4 @@ void CvsPlugin::testLogResolving() } #endif -} // namespace Internal -} // namespace Cvs +} // namespace Cvs::Internal diff --git a/src/plugins/cvs/cvsplugin.h b/src/plugins/cvs/cvsplugin.h index 8145454ae4a..127393046eb 100644 --- a/src/plugins/cvs/cvsplugin.h +++ b/src/plugins/cvs/cvsplugin.h @@ -5,8 +5,7 @@ #include -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { class CvsPlugin final : public ExtensionSystem::IPlugin { @@ -26,5 +25,4 @@ private slots: #endif }; -} // namespace Cvs -} // namespace Internal +} // namespace Cvs::Internal diff --git a/src/plugins/cvs/cvssettings.cpp b/src/plugins/cvs/cvssettings.cpp index 9983bd0986e..f87204face3 100644 --- a/src/plugins/cvs/cvssettings.cpp +++ b/src/plugins/cvs/cvssettings.cpp @@ -3,6 +3,8 @@ #include "cvssettings.h" +#include "cvstr.h" + #include #include @@ -13,8 +15,7 @@ using namespace Utils; -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { // CvsSettings @@ -27,13 +28,13 @@ CvsSettings::CvsSettings() binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setHistoryCompleter(QLatin1String("Cvs.Command.History")); - binaryPath.setDisplayName(tr("CVS Command")); - binaryPath.setLabelText(tr("CVS command:")); + binaryPath.setDisplayName(Tr::tr("CVS Command")); + binaryPath.setLabelText(Tr::tr("CVS command:")); registerAspect(&cvsRoot); cvsRoot.setDisplayStyle(StringAspect::LineEditDisplay); cvsRoot.setSettingsKey("Root"); - cvsRoot.setLabelText(tr("CVS root:")); + cvsRoot.setLabelText(Tr::tr("CVS root:")); registerAspect(&diffOptions); diffOptions.setDisplayStyle(StringAspect::LineEditDisplay); @@ -44,8 +45,8 @@ CvsSettings::CvsSettings() registerAspect(&describeByCommitId); describeByCommitId.setSettingsKey("DescribeByCommitId"); describeByCommitId.setDefaultValue(true); - describeByCommitId.setLabelText(tr("Describe all files matching commit id")); - describeByCommitId.setToolTip(tr("When checked, all files touched by a commit will be " + describeByCommitId.setLabelText(Tr::tr("Describe all files matching commit id")); + describeByCommitId.setToolTip(Tr::tr("When checked, all files touched by a commit will be " "displayed when clicking on a revision number in the annotation view " "(retrieved via commit ID). Otherwise, only the respective file will be displayed.")); @@ -72,7 +73,7 @@ QStringList CvsSettings::addOptions(const QStringList &args) const CvsSettingsPage::CvsSettingsPage(CvsSettings *settings) { setId(VcsBase::Constants::VCS_ID_CVS); - setDisplayName(CvsSettings::tr("CVS")); + setDisplayName(Tr::tr("CVS")); setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); setSettings(settings); @@ -82,14 +83,14 @@ CvsSettingsPage::CvsSettingsPage(CvsSettings *settings) Column { Group { - title(CvsSettings::tr("Configuration")), + title(Tr::tr("Configuration")), Form { s.binaryPath, s.cvsRoot } }, Group { - title(CvsSettings::tr("Miscellaneous")), + title(Tr::tr("Miscellaneous")), Column { Form { s.timeout, @@ -104,5 +105,4 @@ CvsSettingsPage::CvsSettingsPage(CvsSettings *settings) }); } -} // Internal -} // Cvs +} // Cvs::Internal diff --git a/src/plugins/cvs/cvssettings.h b/src/plugins/cvs/cvssettings.h index b3a061c3239..5d0495a2a67 100644 --- a/src/plugins/cvs/cvssettings.h +++ b/src/plugins/cvs/cvssettings.h @@ -7,13 +7,10 @@ #include -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { class CvsSettings : public VcsBase::VcsBaseSettings { - Q_DECLARE_TR_FUNCTIONS(Cvs::Internal::SettingsPage) - public: Utils::StringAspect cvsRoot; Utils::StringAspect diffOptions; @@ -32,5 +29,4 @@ public: explicit CvsSettingsPage(CvsSettings *settings); }; -} // namespace Internal -} // namespace Cvs +} // Cvs::Internal diff --git a/src/plugins/cvs/cvssubmiteditor.cpp b/src/plugins/cvs/cvssubmiteditor.cpp index e9052b70a22..a80e17ce643 100644 --- a/src/plugins/cvs/cvssubmiteditor.cpp +++ b/src/plugins/cvs/cvssubmiteditor.cpp @@ -3,17 +3,20 @@ #include "cvssubmiteditor.h" +#include "cvstr.h" + #include #include -using namespace Cvs::Internal; using namespace VcsBase; +namespace Cvs::Internal { + CvsSubmitEditor::CvsSubmitEditor() : VcsBase::VcsBaseSubmitEditor(new SubmitEditorWidget), - m_msgAdded(tr("Added")), - m_msgRemoved(tr("Removed")), - m_msgModified(tr("Modified")) + m_msgAdded(Tr::tr("Added")), + m_msgRemoved(Tr::tr("Removed")), + m_msgModified(Tr::tr("Modified")) { } QString CvsSubmitEditor::stateName(State st) const @@ -39,3 +42,5 @@ void CvsSubmitEditor::setStateList(const StateFilePairs &statusOutput) model->addFile(it->second, stateName(it->first)); setFileModel(model); } + +} // Cvs::Internal diff --git a/src/plugins/cvs/cvssubmiteditor.h b/src/plugins/cvs/cvssubmiteditor.h index eb9a93c62f5..bbfa9dce17c 100644 --- a/src/plugins/cvs/cvssubmiteditor.h +++ b/src/plugins/cvs/cvssubmiteditor.h @@ -3,13 +3,12 @@ #pragma once +#include + #include #include -#include - -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { class CvsSubmitEditor : public VcsBase::VcsBaseSubmitEditor { @@ -33,5 +32,4 @@ private: const QString m_msgModified; }; -} // namespace Internal -} // namespace Cvs +} // Cvs::Internal diff --git a/src/plugins/cvs/cvstr.h b/src/plugins/cvs/cvstr.h index b987c5305b4..162f1d479aa 100644 --- a/src/plugins/cvs/cvstr.h +++ b/src/plugins/cvs/cvstr.h @@ -5,11 +5,11 @@ #include -namespace CVS { +namespace Cvs { struct Tr { Q_DECLARE_TR_FUNCTIONS(CVS) }; -} // namespace CVS +} // Cvs diff --git a/src/plugins/cvs/cvsutils.cpp b/src/plugins/cvs/cvsutils.cpp index 8c96f43f040..8ca3a81506e 100644 --- a/src/plugins/cvs/cvsutils.cpp +++ b/src/plugins/cvs/cvsutils.cpp @@ -8,8 +8,7 @@ #include #include -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { CvsRevision::CvsRevision(const QString &rev) : revision(rev) { } @@ -161,7 +160,7 @@ StateList parseStatusOutput(const QString &directory, const QString &output) QString path = directory; if (!path.isEmpty()) path += slash; - foreach (const QString &l, list) { + for (const QString &l : list) { // Status line containing file if (l.startsWith(fileKeyword)) { // Parse state @@ -210,5 +209,4 @@ bool isFirstRevision(const QString &r) return r.endsWith(QLatin1String(".1")); } -} // namespace Internal -} // namespace Cvs +} // Cvs::Internal diff --git a/src/plugins/cvs/cvsutils.h b/src/plugins/cvs/cvsutils.h index b6bf341bf9e..7ab357a019e 100644 --- a/src/plugins/cvs/cvsutils.h +++ b/src/plugins/cvs/cvsutils.h @@ -8,8 +8,7 @@ #include #include -namespace Cvs { -namespace Internal { +namespace Cvs::Internal { // Utilities to parse output of a CVS log. @@ -54,5 +53,4 @@ QString previousRevision(const QString &rev); // Revision number utilities: Is it "[1.2...].1"? bool isFirstRevision(const QString &r); -} // namespace Internal -} // namespace Cvs +} // Cvs::Internal diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 828ca013b1d..326fa93b733 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -2829,8 +2829,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp) if (it.key().startsWith('(')) { const QString expanded = rp.macroExpander->expand(it.value()); if (!expanded.isEmpty()) - globalRegExpSourceMap.push_back( - qMakePair(QRegularExpression(it.key()), expanded)); + globalRegExpSourceMap.push_back({QRegularExpression(it.key()), expanded}); } } if (globalRegExpSourceMap.isEmpty()) diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp index bfcf077efd5..92540f6f078 100644 --- a/src/plugins/diffeditor/diffeditor.cpp +++ b/src/plugins/diffeditor/diffeditor.cpp @@ -416,8 +416,8 @@ void DiffEditor::prepareForReload() if (m_entriesComboBox->count() > 0) { m_currentFileChunk - = qMakePair(m_entriesComboBox->itemData(m_currentDiffFileIndex, Qt::UserRole).toString(), - m_entriesComboBox->itemData(m_currentDiffFileIndex, Qt::UserRole + 1).toString()); + = {m_entriesComboBox->itemData(m_currentDiffFileIndex, Qt::UserRole).toString(), + m_entriesComboBox->itemData(m_currentDiffFileIndex, Qt::UserRole + 1).toString()}; } else { m_currentFileChunk = {}; } diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp index 4403f2285c3..952eea642f9 100644 --- a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp +++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp @@ -259,7 +259,7 @@ QString SideDiffEditorWidget::plainTextFromSelection(const QTextCursor &cursor) block = block.next(); } - return convertToPlainText(text); + return TextDocument::convertToPlainText(text); } SideBySideDiffOutput SideDiffData::diffOutput(QFutureInterface &fi, int progressMin, diff --git a/src/plugins/diffeditor/unifieddiffeditorwidget.cpp b/src/plugins/diffeditor/unifieddiffeditorwidget.cpp index cd2c6e7986c..1c9a83a93bc 100644 --- a/src/plugins/diffeditor/unifieddiffeditorwidget.cpp +++ b/src/plugins/diffeditor/unifieddiffeditorwidget.cpp @@ -193,8 +193,8 @@ void UnifiedDiffEditorWidget::contextMenuEvent(QContextMenuEvent *e) if (currentChunkIndex > chunkIndex) break; - const int leftRow = m_data.m_lineNumbers[LeftSide].value(i, qMakePair(-1, -1)).second; - const int rightRow = m_data.m_lineNumbers[RightSide].value(i, qMakePair(-1, -1)).second; + const int leftRow = m_data.m_lineNumbers[LeftSide].value(i, {-1, -1}).second; + const int rightRow = m_data.m_lineNumbers[RightSide].value(i, {-1, -1}).second; if (leftRow >= 0) leftSelection.append(leftRow); @@ -288,7 +288,7 @@ void UnifiedDiffData::setLineNumber(DiffSide side, int blockNumber, int lineNumb { QTC_ASSERT(side < SideCount, return); const QString lineNumberString = QString::number(lineNumber); - m_lineNumbers[side].insert(blockNumber, qMakePair(lineNumber, rowNumberInChunk)); + m_lineNumbers[side].insert(blockNumber, {lineNumber, rowNumberInChunk}); m_lineNumberDigits[side] = qMax(m_lineNumberDigits[side], lineNumberString.count()); } @@ -579,35 +579,33 @@ void UnifiedDiffEditorWidget::jumpToOriginalFile(const QTextCursor &cursor) const int columnNumber = cursor.positionInBlock() - 1; // -1 for the first character in line - const int rightLineNumber = m_data.m_lineNumbers[RightSide].value(blockNumber, qMakePair(-1, 0)).first; + const int rightLineNumber = m_data.m_lineNumbers[RightSide].value(blockNumber, {-1, 0}).first; if (rightLineNumber >= 0) { m_controller.jumpToOriginalFile(rightFileName, rightLineNumber, columnNumber); return; } - const int leftLineNumber = m_data.m_lineNumbers[LeftSide].value(blockNumber, qMakePair(-1, 0)).first; - if (leftLineNumber >= 0) { - if (leftFileName == rightFileName) { - for (const ChunkData &chunkData : fileData.chunks) { - - int newLeftLineNumber = chunkData.startingLineNumber[LeftSide]; - int newRightLineNumber = chunkData.startingLineNumber[RightSide]; - - for (const RowData &rowData : chunkData.rows) { - if (rowData.line[LeftSide].textLineType == TextLineData::TextLine) - newLeftLineNumber++; - if (rowData.line[RightSide].textLineType == TextLineData::TextLine) - newRightLineNumber++; - if (newLeftLineNumber == leftLineNumber) { - m_controller.jumpToOriginalFile(leftFileName, newRightLineNumber, 0); - return; - } - } - } - } else { - m_controller.jumpToOriginalFile(leftFileName, leftLineNumber, columnNumber); - } + const int leftLineNumber = m_data.m_lineNumbers[LeftSide].value(blockNumber, {-1, 0}).first; + if (leftLineNumber < 0) return; + if (leftFileName != rightFileName) { + m_controller.jumpToOriginalFile(leftFileName, leftLineNumber, columnNumber); + return; + } + + for (const ChunkData &chunkData : fileData.chunks) { + int newLeftLineNumber = chunkData.startingLineNumber[LeftSide]; + int newRightLineNumber = chunkData.startingLineNumber[RightSide]; + for (const RowData &rowData : chunkData.rows) { + if (rowData.line[LeftSide].textLineType == TextLineData::TextLine) + newLeftLineNumber++; + if (rowData.line[RightSide].textLineType == TextLineData::TextLine) + newRightLineNumber++; + if (newLeftLineNumber == leftLineNumber) { + m_controller.jumpToOriginalFile(leftFileName, newRightLineNumber, 0); + return; + } + } } } diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index a28147c688c..64d1b1edf6e 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -128,6 +128,8 @@ public: bool runInShell(const CommandLine &cmd, const QByteArray &stdInData = {}); QByteArray outputForRunInShell(const CommandLine &cmd); + std::optional fileContents(const FilePath &filePath, qint64 limit, qint64 offset); + void updateContainerAccess(); void changeMounts(QStringList newMounts); bool ensureReachable(const FilePath &other); @@ -665,6 +667,11 @@ DeviceEnvironmentFetcher::Ptr DockerDevice::environmentFetcher() const return DeviceEnvironmentFetcher::Ptr(); } +bool DockerDevice::usableAsBuildDevice() const +{ + return true; +} + FilePath DockerDevice::mapToGlobalPath(const FilePath &pathOnDevice) const { if (pathOnDevice.needsDevice()) { @@ -1010,25 +1017,7 @@ std::optional DockerDevice::fileContents(const FilePath &filePath, qint64 offset) const { QTC_ASSERT(handlesFile(filePath), return {}); - updateContainerAccess(); - - QStringList args = {"if=" + filePath.path(), "status=none"}; - if (limit > 0 || offset > 0) { - const qint64 gcd = std::gcd(limit, offset); - args += {QString("bs=%1").arg(gcd), - QString("count=%1").arg(limit / gcd), - QString("seek=%1").arg(offset / gcd)}; - } - - QtcProcess proc; - proc.setCommand(d->withDockerExecCmd({"dd", args})); - proc.start(); - proc.waitForFinished(); - - if (proc.result() != ProcessResult::FinishedWithSuccess) - return {}; - QByteArray output = proc.readAllStandardOutput(); - return output; + return d->fileContents(filePath, limit, offset); } bool DockerDevice::writeFileContents(const FilePath &filePath, const QByteArray &data) const @@ -1048,6 +1037,28 @@ void DockerDevice::aboutToBeRemoved() const detector.undoAutoDetect(id().toString()); } +std::optional DockerDevicePrivate::fileContents(const FilePath &filePath, + qint64 limit, + qint64 offset) +{ + updateContainerAccess(); + + QStringList args = {"if=" + filePath.path(), "status=none"}; + if (limit > 0 || offset > 0) { + const qint64 gcd = std::gcd(limit, offset); + args += {QString("bs=%1").arg(gcd), + QString("count=%1").arg(limit / gcd), + QString("seek=%1").arg(offset / gcd)}; + } + + const ContainerShell::RunResult r = m_shell->outputForRunInShell({"dd", args}); + + if (r.exitCode != 0) + return {}; + + return r.stdOut; +} + void DockerDevicePrivate::fetchSystemEnviroment() { updateContainerAccess(); diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 32997070693..7de2a762829 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -76,6 +76,7 @@ public: ProjectExplorer::DeviceTester *createDeviceTester() const override; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; ProjectExplorer::DeviceEnvironmentFetcher::Ptr environmentFetcher() const override; + bool usableAsBuildDevice() const override; Utils::FilePath mapToGlobalPath(const Utils::FilePath &pathOnDevice) const override; QString mapToDevicePath(const Utils::FilePath &globalPath) const override; diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 9e33547445e..7916ee020d2 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -594,10 +594,10 @@ void GenericBuildSystem::updateDeploymentData() if (bc) deploymentFilePath = bc->buildDirectory().pathAppended(fileName); - bool hasDeploymentData = QFileInfo::exists(deploymentFilePath.toString()); + bool hasDeploymentData = deploymentFilePath.exists(); if (!hasDeploymentData) { deploymentFilePath = projectDirectory().pathAppended(fileName); - hasDeploymentData = QFileInfo::exists(deploymentFilePath.toString()); + hasDeploymentData = deploymentFilePath.exists(); } if (hasDeploymentData) { DeploymentData deploymentData; diff --git a/src/plugins/git/commitdata.cpp b/src/plugins/git/commitdata.cpp index 679c2c5c470..9c6b948ac15 100644 --- a/src/plugins/git/commitdata.cpp +++ b/src/plugins/git/commitdata.cpp @@ -95,7 +95,7 @@ bool CommitData::checkLine(const QString &stateInfo, const QString &file) QTC_ASSERT(stateInfo.count() == 2, return false); if (stateInfo == "??") { - files.append(qMakePair(FileStates(UntrackedFile), file)); + files.push_back({FileStates(UntrackedFile), file}); return true; } @@ -110,22 +110,22 @@ bool CommitData::checkLine(const QString &stateInfo, const QString &file) if (xState == yState) { if (xState == UnmergedFile) xState = ModifiedFile; - files.append(qMakePair(xState | UnmergedFile | UnmergedUs | UnmergedThem, file)); + files.push_back({xState | UnmergedFile | UnmergedUs | UnmergedThem, file}); } else if (xState == UnmergedFile) { - files.append(qMakePair(yState | UnmergedFile | UnmergedThem, file)); + files.push_back({yState | UnmergedFile | UnmergedThem, file}); } else { - files.append(qMakePair(xState | UnmergedFile | UnmergedUs, file)); + files.push_back({xState | UnmergedFile | UnmergedUs, file}); } } else { if (xState != EmptyFileState) - files.append(qMakePair(xState | StagedFile, file)); + files.push_back({xState | StagedFile, file}); if (yState != EmptyFileState) { QString newFile = file; if (xState & (RenamedFile | CopiedFile)) newFile = file.mid(file.indexOf(" -> ") + 4); - files.append(qMakePair(yState, newFile)); + files.push_back({yState, newFile}); } } Utils::sort(files); diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index 3e6365191f3..00fd6836ffb 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -305,7 +305,7 @@ void GerritPushDialog::setRemoteBranches(bool includeOld) const QStringList remoteBranches = GitClient::instance()->synchronousRepositoryBranches(remoteName, m_workingDir); for (const QString &branch : remoteBranches) - m_remoteBranches.insertMulti(remoteName, qMakePair(branch, QDate())); + m_remoteBranches.insertMulti(remoteName, {branch, {}}); if (remoteBranches.isEmpty()) { m_ui->targetBranchComboBox->setEditable(true); m_ui->targetBranchComboBox->setToolTip( diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index d018c2b60bc..d5c3775c93f 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -3847,10 +3847,10 @@ FilePath GitClient::fileWorkingDirectory(const QString &file) IEditor *GitClient::openShowEditor(const FilePath &workingDirectory, const QString &ref, const QString &path, ShowEditor showSetting) { - QString topLevel; - VcsManager::findVersionControlForDirectory(workingDirectory, &topLevel); - const QString relativePath = QDir(topLevel).relativeFilePath(path); - const QByteArray content = synchronousShow(FilePath::fromString(topLevel), ref + ":" + relativePath); + const FilePath topLevel = VcsManager::findTopLevelForDirectory(workingDirectory); + const QString topLevelString = topLevel.toString(); + const QString relativePath = QDir(topLevelString).relativeFilePath(path); + const QByteArray content = synchronousShow(topLevel, ref + ":" + relativePath); if (showSetting == ShowEditor::OnlyIfDifferent) { if (content.isEmpty()) return nullptr; @@ -3866,7 +3866,7 @@ IEditor *GitClient::openShowEditor(const FilePath &workingDirectory, const QStri } const QString documentId = QLatin1String(Git::Constants::GIT_PLUGIN) - + QLatin1String(".GitShow.") + topLevel + + QLatin1String(".GitShow.") + topLevelString + QLatin1String(".") + relativePath; QString title = tr("Git Show %1:%2").arg(ref).arg(relativePath); IEditor *editor = EditorManager::openEditorWithContents(Id(), &title, content, documentId, diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index f5101d5699e..abcea246bf6 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -198,7 +198,7 @@ static bool isGitDirectory(const FilePath &path) { static IVersionControl *gitVc = VcsManager::versionControl(VcsBase::Constants::VCS_ID_GIT); QTC_ASSERT(gitVc, return false); - return gitVc == VcsManager::findVersionControlForDirectory(path, nullptr); + return gitVc == VcsManager::findVersionControlForDirectory(path); } GitGrep::GitGrep(GitClient *client) diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index abcb8d11f12..328db5009b8 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -350,7 +350,7 @@ public: IEditor *openSubmitEditor(const QString &fileName, const CommitData &cd); void cleanCommitMessageFile(); void cleanRepository(const FilePath &directory); - void applyPatch(const FilePath &workingDirectory, QString file = QString()); + void applyPatch(const FilePath &workingDirectory, QString file = {}); void updateVersionWarning(); @@ -1055,9 +1055,8 @@ void GitPluginPrivate::blameFile() } } } - VcsBaseEditorWidget *editor = m_gitClient.annotate( - state.currentFileTopLevel(), state.relativeCurrentFile(), QString(), - lineNumber, extraOptions); + VcsBaseEditorWidget *editor = m_gitClient.annotate(state.currentFileTopLevel(), + state.relativeCurrentFile(), {}, lineNumber, extraOptions); if (firstLine > 0) editor->setFirstLineNumber(firstLine); } @@ -1133,7 +1132,7 @@ void GitPluginPrivate::resetRepository() LogChangeDialog dialog(true, ICore::dialogParent()); ResetItemDelegate delegate(dialog.widget()); dialog.setWindowTitle(tr("Undo Changes to %1").arg(topLevel.toUserOutput())); - if (dialog.runDialog(topLevel, QString(), LogChangeWidget::IncludeRemotes)) + if (dialog.runDialog(topLevel, {}, LogChangeWidget::IncludeRemotes)) m_gitClient.reset(topLevel, dialog.resetFlag(), dialog.commit()); } @@ -1152,7 +1151,7 @@ void GitPluginPrivate::startRebase() QTC_ASSERT(state.hasTopLevel(), return); const FilePath topLevel = state.topLevel(); - startRebaseFromCommit(topLevel, QString()); + startRebaseFromCommit(topLevel, {}); } void GitPluginPrivate::startRebaseFromCommit(const FilePath &workingDirectory, QString commit) @@ -1453,7 +1452,7 @@ bool GitPluginPrivate::submitEditorAboutToClose() void GitPluginPrivate::fetch() { - m_gitClient.fetch(currentState().topLevel(), QString()); + m_gitClient.fetch(currentState().topLevel(), {}); } void GitPluginPrivate::pull() @@ -1514,7 +1513,8 @@ void GitPluginPrivate::cleanRepository(const FilePath &directory) QStringList files; QStringList ignoredFiles; QApplication::setOverrideCursor(Qt::WaitCursor); - const bool gotFiles = m_gitClient.synchronousCleanList(directory, QString(), &files, &ignoredFiles, &errorMessage); + const bool gotFiles = m_gitClient.synchronousCleanList(directory, {}, &files, &ignoredFiles, + &errorMessage); QApplication::restoreOverrideCursor(); if (!gotFiles) { @@ -1529,7 +1529,7 @@ void GitPluginPrivate::cleanRepository(const FilePath &directory) // Show in dialog CleanDialog dialog(ICore::dialogParent()); - dialog.setFileList(directory.toString(), files, ignoredFiles); + dialog.setFileList(directory, files, ignoredFiles); dialog.exec(); } @@ -1561,7 +1561,7 @@ void GitPluginPrivate::promptApplyPatch() { const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - applyPatch(state.topLevel(), QString()); + applyPatch(state.topLevel(), {}); } void GitPluginPrivate::applyPatch(const FilePath &workingDirectory, QString file) @@ -1572,7 +1572,7 @@ void GitPluginPrivate::applyPatch(const FilePath &workingDirectory, QString file // Prompt for file if (file.isEmpty()) { const QString filter = tr("Patches (*.patch *.diff)"); - file = QFileDialog::getOpenFileName(ICore::dialogParent(), tr("Choose Patch"), QString(), filter); + file = QFileDialog::getOpenFileName(ICore::dialogParent(), tr("Choose Patch"), {}, filter); if (file.isEmpty()) { m_gitClient.endStashScope(workingDirectory); return; @@ -1601,7 +1601,7 @@ void GitPluginPrivate::stash(bool unstagedOnly) QTC_ASSERT(state.hasTopLevel(), return); const FilePath topLevel = state.topLevel(); - m_gitClient.executeSynchronousStash(topLevel, QString(), unstagedOnly); + m_gitClient.executeSynchronousStash(topLevel, {}, unstagedOnly); if (m_stashDialog) m_stashDialog->refresh(topLevel, true); } @@ -1616,7 +1616,7 @@ void GitPluginPrivate::stashSnapshot() // Prompt for description, restore immediately and keep on working. const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); - const QString id = m_gitClient.synchronousStash(state.topLevel(), QString(), + const QString id = m_gitClient.synchronousStash(state.topLevel(), {}, GitClient::StashImmediateRestore | GitClient::StashPromptDescription); if (!id.isEmpty() && m_stashDialog) m_stashDialog->refresh(state.topLevel(), true); @@ -1906,7 +1906,7 @@ FilePaths GitPluginPrivate::unmanagedFiles(const FilePaths &filePaths) const void GitPluginPrivate::vcsAnnotate(const FilePath &filePath, int line) { - m_gitClient.annotate(filePath.absolutePath(), filePath.fileName(), QString(), line); + m_gitClient.annotate(filePath.absolutePath(), filePath.fileName(), {}, line); } void GitPlugin::emitFilesChanged(const QStringList &l) diff --git a/src/plugins/gitlab/resultparser.cpp b/src/plugins/gitlab/resultparser.cpp index d583b8cc6c5..c8ec89d5dba 100644 --- a/src/plugins/gitlab/resultparser.cpp +++ b/src/plugins/gitlab/resultparser.cpp @@ -60,7 +60,7 @@ static std::pair splitHeaderAndBody(const QByteArray &in } else { json = input; } - return std::make_pair(header, json); + return {header, json}; } static std::pair preHandleSingle(const QByteArray &json) @@ -87,7 +87,7 @@ static std::pair preHandleSingle(const QByteArray &json) } } - return std::make_pair(result, object); + return {result, object}; } static std::pair preHandleHeaderAndBody(const QByteArray &header, @@ -96,33 +96,33 @@ static std::pair preHandleHeaderAndBody(const QByteArray & Error result; if (header.isEmpty()) { result.message = "Missing Expected Header"; - return std::make_pair(result, QJsonDocument()); + return {result, {}}; } QJsonParseError error; const QJsonDocument doc = QJsonDocument::fromJson(json, &error); if (error.error != QJsonParseError::NoError) { result.message = error.errorString(); - return std::make_pair(result, doc); + return {result, doc}; } if (doc.isObject()) { const QJsonObject obj = doc.object(); if (obj.contains("message")) { result = parseErrorMessage(obj.value("message").toString()); - return std::make_pair(result, doc); + return {result, doc}; } else if (obj.contains("error")) { if (obj.value("error").toString() == "insufficient_scope") result.code = 1; result.message = obj.value("error_description").toString(); - return std::make_pair(result, doc); + return {result, doc}; } } if (!doc.isArray()) result.message = "Not an Array"; - return std::make_pair(result, doc); + return {result, doc}; } static User userFromJson(const QJsonObject &jsonObj) diff --git a/src/plugins/languageclient/languageclientsymbolsupport.cpp b/src/plugins/languageclient/languageclientsymbolsupport.cpp index 75e552e4684..d86ac58ba93 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.cpp +++ b/src/plugins/languageclient/languageclientsymbolsupport.cpp @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -162,7 +164,9 @@ QStringList SymbolSupport::getFileContents(const Utils::FilePath &filePath) } QList generateSearchResultItems( - const QMap> &rangesInDocument) + const QMap> &rangesInDocument, + Core::SearchResult *search = nullptr, + bool limitToProjects = false) { QList result; for (auto it = rangesInDocument.begin(); it != rangesInDocument.end(); ++it) { @@ -171,6 +175,8 @@ QList generateSearchResultItems( Core::SearchResultItem item; item.setFilePath(filePath); item.setUseTextEditorFont(true); + if (search && search->supportsReplace() && limitToProjects) + item.setSelectForReplacement(ProjectExplorer::SessionManager::projectForFile(filePath)); QStringList lines = SymbolSupport::getFileContents(filePath); for (const ItemData &data : it.value()) { @@ -284,20 +290,22 @@ bool SymbolSupport::supportsRename(TextEditor::TextDocument *document) void SymbolSupport::renameSymbol(TextEditor::TextDocument *document, const QTextCursor &cursor) { - bool prepareSupported; - if (!LanguageClient::supportsRename(m_client, document, prepareSupported)) - return; - + const TextDocumentPositionParams params = generateDocPosParams(document, cursor); QTextCursor tc = cursor; tc.select(QTextCursor::WordUnderCursor); const QString oldSymbolName = tc.selectedText(); - const QString placeHolder = m_defaultSymbolMapper ? m_defaultSymbolMapper(oldSymbolName) + const QString placeholder = m_defaultSymbolMapper ? m_defaultSymbolMapper(oldSymbolName) : oldSymbolName; - if (prepareSupported) - requestPrepareRename(generateDocPosParams(document, cursor), placeHolder); - else - startRenameSymbol(generateDocPosParams(document, cursor), placeHolder); + bool prepareSupported; + if (!LanguageClient::supportsRename(m_client, document, prepareSupported)) { + const QString error = tr("Renaming is not supported with %1").arg(m_client->name()); + createSearch(params, placeholder)->finishSearch(true, error); + } else if (prepareSupported) { + requestPrepareRename(generateDocPosParams(document, cursor), placeholder); + } else { + startRenameSymbol(generateDocPosParams(document, cursor), placeholder); + } } void SymbolSupport::requestPrepareRename(const TextDocumentPositionParams ¶ms, @@ -307,8 +315,10 @@ void SymbolSupport::requestPrepareRename(const TextDocumentPositionParams ¶m request.setResponseCallback([this, params, placeholder]( const PrepareRenameRequest::Response &response) { const std::optional &error = response.error(); - if (error.has_value()) + if (error.has_value()) { m_client->log(*error); + createSearch(params, placeholder)->finishSearch(true, error->toString()); + } const std::optional &result = response.result(); if (result.has_value()) { @@ -339,7 +349,9 @@ void SymbolSupport::requestRename(const TextDocumentPositionParams &positionPara search->popup(); } -QList generateReplaceItems(const WorkspaceEdit &edits) +QList generateReplaceItems(const WorkspaceEdit &edits, + Core::SearchResult *search, + bool limitToProjects) { auto convertEdits = [](const QList &edits) { return Utils::transform(edits, [](const TextEdit &edit) { @@ -358,11 +370,11 @@ QList generateReplaceItems(const WorkspaceEdit &edits) for (auto it = changes.begin(), end = changes.end(); it != end; ++it) rangesInDocument[it.key().toFilePath()] = convertEdits(it.value()); } - return generateSearchResultItems(rangesInDocument); + return generateSearchResultItems(rangesInDocument, search, limitToProjects); } -void SymbolSupport::startRenameSymbol(const TextDocumentPositionParams &positionParams, - const QString &placeholder) +Core::SearchResult *SymbolSupport::createSearch(const TextDocumentPositionParams &positionParams, + const QString &placeholder) { Core::SearchResult *search = Core::SearchResultWindow::instance()->startNewSearch( tr("Find References with %1 for:").arg(m_client->name()), @@ -394,7 +406,13 @@ void SymbolSupport::startRenameSymbol(const TextDocumentPositionParams &position applyRename(checkedItems); }); - requestRename(positionParams, placeholder, search); + return search; +} + +void SymbolSupport::startRenameSymbol(const TextDocumentPositionParams &positionParams, + const QString &placeholder) +{ + requestRename(positionParams, placeholder, createSearch(positionParams, placeholder)); } void SymbolSupport::handleRenameResponse(Core::SearchResult *search, @@ -409,7 +427,8 @@ void SymbolSupport::handleRenameResponse(Core::SearchResult *search, const std::optional &edits = response.result(); if (edits.has_value()) { - search->addResults(generateReplaceItems(*edits), Core::SearchResult::AddOrdered); + search->addResults(generateReplaceItems(*edits, search, m_limitRenamingToProjects), + Core::SearchResult::AddOrdered); search->additionalReplaceWidget()->setVisible(false); search->setReplaceEnabled(true); search->setSearchAgainEnabled(false); diff --git a/src/plugins/languageclient/languageclientsymbolsupport.h b/src/plugins/languageclient/languageclientsymbolsupport.h index 38a3049d839..79b250ffcc4 100644 --- a/src/plugins/languageclient/languageclientsymbolsupport.h +++ b/src/plugins/languageclient/languageclientsymbolsupport.h @@ -50,6 +50,8 @@ public: using SymbolMapper = std::function; void setDefaultRenamingSymbolMapper(const SymbolMapper &mapper); + void setLimitRenamingToProjects(bool limit) { m_limitRenamingToProjects = limit; } + private: void handleFindReferencesResponse( const LanguageServerProtocol::FindReferencesRequest::Response &response, @@ -60,6 +62,9 @@ private: const QString &placeholder); void requestRename(const LanguageServerProtocol::TextDocumentPositionParams &positionParams, const QString &newName, Core::SearchResult *search); + Core::SearchResult *createSearch( + const LanguageServerProtocol::TextDocumentPositionParams &positionParams, + const QString &placeholder); void startRenameSymbol(const LanguageServerProtocol::TextDocumentPositionParams ¶ms, const QString &placeholder); void handleRenameResponse(Core::SearchResult *search, @@ -68,6 +73,7 @@ private: Client *m_client = nullptr; SymbolMapper m_defaultSymbolMapper; + bool m_limitRenamingToProjects = false; }; } // namespace LanguageClient diff --git a/src/plugins/modeleditor/pxnodeutilities.cpp b/src/plugins/modeleditor/pxnodeutilities.cpp index fc3482b2708..55775228d14 100644 --- a/src/plugins/modeleditor/pxnodeutilities.cpp +++ b/src/plugins/modeleditor/pxnodeutilities.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -76,8 +76,8 @@ qmt::MPackage *PxNodeUtilities::createBestMatchingPackagePath( suggestedParent = dynamic_cast(suggestedParent->owner()); } - QQueue > roots; - roots.append(qMakePair(d->diagramSceneController->modelController()->rootPackage(), 0)); + QList> + roots{{d->diagramSceneController->modelController()->rootPackage(), 0}}; int maxChainLength = -1; int minChainDepth = -1; @@ -94,7 +94,7 @@ qmt::MPackage *PxNodeUtilities::createBestMatchingPackagePath( if (auto childPackage = dynamic_cast(handle.target())) { // only accept root packages in the same path as the suggested parent package if (suggestedParents.contains(childPackage)) { - roots.append(qMakePair(childPackage, depth + 1)); + roots.push_back({childPackage, depth + 1}); break; } } @@ -160,8 +160,7 @@ qmt::MPackage *PxNodeUtilities::createBestMatchingPackagePath( qmt::MObject *PxNodeUtilities::findSameObject(const QStringList &relativeElements, const qmt::MObject *object) { - QQueue roots; - roots.append(d->diagramSceneController->modelController()->rootPackage()); + QList roots{d->diagramSceneController->modelController()->rootPackage()}; while (!roots.isEmpty()) { qmt::MPackage *package = roots.takeFirst(); diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index 946b4074e8a..7bcc18a6210 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -306,9 +306,8 @@ private: parserCheckBoxes.clear(); for (const CustomParserSettings &s : ProjectExplorerPlugin::customParsers()) { const auto checkBox = new QCheckBox(s.displayName, this); - connect(checkBox, &QCheckBox::stateChanged, - this, &SelectionWidget::selectionChanged); - parserCheckBoxes << qMakePair(checkBox, s.id); + connect(checkBox, &QCheckBox::stateChanged, this, &SelectionWidget::selectionChanged); + parserCheckBoxes.push_back({checkBox, s.id}); layout->addWidget(checkBox); } setSelectedParsers(parsers); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 9b21fc0f79d..baee2cd84eb 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -126,6 +126,11 @@ QUrl DesktopDevice::toolControlChannel(const ControlChannelHint &) const return url; } +bool DesktopDevice::usableAsBuildDevice() const +{ + return true; +} + bool DesktopDevice::handlesFile(const FilePath &filePath) const { return !filePath.needsDevice(); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index 8f7de354a2d..b310c73b7d3 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -30,6 +30,7 @@ public: DeviceProcessSignalOperation::Ptr signalOperation() const override; DeviceEnvironmentFetcher::Ptr environmentFetcher() const override; QUrl toolControlChannel(const ControlChannelHint &) const override; + bool usableAsBuildDevice() const override; bool handlesFile(const Utils::FilePath &filePath) const override; Utils::Environment systemEnvironment() const override; diff --git a/src/plugins/projectexplorer/devicesupport/devicefilesystemmodel.cpp b/src/plugins/projectexplorer/devicesupport/devicefilesystemmodel.cpp index f1eff39a521..29858efe3e2 100644 --- a/src/plugins/projectexplorer/devicesupport/devicefilesystemmodel.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicefilesystemmodel.cpp @@ -236,7 +236,7 @@ static void dirEntries(QFutureInterface &futureInterface, const File for (const FilePath &entry : entries) { if (futureInterface.isCanceled()) return; - result.append(qMakePair(entry, fileType(entry))); + result.push_back({entry, fileType(entry)}); } futureInterface.reportResult(result); } diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 06f1e28929d..3e144a9e502 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -137,6 +137,8 @@ public: virtual bool isCompatibleWith(const Kit *k) const; virtual QList validate() const; + virtual bool usableAsBuildDevice() const { return false; } + QString displayType() const; Utils::OsType osType() const; diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 3461b7e7c4e..0b2b37fbcf5 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -616,7 +616,7 @@ HeaderPaths GccToolChain::builtInHeaderPaths(const Utils::Environment &env, if (!originalTargetTriple.isEmpty()) arguments << "-target" << originalTargetTriple; - const std::optional cachedPaths = headerCache->check(qMakePair(env, arguments)); + const std::optional cachedPaths = headerCache->check({env, arguments}); if (cachedPaths) return cachedPaths.value(); @@ -624,7 +624,7 @@ HeaderPaths GccToolChain::builtInHeaderPaths(const Utils::Environment &env, arguments, env); extraHeaderPathsFunction(paths); - headerCache->insert(qMakePair(env, arguments), paths); + headerCache->insert({env, arguments}, paths); qCDebug(gccLog) << "Reporting header paths to code model:"; for (const HeaderPath &hp : qAsConst(paths)) { diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index 54d0323accf..63723c757b3 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -300,7 +300,7 @@ std::pair JsonWizardFactory::screenSizeInfoFromPage(const QStr if (values.isEmpty()) return {}; - return std::make_pair(index, values); + return {index, values}; } JsonWizardFactory::Page JsonWizardFactory::parsePage(const QVariant &value, QString *errorMessage) diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index b5b9f47bc8d..22675f4e672 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -13,8 +13,6 @@ #include "toolchain.h" #include "toolchainmanager.h" -#include - #include #include #include @@ -1183,8 +1181,7 @@ private: const DeviceManager *dm = DeviceManager::instance(); for (int i = 0; i < dm->deviceCount(); ++i) { IDevice::ConstPtr device = dm->deviceAt(i); - if (!(device->type() == Constants::DESKTOP_DEVICE_TYPE - || device->type() == Docker::Constants::DOCKER_DEVICE_TYPE)) + if (!device->usableAsBuildDevice()) blackList.append(device->id()); } @@ -1535,8 +1532,7 @@ KitAspectWidget *EnvironmentKitAspect::createConfigWidget(Kit *k) const KitAspect::ItemList EnvironmentKitAspect::toUserOutput(const Kit *k) const { - return { qMakePair(tr("Environment"), - EnvironmentItem::toStringList(environmentChanges(k)).join("
")) }; + return {{tr("Environment"), EnvironmentItem::toStringList(environmentChanges(k)).join("
")}}; } Id EnvironmentKitAspect::id() diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index 3d1c4511e43..bf9c731ce16 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -19,7 +19,7 @@ static QPair parseFileName(const QString &input) { QString fileName = input; if (fileName.startsWith("LINK") || fileName.startsWith("cl")) - return qMakePair(FilePath(), -1); + return {{}, -1}; // Extract linenumber (if it is there): int linenumber = -1; @@ -39,7 +39,7 @@ static QPair parseFileName(const QString &input) } } const QString normalized = FileUtils::normalizedPathName(fileName); - return qMakePair(FilePath::fromUserInput(normalized), linenumber); + return {FilePath::fromUserInput(normalized), linenumber}; } using namespace ProjectExplorer; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 030e92da3cf..8ef24d8ed30 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -3247,7 +3247,7 @@ QList> ProjectExplorerPlugin::runningRunContro const QList runControls = allRunControls(); for (RunControl *rc : runControls) { if (rc->isRunning()) - processes << qMakePair(rc->commandLine(), rc->applicationProcessHandle()); + processes.push_back({rc->commandLine(), rc->applicationProcessHandle()}); } return processes; } @@ -3420,7 +3420,7 @@ void ProjectExplorerPluginPrivate::addToRecentProjects(const FilePath &filePath, if (m_recentProjects.count() > m_maxRecentProjects) m_recentProjects.removeLast(); - m_recentProjects.prepend(qMakePair(filePath, displayName)); + m_recentProjects.push_front({filePath, displayName}); m_lastOpenDirectory = filePath.absolutePath(); emit m_instance->recentProjectsChanged(); } @@ -3947,10 +3947,10 @@ void ProjectExplorerPluginPrivate::removeFile() const FilePath filePath = currentNode->filePath(); using NodeAndPath = QPair; - QList filesToRemove{qMakePair(currentNode, currentNode->filePath())}; + QList filesToRemove{{currentNode, currentNode->filePath()}}; QList siblings; for (const Node * const n : ProjectTree::siblingsWithSameBaseName(currentNode)) - siblings << qMakePair(n, n->filePath()); + siblings.push_back({n, n->filePath()}); RemoveFileDialog removeFileDialog(filePath, ICore::dialogParent()); if (removeFileDialog.exec() != QDialog::Accepted) diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 056cc095a8e..f9a6af9afc6 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -721,7 +721,7 @@ bool FlatModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int r struct VcsInfo { Core::IVersionControl *vcs = nullptr; - QString repoDir; + FilePath repoDir; bool operator==(const VcsInfo &other) const { return vcs == other.vcs && repoDir == other.repoDir; } diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index ab02a6ee9e1..78c42880dff 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -576,7 +576,7 @@ FileNode *FolderNode::fileNode(const Utils::FilePath &file) const })); } -QList FolderNode::folderNodes() const +QList FolderNode::folderNodes() const { QList result; for (const std::unique_ptr &n : m_nodes) { diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index be0d6aae142..b40c955d542 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -311,9 +311,9 @@ void ProjectTree::updateFileWarning(Core::IDocument *document, const QString &te if (filePath.canonicalPath().isChildOf(projectDir.canonicalPath())) return; // External file. Test if it under the same VCS - QString topLevel; + FilePath topLevel; if (Core::VcsManager::findVersionControlForDirectory(projectDir, &topLevel) - && filePath.isChildOf(FilePath::fromString(topLevel))) { + && filePath.isChildOf(topLevel)) { return; } } diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 4502400865e..eb2721eeacd 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -272,9 +272,11 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) m_additionalInfo = new QLabel; m_addToVersionControlLabel = new QLabel(tr("Add to &version control:")); m_addToVersionControlComboBox = new QComboBox; + m_addToVersionControlComboBox->setObjectName("addToVersionControlComboBox"); m_vcsManageButton = new QPushButton(ICore::msgShowOptionsDialog()); m_vcsManageButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); m_filesLabel = new QLabel; + m_filesLabel->setObjectName("filesLabel"); m_filesLabel->setAlignment(Qt::AlignBottom); m_filesLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); auto scrollArea = new QScrollArea; diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 5a3ba7f6507..354440b4baf 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -486,7 +486,7 @@ void RunSettingsWidget::addSubWidget(QWidget *widget, QLabel *label) l->addWidget(label, l->rowCount(), 0, 1, -1); l->addWidget(widget, l->rowCount(), 0, 1, -1); - m_subWidgets.append(qMakePair(widget, label)); + m_subWidgets.push_back({widget, label}); } void RunSettingsWidget::removeSubWidgets() diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 051fb287aa0..12a6bcf5452 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -635,7 +635,7 @@ QStringList SessionManagerPrivate::dependenciesOrder() const return p->projectFilePath().toString() == proPath; }); }); - unordered << qMakePair(proName, depList); + unordered.push_back({proName, depList}); } while (!unordered.isEmpty()) { diff --git a/src/plugins/projectexplorer/targetsetupwidget.cpp b/src/plugins/projectexplorer/targetsetupwidget.cpp index 78888d2aba4..12c7880b65e 100644 --- a/src/plugins/projectexplorer/targetsetupwidget.cpp +++ b/src/plugins/projectexplorer/targetsetupwidget.cpp @@ -338,7 +338,7 @@ void TargetSetupWidget::reportIssues(int index) QPair TargetSetupWidget::findIssues(const BuildInfo &info) { if (m_projectPath.isEmpty() || !info.factory) - return qMakePair(Task::Unknown, QString()); + return {Task::Unknown, {}}; QString buildDir = info.buildDirectory.toString(); Tasks issues; @@ -364,7 +364,7 @@ QPair TargetSetupWidget::findIssues(const BuildInfo &in } if (!text.isEmpty()) text = QLatin1String("") + text; - return qMakePair(highestType, text); + return {highestType, text}; } TargetSetupWidget::BuildInfoStore::~BuildInfoStore() diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 4570161c112..977b494d525 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -930,7 +930,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, + startOffset, positions.top() + linePos.y()); const QSize linkSize(endOffset - startOffset, linkLine.height()); const QRectF linkRect(linkPos, linkSize); - m_hrefs << qMakePair(linkRect, range.format.anchorHref()); + m_hrefs.push_back({linkRect, range.format.anchorHref()}); } } diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 04d4bddc398..d0b9d92e86f 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -70,6 +70,7 @@ public: ToolChain::MacrosCache m_predefinedMacrosCache; ToolChain::HeaderPathsCache m_headerPathsCache; + std::optional m_isValid; }; @@ -185,9 +186,10 @@ Abis ToolChain::supportedAbis() const bool ToolChain::isValid() const { - if (compilerCommand().isEmpty()) - return false; - return compilerCommand().isExecutableFile(); + if (!d->m_isValid.has_value()) + d->m_isValid = !compilerCommand().isEmpty() && compilerCommand().isExecutableFile(); + + return d->m_isValid.value_or(false); } QStringList ToolChain::includedFiles(const QStringList &flags, const QString &directory) const @@ -315,6 +317,8 @@ FilePath ToolChain::compilerCommand() const void ToolChain::setCompilerCommand(const FilePath &command) { + d->m_isValid.reset(); + if (command == d->m_compilerCommand) return; d->m_compilerCommand = command; @@ -379,6 +383,7 @@ bool ToolChain::fromMap(const QVariantMap &data) d->m_targetAbi = Abi::fromString(data.value(d->m_targetAbiKey).toString()); d->m_compilerCommand = FilePath::fromVariant(data.value(d->m_compilerCommandKey)); + d->m_isValid.reset(); return true; } @@ -591,7 +596,7 @@ static QPair rawIdData(const QVariantMap &data) const QString raw = data.value(QLatin1String(ID_KEY)).toString(); const int pos = raw.indexOf(QLatin1Char(':')); QTC_ASSERT(pos > 0, return qMakePair(QString::fromLatin1("unknown"), QString::fromLatin1("unknown"))); - return qMakePair(raw.mid(0, pos), raw.mid(pos + 1)); + return {raw.mid(0, pos), raw.mid(pos + 1)}; } QByteArray ToolChainFactory::idFromMap(const QVariantMap &data) @@ -680,11 +685,9 @@ static QString badToolchainTimestampKey() { return {"Timestamp"}; } QVariantMap BadToolchain::toMap() const { - return { - std::make_pair(badToolchainFilePathKey(), filePath.toVariant()), - std::make_pair(badToolchainSymlinkTargetKey(), symlinkTarget.toVariant()), - std::make_pair(badToolchainTimestampKey(), timestamp.toMSecsSinceEpoch()), - }; + return {{badToolchainFilePathKey(), filePath.toVariant()}, + {badToolchainSymlinkTargetKey(), symlinkTarget.toVariant()}, + {badToolchainTimestampKey(), timestamp.toMSecsSinceEpoch()}}; } BadToolchain BadToolchain::fromMap(const QVariantMap &map) diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index 5f261888785..33a564c8b88 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -157,7 +157,7 @@ public: autoRoot->appendChild(autoNode); manualRoot->appendChild(manualNode); - m_languageMap.insert(l, qMakePair(autoNode, manualNode)); + m_languageMap.insert(l, {autoNode, manualNode}); } m_model.rootItem()->appendChild(autoRoot); diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index f1057fe9628..86814054895 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -27,6 +27,8 @@ using namespace Utils; using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; +using StringVariantPair = std::pair; + namespace { const char OBSOLETE_VERSION_KEY[] = "ProjectExplorer.Project.Updater.FileVersion"; @@ -331,13 +333,13 @@ UserFileAccessor::merge(const MergingSettingsAccessor::SettingsMergeData &global return std::nullopt; if (isHouseKeepingKey(key) || global.key == USER_STICKY_KEYS_KEY) - return qMakePair(key, mainValue); + return {{key, mainValue}}; if (!stickyKeys.contains(global.key) && secondaryValue != mainValue && !secondaryValue.isNull()) - return qMakePair(key, secondaryValue); + return {{key, secondaryValue}}; if (!mainValue.isNull()) - return qMakePair(key, mainValue); - return qMakePair(key, secondaryValue); + return {{key, mainValue}}; + return {{key, secondaryValue}}; } // When saving settings... @@ -360,7 +362,7 @@ SettingsMergeFunction UserFileAccessor::userStickyTrackerFunction(QStringList &s return std::nullopt; if (isHouseKeepingKey(key)) - return qMakePair(key, main); + return {{key, main}}; // Ignore house keeping keys: if (key == USER_STICKY_KEYS_KEY) @@ -369,7 +371,7 @@ SettingsMergeFunction UserFileAccessor::userStickyTrackerFunction(QStringList &s // Track keys that changed in main from the value in secondary: if (main != secondary && !secondary.isNull() && !stickyKeys.contains(global.key)) stickyKeys.append(global.key); - return qMakePair(key, main); + return {{key, main}}; }; } @@ -471,15 +473,10 @@ QVariantMap UserFileVersion14Upgrader::upgrade(const QVariantMap &map) QVariantMap UserFileVersion15Upgrader::upgrade(const QVariantMap &map) { - QList changes; - changes.append(qMakePair(QLatin1String("ProjectExplorer.Project.Updater.EnvironmentId"), - QLatin1String("EnvironmentId"))); - // This is actually handled in the SettingsAccessor itself: - // changes.append(qMakePair(QLatin1String("ProjectExplorer.Project.Updater.FileVersion"), - // QLatin1String("Version"))); - changes.append(qMakePair(QLatin1String("ProjectExplorer.Project.UserStickyKeys"), - QLatin1String("UserStickyKeys"))); - + const QList changes{{QLatin1String("ProjectExplorer.Project.Updater.EnvironmentId"), + QLatin1String("EnvironmentId")}, + {QLatin1String("ProjectExplorer.Project.UserStickyKeys"), + QLatin1String("UserStickyKeys")}}; return renameKeys(changes, QVariantMap(map)); } @@ -744,12 +741,12 @@ QVariant UserFileVersion18Upgrader::process(const QVariant &entry) return Utils::transform(entry.toList(), &UserFileVersion18Upgrader::process); case QVariant::Map: return Utils::transform>( - entry.toMap().toStdMap(), [](const std::pair &item) { + entry.toMap().toStdMap(), [](const StringVariantPair &item) -> StringVariantPair { const QString key = (item.first == "AutotoolsProjectManager.MakeStep.AdditionalArguments" ? QString("AutotoolsProjectManager.MakeStep.MakeArguments") : item.first); - return qMakePair(key, UserFileVersion18Upgrader::process(item.second)); + return {key, UserFileVersion18Upgrader::process(item.second)}; }); default: return entry; @@ -798,24 +795,24 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QString return Utils::transform(entry.toList(), std::bind(&UserFileVersion19Upgrader::process, std::placeholders::_1, path)); case QVariant::Map: - return Utils::transform( - entry.toMap().toStdMap(), [&](const std::pair &item) { - if (path.size() == 2 && path.at(1).startsWith("ProjectExplorer.Target.RunConfiguration.")) { - if (argsKeys.contains(item.first)) - return qMakePair(QString("RunConfiguration.Arguments"), item.second); - if (wdKeys.contains(item.first)) - return qMakePair(QString("RunConfiguration.WorkingDirectory"), item.second); - if (termKeys.contains(item.first)) - return qMakePair(QString("RunConfiguration.UseTerminal"), item.second); - if (libsKeys.contains(item.first)) - return qMakePair(QString("RunConfiguration.UseLibrarySearchPath"), item.second); - if (dyldKeys.contains(item.first)) - return qMakePair(QString("RunConfiguration.UseDyldImageSuffix"), item.second); - } - QStringList newPath = path; - newPath.append(item.first); - return qMakePair(item.first, UserFileVersion19Upgrader::process(item.second, newPath)); - }); + return Utils::transform(entry.toMap().toStdMap(), + [&](const StringVariantPair &item) -> StringVariantPair { + if (path.size() == 2 && path.at(1).startsWith("ProjectExplorer.Target.RunConfiguration.")) { + if (argsKeys.contains(item.first)) + return {"RunConfiguration.Arguments", item.second}; + if (wdKeys.contains(item.first)) + return {"RunConfiguration.WorkingDirectory", item.second}; + if (termKeys.contains(item.first)) + return {"RunConfiguration.UseTerminal", item.second}; + if (libsKeys.contains(item.first)) + return {"RunConfiguration.UseLibrarySearchPath", item.second}; + if (dyldKeys.contains(item.first)) + return {"RunConfiguration.UseDyldImageSuffix", item.second}; + } + QStringList newPath = path; + newPath.append(item.first); + return {item.first, UserFileVersion19Upgrader::process(item.second, newPath)}; + }); default: return entry; } @@ -833,8 +830,8 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) return Utils::transform(entry.toList(), &UserFileVersion20Upgrader::process); case QVariant::Map: return Utils::transform>( - entry.toMap().toStdMap(), [](const std::pair &item) { - auto res = qMakePair(item.first, item.second); + entry.toMap().toStdMap(), [](const StringVariantPair &item) { + StringVariantPair res = {item.first, item.second}; if (item.first == "ProjectExplorer.ProjectConfiguration.Id" && item.second == "Qbs.Deploy") res.second = QVariant("ProjectExplorer.DefaultDeployConfiguration"); @@ -865,8 +862,8 @@ QVariant UserFileVersion21Upgrader::process(const QVariant &entry) return entryMap; } return Utils::transform( - entryMap.toStdMap(), [](const std::pair &item) { - return qMakePair(item.first, UserFileVersion21Upgrader::process(item.second)); + entryMap.toStdMap(), [](const StringVariantPair &item) -> StringVariantPair{ + return {item.first, UserFileVersion21Upgrader::process(item.second)}; }); } default: diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.cpp b/src/plugins/qbsprojectmanager/qbskitinformation.cpp index 5756950f0ef..7b5632ae8d1 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.cpp +++ b/src/plugins/qbsprojectmanager/qbskitinformation.cpp @@ -94,7 +94,7 @@ Tasks QbsKitAspect::validate(const Kit *) const { return {}; } KitAspect::ItemList QbsKitAspect::toUserOutput(const Kit *k) const { - return ItemList({qMakePair(displayName(), representation(k))}); + return {{displayName(), representation(k)}}; } KitAspectWidget *QbsKitAspect::createConfigWidget(Kit *k) const diff --git a/src/plugins/qbsprojectmanager/qbssession.cpp b/src/plugins/qbsprojectmanager/qbssession.cpp index 377d70dc6c0..b083cc5cf3d 100644 --- a/src/plugins/qbsprojectmanager/qbssession.cpp +++ b/src/plugins/qbsprojectmanager/qbssession.cpp @@ -197,8 +197,7 @@ void QbsSession::initialize() void QbsSession::sendQuitPacket() { - d->qbsProcess->writeRaw(Packet::createPacket(QJsonObject{qMakePair(QString("type"), - QJsonValue("quit"))})); + d->qbsProcess->writeRaw(Packet::createPacket({{"type", "quit"}})); } QbsSession::~QbsSession() @@ -262,7 +261,7 @@ void QbsSession::sendRequest(const QJsonObject &request) void QbsSession::cancelCurrentJob() { if (d->state == State::Active) - sendRequest(QJsonObject{qMakePair(QString("type"), QJsonValue("cancel-job"))}); + sendRequest({{"type", "cancel-job"}}); } void QbsSession::requestFilesGeneratedFrom(const QHash &sourceFilesPerProduct) @@ -275,7 +274,7 @@ void QbsSession::requestFilesGeneratedFrom(const QHash &so product.insert("full-display-name", it.key()); QJsonArray requests; for (const QString &sourceFile : it.value()) - requests << QJsonObject({qMakePair(QString("source-file"), sourceFile)}); + requests << QJsonObject({{"source-file", sourceFile}}); product.insert("requests", requests); products << product; } diff --git a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp index 2f265582b20..4219de0845b 100644 --- a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp +++ b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp @@ -23,6 +23,8 @@ #include #include +using namespace Utils; + namespace QmakeProjectManager::Internal { const char qt_file_dialog_filter_reg_exp[] = @@ -38,8 +40,8 @@ static QStringList qt_clean_filter_list(const QString &filter) return f.split(QLatin1Char(' '), Qt::SkipEmptyParts); } -static bool validateLibraryPath(const Utils::FilePath &filePath, - const Utils::PathChooser *pathChooser, +static bool validateLibraryPath(const FilePath &filePath, + const PathChooser *pathChooser, QString *errorMessage) { Q_UNUSED(errorMessage) @@ -49,7 +51,7 @@ static bool validateLibraryPath(const Utils::FilePath &filePath, const QString fileName = filePath.fileName(); QRegularExpression::PatternOption option = - Utils::HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive + HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption; @@ -63,8 +65,9 @@ static bool validateLibraryPath(const Utils::FilePath &filePath, return false; } -AddLibraryWizard::AddLibraryWizard(const Utils::FilePath &proFile, QWidget *parent) : - Utils::Wizard(parent), m_proFile(proFile) +AddLibraryWizard::AddLibraryWizard(const FilePath &proFile, QWidget *parent) + : Wizard(parent) + , m_proFile(proFile) { setWindowTitle(Tr::tr("Add Library")); m_libraryTypePage = new LibraryTypePage(this); @@ -77,7 +80,7 @@ AddLibraryWizard::AddLibraryWizard(const Utils::FilePath &proFile, QWidget *pare AddLibraryWizard::~AddLibraryWizard() = default; -Utils::FilePath AddLibraryWizard::proFile() const +FilePath AddLibraryWizard::proFile() const { return m_proFile; } @@ -147,7 +150,7 @@ LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent) packageLabel->setAttribute(Qt::WA_MacSmallSize, true); layout->addWidget(packageLabel); - if (Utils::HostOsInfo::isWindowsHost()) { + if (HostOsInfo::isWindowsHost()) { m_packageRadio->setVisible(false); packageLabel->setVisible(false); } @@ -155,7 +158,7 @@ LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent) // select the default m_internalRadio->setChecked(true); - setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Type")); + setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Type")); } AddLibraryWizard::LibraryKind LibraryTypePage::libraryKind() const @@ -177,16 +180,16 @@ DetailsPage::DetailsPage(AddLibraryWizard *parent) m_libraryDetailsWidget = new LibraryDetailsWidget(this); resize(456, 438); - Utils::PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser; + PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser; libPathChooser->setHistoryCompleter("Qmake.LibDir.History"); - const auto pathValidator = [libPathChooser](Utils::FancyLineEdit *edit, QString *errorMessage) { + const auto pathValidator = [libPathChooser](FancyLineEdit *edit, QString *errorMessage) { return libPathChooser->defaultValidationFunction()(edit, errorMessage) && validateLibraryPath(libPathChooser->filePath(), libPathChooser, errorMessage); }; libPathChooser->setValidationFunction(pathValidator); - setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Details")); + setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Details")); } bool DetailsPage::isComplete() const @@ -272,7 +275,7 @@ SummaryPage::SummaryPage(AddLibraryWizard *parent) m_snippetLabel->setTextFormat(Qt::RichText); m_snippetLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); - setProperty(Utils::SHORT_TITLE_PROPERTY, Tr::tr("Summary")); + setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Summary")); } void SummaryPage::initializePage() @@ -302,17 +305,12 @@ QString SummaryPage::snippet() const LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent) { - includePathChooser = new Utils::PathChooser(parent); - + includePathChooser = new PathChooser(parent); packageLineEdit = new QLineEdit(parent); - - libraryPathChooser = new Utils::PathChooser(parent); - + libraryPathChooser = new PathChooser(parent); libraryComboBox = new QComboBox(parent); - libraryTypeComboBox = new QComboBox(parent); - platformGroupBox = new QGroupBox(Tr::tr("Platform:")); platformGroupBox->setFlat(true); @@ -325,7 +323,6 @@ LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent) winGroupBox = new QGroupBox(Tr::tr("Windows:")); winGroupBox->setFlat(true); - linCheckBox = new QCheckBox(Tr::tr("Linux")); linCheckBox->setChecked(true); @@ -348,7 +345,7 @@ LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent) addSuffixCheckBox = new QCheckBox(Tr::tr("Add \"d\" suffix for debug version"), winGroupBox); removeSuffixCheckBox = new QCheckBox(Tr::tr("Remove \"d\" suffix for release version"), winGroupBox); - using namespace Utils::Layouting; + using namespace Layouting; Column { linCheckBox, macCheckBox, winCheckBox, st }.attachTo(platformGroupBox); diff --git a/src/plugins/qmakeprojectmanager/externaleditors.cpp b/src/plugins/qmakeprojectmanager/externaleditors.cpp index 7bb38331d01..4462fbb822f 100644 --- a/src/plugins/qmakeprojectmanager/externaleditors.cpp +++ b/src/plugins/qmakeprojectmanager/externaleditors.cpp @@ -49,14 +49,14 @@ static QString linguistBinary(const QtSupport::QtVersion *qtVersion) { if (qtVersion) return qtVersion->linguistFilePath().toString(); - return QLatin1String(Utils::HostOsInfo::isMacHost() ? "Linguist" : "linguist"); + return QLatin1String(HostOsInfo::isMacHost() ? "Linguist" : "linguist"); } static QString designerBinary(const QtSupport::QtVersion *qtVersion) { if (qtVersion) return qtVersion->designerFilePath().toString(); - return QLatin1String(Utils::HostOsInfo::isMacHost() ? "Designer" : "designer"); + return QLatin1String(HostOsInfo::isMacHost() ? "Designer" : "designer"); } // Mac: Change the call 'Foo.app/Contents/MacOS/Foo ' to @@ -80,7 +80,7 @@ static const char designerDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors", static const char linguistDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Qt Linguist"); // -------------- ExternalQtEditor -ExternalQtEditor::ExternalQtEditor(Utils::Id id, +ExternalQtEditor::ExternalQtEditor(Id id, const QString &displayName, const QString &mimetype, const CommandForQtVersion &commandForQtVersion) @@ -101,7 +101,7 @@ ExternalQtEditor *ExternalQtEditor::createLinguistEditor() ExternalQtEditor *ExternalQtEditor::createDesignerEditor() { - if (Utils::HostOsInfo::isMacHost()) { + if (HostOsInfo::isMacHost()) { return new ExternalQtEditor(designerIdC, QLatin1String(designerDisplayName), QLatin1String(ProjectExplorer::Constants::FORM_MIMETYPE), @@ -124,7 +124,7 @@ static QString findFirstCommand(QVector qtVersions, return QString(); } -bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath, +bool ExternalQtEditor::getEditorLaunchData(const FilePath &filePath, LaunchData *data, QString *errorMessage) const { @@ -156,7 +156,7 @@ bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath, // fallback if (data->binary.isEmpty()) { const QString path = qtcEnvironmentVariable("PATH"); - data->binary = Utils::QtcProcess::locateBinary(path, m_commandForQtVersion(nullptr)); + data->binary = QtcProcess::locateBinary(path, m_commandForQtVersion(nullptr)); } if (data->binary.isEmpty()) { @@ -165,14 +165,14 @@ bool ExternalQtEditor::getEditorLaunchData(const Utils::FilePath &filePath, } // Setup binary + arguments, use Mac Open if appropriate data->arguments.push_back(filePath.toString()); - if (Utils::HostOsInfo::isMacHost()) + if (HostOsInfo::isMacHost()) *data = createMacOpenCommand(*data); if (debug) qDebug() << Q_FUNC_INFO << '\n' << data->binary << data->arguments; return true; } -bool ExternalQtEditor::startEditor(const Utils::FilePath &filePath, QString *errorMessage) +bool ExternalQtEditor::startEditor(const FilePath &filePath, QString *errorMessage) { LaunchData data; return getEditorLaunchData(filePath, &data, errorMessage) @@ -215,7 +215,7 @@ void DesignerExternalEditor::processTerminated(const QString &binary) socket->deleteLater(); } -bool DesignerExternalEditor::startEditor(const Utils::FilePath &filePath, QString *errorMessage) +bool DesignerExternalEditor::startEditor(const FilePath &filePath, QString *errorMessage) { LaunchData data; // Find the editor binary diff --git a/src/plugins/qmakeprojectmanager/makefileparse.cpp b/src/plugins/qmakeprojectmanager/makefileparse.cpp index 78e88c1742c..711d839131b 100644 --- a/src/plugins/qmakeprojectmanager/makefileparse.cpp +++ b/src/plugins/qmakeprojectmanager/makefileparse.cpp @@ -480,8 +480,8 @@ void QmakeProjectManagerPlugin::testMakefileParser() MakeFileParse parser("/tmp/something", MakeFileParse::Mode::FilterKnownConfigValues); parser.parseCommandLine(command, project); - QCOMPARE(Utils::ProcessArgs::splitArgs(parser.unparsedArguments()), - Utils::ProcessArgs::splitArgs(unparsedArguments)); + QCOMPARE(ProcessArgs::splitArgs(parser.unparsedArguments()), + ProcessArgs::splitArgs(unparsedArguments)); QCOMPARE(parser.effectiveBuildConfig({}), effectiveBuildConfig); const QMakeStepConfig qmsc = parser.config(); diff --git a/src/plugins/qmakeprojectmanager/profileeditor.cpp b/src/plugins/qmakeprojectmanager/profileeditor.cpp index c8706b20e81..d4d52f657d2 100644 --- a/src/plugins/qmakeprojectmanager/profileeditor.cpp +++ b/src/plugins/qmakeprojectmanager/profileeditor.cpp @@ -40,7 +40,7 @@ class ProFileEditorWidget : public TextEditorWidget { private: void findLinkAt(const QTextCursor &, - const Utils::LinkHandler &processLinkCallback, + const LinkHandler &processLinkCallback, bool resolveTarget = true, bool inNextSplit = false) override; void contextMenuEvent(QContextMenuEvent *) override; @@ -207,7 +207,7 @@ void ProFileEditorWidget::findLinkAt(const QTextCursor &cursor, QDir dir(textDocument()->filePath().toFileInfo().absolutePath()); QString fileName = dir.filePath(buffer); QFileInfo fi(fileName); - if (Utils::HostOsInfo::isWindowsHost() && fileName.startsWith("//")) { + if (HostOsInfo::isWindowsHost() && fileName.startsWith("//")) { // Windows network paths are not supported here since checking for their existence can // lock the gui thread. See: QTCREATORBUG-26579 } else if (fi.exists()) { @@ -219,9 +219,9 @@ void ProFileEditorWidget::findLinkAt(const QTextCursor &cursor, else return processLinkCallback(link); } - link.targetFilePath = Utils::FilePath::fromString(QDir::cleanPath(fileName)); + link.targetFilePath = FilePath::fromString(QDir::cleanPath(fileName)); } else { - link.targetFilePath = Utils::FilePath::fromString(checkForPrfFile(buffer)); + link.targetFilePath = FilePath::fromString(checkForPrfFile(buffer)); } if (!link.targetFilePath.isEmpty()) { link.linkTextStart = cursor.position() - positionInBlock + beginPos + 1; @@ -268,7 +268,7 @@ ProFileEditorFactory::ProFileEditorFactory() completionAssistProvider->setDynamicCompletionFunction(&TextEditor::pathComplete); setCompletionAssistProvider(completionAssistProvider); - setCommentDefinition(Utils::CommentDefinition::HashStyle); + setCommentDefinition(CommentDefinition::HashStyle); setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection | TextEditorActionHandler::JumpToFileUnderCursor); @@ -276,11 +276,11 @@ ProFileEditorFactory::ProFileEditorFactory() setSyntaxHighlighterCreator([]() { return new ProFileHighlighter; }); const QString defaultOverlay = QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QT); - Utils::FileIconProvider::registerIconOverlayForSuffix( + FileIconProvider::registerIconOverlayForSuffix( creatorTheme()->imageFile(Theme::IconOverlayPro, defaultOverlay), "pro"); - Utils::FileIconProvider::registerIconOverlayForSuffix( + FileIconProvider::registerIconOverlayForSuffix( creatorTheme()->imageFile(Theme::IconOverlayPri, defaultOverlay), "pri"); - Utils::FileIconProvider::registerIconOverlayForSuffix( + FileIconProvider::registerIconOverlayForSuffix( creatorTheme()->imageFile(Theme::IconOverlayPrf, defaultOverlay), "prf"); } diff --git a/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp b/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp index 149b797ef41..354b87335ef 100644 --- a/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp +++ b/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp @@ -14,6 +14,7 @@ #include using namespace Core; +using namespace Utils; namespace QmakeProjectManager { namespace Internal { @@ -27,7 +28,7 @@ void ProFileHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidg int pos, ReportPriority report) { - Utils::ExecuteOnDestruction reportPriority([this, report](){ report(priority()); }); + ExecuteOnDestruction reportPriority([this, report](){ report(priority()); }); m_docFragment.clear(); m_manualKind = UnknownManual; @@ -114,8 +115,8 @@ void ProFileHoverHandler::identifyDocFragment(ProFileHoverHandler::ManualKind ma QUrl url(QString::fromLatin1("qthelp://org.qt-project.qmake/qmake/qmake-%1-reference.html").arg(manualName())); const QByteArray html = Core::HelpManager::fileData(url); - Utils::HtmlDocExtractor htmlExtractor; - htmlExtractor.setMode(Utils::HtmlDocExtractor::FirstParagraph); + HtmlDocExtractor htmlExtractor; + htmlExtractor.setMode(HtmlDocExtractor::FirstParagraph); // Document fragment of qmake function is retrieved from docs. // E.g. in case of the keyword "find" the document fragment diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 9bad1ae72b5..0d6e208fa5e 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -89,7 +89,7 @@ FilePath QmakeBuildConfiguration::shadowBuildDirectory(const FilePath &proFilePa const char BUILD_CONFIGURATION_KEY[] = "Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration"; -QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Utils::Id id) +QmakeBuildConfiguration::QmakeBuildConfiguration(Target *target, Id id) : BuildConfiguration(target, id) { setConfigWidgetDisplayName(Tr::tr("General")); diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index e5c0265daa1..3e696b6056e 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -96,7 +96,7 @@ KitAspectWidget *QmakeKitAspect::createConfigWidget(Kit *k) const KitAspect::ItemList QmakeKitAspect::toUserOutput(const Kit *k) const { - return {qMakePair(Tr::tr("mkspec"), QDir::toNativeSeparators(mkspec(k)))}; + return {{Tr::tr("mkspec"), QDir::toNativeSeparators(mkspec(k))}}; } void QmakeKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const @@ -107,7 +107,7 @@ void QmakeKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const }); } -Utils::Id QmakeKitAspect::id() +Id QmakeKitAspect::id() { return Constants::KIT_INFORMATION_ID; } diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 64eaf2507d5..00d1eea99a5 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -115,7 +115,8 @@ bool QmakeBuildSystem::supportsAction(Node *context, ProjectAction action, const const FolderNode *folder = node->asFolderNode(); if (folder) { QStringList list; - foreach (FolderNode *f, folder->folderNodes()) + const auto folderNodes = folder->folderNodes(); + for (FolderNode *f : folderNodes) list << f->filePath().toString() + QLatin1Char('/'); if (n->deploysFolder(Utils::commonPath(list))) addExistingFiles = false; @@ -341,7 +342,7 @@ QStringList QmakeProFileNode::targetApplications() const return apps; } -QVariant QmakeProFileNode::data(Utils::Id role) const +QVariant QmakeProFileNode::data(Id role) const { if (role == Android::Constants::AndroidAbis) return variableValue(Variable::AndroidAbis); @@ -400,7 +401,7 @@ QVariant QmakeProFileNode::data(Utils::Id role) const return {}; } -bool QmakeProFileNode::setData(Utils::Id role, const QVariant &value) const +bool QmakeProFileNode::setData(Id role, const QVariant &value) const { QmakeProFile *pro = proFile(); if (!pro) diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp index f2319d62dd8..0f77555f689 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp @@ -89,14 +89,13 @@ QmakeStaticData::QmakeStaticData() for (const FileTypeDataStorage &fileType : fileTypeDataStorage) { const QString desc = QmakeProjectManager::Tr::tr(fileType.typeName); const QString filter = QString::fromUtf8(fileType.addFileFilter); - fileTypeData.push_back(QmakeStaticData::FileTypeData(fileType.type, - desc, filter, - Utils::FileIconProvider::directoryIcon(QLatin1String(fileType.icon)))); + fileTypeData.push_back(QmakeStaticData::FileTypeData(fileType.type, desc, filter, + FileIconProvider::directoryIcon(QLatin1String(fileType.icon)))); } // Project icon - projectIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_QT); - productIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_PRODUCT); - groupIcon = Utils::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_GROUP); + projectIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_QT); + productIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_PRODUCT); + groupIcon = FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_GROUP); qAddPostRoutine(clearQmakeStaticData); } @@ -141,7 +140,7 @@ static void createTree(QmakeBuildSystem *buildSystem, for (int i = 0; i < fileTypes.size(); ++i) { FileType type = fileTypes.at(i).type; const SourceFiles &newFilePaths = Utils::filtered(pri->files(type), [&toExclude](const SourceFile &fn) { - return !Utils::contains(toExclude, [&fn](const Utils::FilePath &ex) { return fn.first.isChildOf(ex); }); + return !Utils::contains(toExclude, [&fn](const FilePath &ex) { return fn.first.isChildOf(ex); }); }); if (proFile) { for (const SourceFile &fp : newFilePaths) { diff --git a/src/plugins/qmakeprojectmanager/qmakeparser.cpp b/src/plugins/qmakeprojectmanager/qmakeparser.cpp index 1b53221afb0..66468403220 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparser.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparser.cpp @@ -19,7 +19,7 @@ QMakeParser::QMakeParser() : m_error(QLatin1String("^(.+?):(\\d+?):\\s(.+?)$")) OutputLineParser::Result QMakeParser::handleLine(const QString &line, OutputFormat type) { - if (type != Utils::StdErrFormat) + if (type != StdErrFormat) return Status::NotHandled; QString lne = rightTrimmed(line); QRegularExpressionMatch match = m_error.match(lne); diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index dbd1910bc21..f05144e2b60 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -89,9 +89,9 @@ class QmakeIncludedPriFile { public: ProFile *proFile; - Utils::FilePath name; + FilePath name; QmakePriFileEvalResult result; - QMap children; + QMap children; ~QmakeIncludedPriFile() { @@ -348,18 +348,17 @@ void QmakePriFile::update(const Internal::QmakePriFileEvalResult &result) files.clear(); const QSet exactFps = result.foundFilesExact.value(type); for (const FilePath &exactFp : exactFps) - files << qMakePair(exactFp, FileOrigin::ExactParse); + files.insert({exactFp, FileOrigin::ExactParse}); for (const FilePath &cumulativeFp : result.foundFilesCumulative.value(type)) { if (!exactFps.contains(cumulativeFp)) - files << qMakePair(cumulativeFp, FileOrigin::CumulativeParse); + files.insert({cumulativeFp, FileOrigin::CumulativeParse}); } } } void QmakePriFile::watchFolders(const QSet &folders) { - const QSet folderStrings = - Utils::transform(folders, &FilePath::toString); + const QSet folderStrings = Utils::transform(folders, &FilePath::toString); QSet toUnwatch = m_watchedFolders; toUnwatch.subtract(folderStrings); @@ -431,7 +430,7 @@ bool QmakePriFile::folderChanged(const QString &changedFolder, const QSet QmakePriFile::readProFile() &errorMsg) != TextFileFormat::ReadSuccess) { QmakeBuildSystem::proFileParseError(errorMsg, filePath()); - return qMakePair(includeFile, lines); + return {includeFile, lines}; } lines = contents.split('\n'); } @@ -769,7 +768,7 @@ QPair QmakePriFile::readProFile() filePath().toString(), 1); } - return qMakePair(includeFile, lines); + return {includeFile, lines}; } bool QmakePriFile::prepareForChange() @@ -1284,10 +1283,9 @@ void QmakeProFile::asyncUpdate() if (!includedInExactParse()) m_readerExact->setExact(false); QmakeEvalInput input = evalInput(); - QFuture future = Utils::runAsync(ProjectExplorerPlugin::sharedThreadPool(), - QThread::LowestPriority, - &QmakeProFile::asyncEvaluate, - this, input); + QFuture future = runAsync(ProjectExplorerPlugin::sharedThreadPool(), + QThread::LowestPriority, + &QmakeProFile::asyncEvaluate, this, input); m_parseFutureWatcher->setFuture(future); } @@ -1401,7 +1399,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input) FilePaths subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors); result->errors.append(errors); - foreach (const Utils::FilePath &subDirName, subDirs) { + foreach (const FilePath &subDirName, subDirs) { auto subDir = new QmakeIncludedPriFile; subDir->proFile = nullptr; subDir->name = subDirName; @@ -1420,7 +1418,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input) continue; // Don't attempt to map subdirs here QVector children = includeFiles.value(current->proFile); foreach (ProFile *child, children) { - const Utils::FilePath childName = Utils::FilePath::fromString(child->fileName()); + const FilePath childName = FilePath::fromString(child->fileName()); auto it = current->children.find(childName); if (it == current->children.end()) { auto childTree = new QmakeIncludedPriFile; @@ -1435,8 +1433,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input) } if (result->projectType == ProjectType::SubDirsTemplate) { - FilePaths subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr); - foreach (const Utils::FilePath &subDirName, subDirs) { + const FilePaths subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr); + for (const FilePath &subDirName : subDirs) { auto it = result->includedFiles.children.find(subDirName); if (it == result->includedFiles.children.end()) { auto subDir = new QmakeIncludedPriFile; @@ -1456,7 +1454,7 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input) continue; // Don't attempt to map subdirs here QVector children = includeFiles.value(current->proFile); foreach (ProFile *child, children) { - const Utils::FilePath childName = Utils::FilePath::fromString(child->fileName()); + const FilePath childName = FilePath::fromString(child->fileName()); auto it = current->children.find(childName); if (it == current->children.end()) { auto childTree = new QmakeIncludedPriFile; @@ -1583,8 +1581,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input) if (cumulativeBuildPassReader && cumulativeBuildPassReader != input.readerCumulative) delete cumulativeBuildPassReader; - QList> toCompare; - toCompare.append(qMakePair(nullptr, &result->includedFiles)); + QList> + toCompare{{nullptr, &result->includedFiles}}; while (!toCompare.isEmpty()) { QmakePriFile *pn = toCompare.first().first; QmakeIncludedPriFile *tree = toCompare.first().second; @@ -1608,8 +1606,8 @@ QmakeEvalResultPtr QmakeProFile::evaluate(const QmakeEvalInput &input) result->directChildren << qmakePriFileNode; qmakePriFileNode->setIncludedInExactParse(input.includedInExcactParse && result->state == QmakeEvalResult::EvalOk); - result->priFiles.append(qMakePair(qmakePriFileNode, priFile->result)); - toCompare.append(qMakePair(qmakePriFileNode, priFile)); + result->priFiles.push_back({qmakePriFileNode, priFile->result}); + toCompare.push_back({qmakePriFileNode, priFile}); } else { auto *qmakeProFileNode = new QmakeProFile(priFile->name); if (pn) @@ -1725,9 +1723,9 @@ void QmakeProFile::applyEvaluate(const QmakeEvalResultPtr &result) if (!result->directoriesWithWildcards.isEmpty()) { if (!m_wildcardWatcher) { - m_wildcardWatcher = std::make_unique(); + m_wildcardWatcher = std::make_unique(); QObject::connect( - m_wildcardWatcher.get(), &Utils::FileSystemWatcher::directoryChanged, + m_wildcardWatcher.get(), &FileSystemWatcher::directoryChanged, [this](QString path) { QStringList directoryContents = QDir(path).entryList(); if (m_wildcardDirectoryContents.value(path) != directoryContents) { @@ -1743,8 +1741,7 @@ void QmakeProFile::applyEvaluate(const QmakeEvalResultPtr &result) }); for (const QString &path : directoriesToAdd) m_wildcardDirectoryContents.insert(path, QDir(path).entryList()); - m_wildcardWatcher->addDirectories(directoriesToAdd, - Utils::FileSystemWatcher::WatchModifiedDate); + m_wildcardWatcher->addDirectories(directoriesToAdd, FileSystemWatcher::WatchModifiedDate); } if (m_wildcardWatcher) { if (result->directoriesWithWildcards.isEmpty()) { @@ -1980,8 +1977,8 @@ InstallsList QmakeProFile::installsList(const QtSupport::ProFileReader *reader, const QStringList installPrefixVars{"QT_INSTALL_PREFIX", "QT_INSTALL_EXAMPLES"}; QList> installPrefixValues; for (const QString &installPrefix : installPrefixVars) { - installPrefixValues << qMakePair(reader->propertyValue(installPrefix), - reader->propertyValue(installPrefix + "/dev")); + installPrefixValues.push_back({reader->propertyValue(installPrefix), + reader->propertyValue(installPrefix + "/dev")}); } foreach (const QString &item, itemList) { @@ -2057,7 +2054,7 @@ FilePaths QmakeProFile::generatedFiles(const FilePath &buildDir, location = location.pathAppended("ui_" + sourceFile.completeBaseName() + singleVariableValue(Variable::HeaderExtension)); - return { Utils::FilePath::fromString(QDir::cleanPath(location.toString())) }; + return { FilePath::fromString(QDir::cleanPath(location.toString())) }; } else if (sourceFileType == FileType::StateChart) { if (buildDir.isEmpty()) return { }; diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 0b62bc7dde0..43d36b2e225 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -81,7 +81,7 @@ static Q_LOGGING_CATEGORY(qmakeBuildSystemLog, "qtc.qmake.buildsystem", QtWarnin class QmakePriFileDocument : public Core::IDocument { public: - QmakePriFileDocument(QmakePriFile *qmakePriFile, const Utils::FilePath &filePath) : + QmakePriFileDocument(QmakePriFile *qmakePriFile, const FilePath &filePath) : IDocument(nullptr), m_priFile(qmakePriFile) { setId("Qmake.PriFile"); @@ -362,7 +362,7 @@ void QmakeBuildSystem::updateCppCodeModel() if (pro->variableValue(Variable::Config).contains(QLatin1String("qt"))) rpp.setQtVersion(kitInfo.projectPartQtVersion); else - rpp.setQtVersion(Utils::QtMajorVersion::None); + rpp.setQtVersion(QtMajorVersion::None); // Header paths ProjectExplorer::HeaderPaths headerPaths; @@ -381,7 +381,7 @@ void QmakeBuildSystem::updateCppCodeModel() QStringList fileList = pro->variableValue(Variable::ExactSource) + cumulativeSourceFiles; QList proGenerators = pro->extraCompilers(); foreach (ProjectExplorer::ExtraCompiler *ec, proGenerators) { - ec->forEachTarget([&](const Utils::FilePath &generatedFile) { + ec->forEachTarget([&](const FilePath &generatedFile) { fileList += generatedFile.toString(); }); } @@ -421,7 +421,7 @@ void QmakeBuildSystem::updateQmlJSCodeModel() const QStringList &cumulativeResources = file->variableValue(Variable::CumulativeResource); QString errorMessage; for (const QString &rc : exactResources) { - Utils::FilePath rcPath = Utils::FilePath::fromString(rc); + FilePath rcPath = FilePath::fromString(rc); projectInfo.activeResourceFiles.append(rcPath); projectInfo.allResourceFiles.append(rcPath); QString contents; @@ -430,7 +430,7 @@ void QmakeBuildSystem::updateQmlJSCodeModel() projectInfo.resourceFileContents[rcPath] = contents; } for (const QString &rc : cumulativeResources) { - Utils::FilePath rcPath = Utils::FilePath::fromString(rc); + FilePath rcPath = FilePath::fromString(rc); projectInfo.allResourceFiles.append(rcPath); QString contents; int id = m_qmakeVfs->idForFileName(rc, QMakeVfs::VfsCumulative); @@ -1358,8 +1358,8 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa } } -static Utils::FilePath getFullPathOf(const QmakeProFile *pro, Variable variable, - const BuildConfiguration *bc) +static FilePath getFullPathOf(const QmakeProFile *pro, Variable variable, + const BuildConfiguration *bc) { // Take last non-flag value, to cover e.g. '@echo $< && $$QMAKE_CC' or 'ccache gcc' const QStringList values = Utils::filtered(pro->variableValue(variable), @@ -1367,12 +1367,12 @@ static Utils::FilePath getFullPathOf(const QmakeProFile *pro, Variable variable, return !value.startsWith('-'); }); if (values.isEmpty()) - return Utils::FilePath(); + return {}; const QString exe = values.last(); - QTC_ASSERT(bc, return Utils::FilePath::fromUserInput(exe)); + QTC_ASSERT(bc, return FilePath::fromUserInput(exe)); QFileInfo fi(exe); if (fi.isAbsolute()) - return Utils::FilePath::fromUserInput(exe); + return FilePath::fromUserInput(exe); return bc->environment().searchInPath(exe); } @@ -1382,12 +1382,12 @@ void QmakeBuildSystem::testToolChain(ToolChain *tc, const FilePath &path) const if (!tc || path.isEmpty()) return; - const Utils::FilePath expected = tc->compilerCommand(); + const FilePath expected = tc->compilerCommand(); Environment env = buildConfiguration()->environment(); if (tc->matchesCompilerCommand(expected, env)) return; - const QPair pair = qMakePair(expected, path); + const QPair pair{expected, path}; if (m_toolChainWarnings.contains(pair)) return; // Suppress warnings on Apple machines where compilers in /usr/bin point into Xcode. @@ -1478,7 +1478,7 @@ FilePaths QmakeBuildSystem::filesGeneratedFrom(const FilePath &input) const return {}; } -QVariant QmakeBuildSystem::additionalData(Utils::Id id) const +QVariant QmakeBuildSystem::additionalData(Id id) const { if (id == "QmlDesignerImportPath") return m_rootProFile->variableValue(Variable::QmlDesignerImportPath); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 554c6266600..666ede66d65 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -39,14 +39,14 @@ using namespace Utils; namespace QmakeProjectManager::Internal { -const Utils::Id QT_IS_TEMPORARY("Qmake.TempQt"); +const Id QT_IS_TEMPORARY("Qmake.TempQt"); const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // ugly struct DirectoryData { QString makefile; - Utils::FilePath buildDirectory; - Utils::FilePath canonicalQmakeBinary; + FilePath buildDirectory; + FilePath canonicalQmakeBinary; QtProjectImporter::QtVersionData qtVersionData; QString parsedSpec; QtVersion::QmakeBuildConfigs buildConfig; diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index fb64084076c..8245a2e94d4 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -576,6 +576,8 @@ public: { menu()->clear(); + menu()->setEnabled(true); + const auto selection = selectionContext(); if (!selection.isValid()) return; @@ -585,11 +587,19 @@ public: return; ModelNode currentNode = selection.currentSingleSelectedNode(); + + if (!currentNode.isValid()) + return; + QmlObjectNode currentObjectNode(currentNode); QStringList signalsList = getSignalsList(currentNode); QList slotsList = getSlotsLists(currentNode); - currentNode.validId(); + + if (!currentNode.hasId()) { + menu()->setEnabled(false); + return; + } for (const ModelNode &connectionNode : currentObjectNode.getAllConnections()) { for (const AbstractProperty &property : connectionNode.properties()) { diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index eb994f6f9ad..861397227e8 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -1631,6 +1631,7 @@ void addMouseAreaFill(const SelectionContext &selectionContext) QmlDesigner::ModelNode mouseAreaNode = selectionContext.view()->createModelNode("QtQuick.MouseArea", itemMetaInfo.majorVersion(), itemMetaInfo.minorVersion()); + mouseAreaNode.validId(); modelNode.defaultNodeListProperty().reparentHere(mouseAreaNode); QmlItemNode mouseAreaItemNode(mouseAreaNode); diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp index 327bd041324..c10799b6c53 100644 --- a/src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp +++ b/src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp @@ -315,6 +315,8 @@ void Edit3DWidget::dragEnterEvent(QDragEnterEvent *dragEnterEvent) void Edit3DWidget::dropEvent(QDropEvent *dropEvent) { + const QPointF pos = m_canvas->mapFrom(this, dropEvent->position()); + // handle dropping materials if (dropEvent->mimeData()->hasFormat(Constants::MIME_TYPE_MATERIAL)) { QByteArray data = dropEvent->mimeData()->data(Constants::MIME_TYPE_MATERIAL); @@ -323,13 +325,13 @@ void Edit3DWidget::dropEvent(QDropEvent *dropEvent) stream >> internalId; if (ModelNode matNode = m_view->modelNodeForInternalId(internalId)) - m_view->dropMaterial(matNode, dropEvent->position()); + m_view->dropMaterial(matNode, pos); return; } // handle dropping bundle materials if (dropEvent->mimeData()->hasFormat(Constants::MIME_TYPE_BUNDLE_MATERIAL)) { - m_view->dropBundleMaterial(dropEvent->position()); + m_view->dropBundleMaterial(pos); return; } diff --git a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsermodel.cpp b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsermodel.cpp index 1f1dff4eef8..c075a582e41 100644 --- a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsermodel.cpp +++ b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsermodel.cpp @@ -7,7 +7,8 @@ #include #include #include -#include "variantproperty.h" +#include +#include #include "utils/qtcassert.h" namespace QmlDesigner { @@ -326,40 +327,84 @@ void MaterialBrowserModel::duplicateMaterial(int idx) void MaterialBrowserModel::copyMaterialProperties(int idx, const QString §ion) { - ModelNode mat = m_materialList.at(idx); - QString matType = QString::fromLatin1(mat.type()); + m_copiedMaterial = m_materialList.at(idx); + + QTC_ASSERT(m_copiedMaterial.isValid(), return); + + QString matType = QString::fromLatin1(m_copiedMaterial.type()); if (matType.startsWith("QtQuick3D.")) matType.remove("QtQuick3D."); setCopiedMaterialType(matType); m_allPropsCopied = section == "All"; + QmlObjectNode mat(m_copiedMaterial); + + QSet validProps; + PropertyNameList copiedProps; + + // Base state properties are always valid + const auto baseProps = m_copiedMaterial.propertyNames(); + for (const auto &baseProp : baseProps) + validProps.insert(baseProp); + + if (!mat.isInBaseState()) { + QmlPropertyChanges changes = mat.propertyChangeForCurrentState(); + if (changes.isValid()) { + const QList changedProps = changes.targetProperties(); + for (const auto &changedProp : changedProps) + validProps.insert(changedProp.name()); + } + } + + if (mat.timelineIsActive()) { + const QList keyframeGroups + = mat.currentTimeline().keyframeGroupsForTarget(m_copiedMaterial); + for (const auto &kfg : keyframeGroups) + validProps.insert(kfg.propertyName()); + } if (m_allPropsCopied || m_propertyGroupsObj.empty()) { - m_copiedMaterialProps = mat.properties(); + copiedProps = validProps.values(); } else { QJsonObject propsSpecObj = m_propertyGroupsObj.value(m_copiedMaterialType).toObject(); if (propsSpecObj.contains(section)) { // should always be true - m_copiedMaterialProps.clear(); const QJsonArray propNames = propsSpecObj.value(section).toArray(); // auto == QJsonValueConstRef after 04dc959d49e5e3 / Qt 6.4, QJsonValueRef before for (const auto &propName : propNames) - m_copiedMaterialProps.append(mat.property(propName.toString().toLatin1())); + copiedProps.append(propName.toString().toLatin1()); if (section == "Base") { // add QtQuick3D.Material base props as well QJsonObject propsMatObj = m_propertyGroupsObj.value("Material").toObject(); const QJsonArray propNames = propsMatObj.value("Base").toArray(); // auto == QJsonValueConstRef after 04dc959d49e5e3 / Qt 6.4, QJsonValueRef before for (const auto &propName : propNames) - m_copiedMaterialProps.append(mat.property(propName.toString().toLatin1())); + copiedProps.append(propName.toString().toLatin1()); } } } + + m_copiedMaterialProps.clear(); + for (const auto &propName : copiedProps) { + PropertyCopyData data; + data.name = propName; + data.isValid = m_allPropsCopied || validProps.contains(propName); + data.isBinding = mat.hasBindingProperty(propName); + if (data.isValid) { + if (data.isBinding) + data.value = mat.expression(propName); + else + data.value = mat.modelValue(propName); + } + m_copiedMaterialProps.append(data); + } } void MaterialBrowserModel::pasteMaterialProperties(int idx) { - emit pasteMaterialPropertiesTriggered(m_materialList.at(idx), m_copiedMaterialProps, m_allPropsCopied); + ModelNode targetMat = m_materialList.at(idx); + if (targetMat.isValid() && m_copiedMaterial.isValid() && targetMat != m_copiedMaterial) + emit pasteMaterialPropertiesTriggered(targetMat, m_copiedMaterialProps, m_allPropsCopied); } void MaterialBrowserModel::deleteMaterial(int idx) @@ -396,4 +441,11 @@ void MaterialBrowserModel::openMaterialEditor() QmlDesignerPlugin::instance()->mainWidget()->showDockWidget("MaterialEditor", true); } +// This is provided as invokable instead of property, as it is difficult to know when ModelNode +// becomes invalid. Much simpler to evaluate this on demand. +bool MaterialBrowserModel::isCopiedMaterialValid() const +{ + return m_copiedMaterial.isValid(); +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsermodel.h b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsermodel.h index 64b58c9be92..8635c1f1b02 100644 --- a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsermodel.h +++ b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsermodel.h @@ -70,6 +70,15 @@ public: Q_INVOKABLE void addNewMaterial(); Q_INVOKABLE void applyToSelected(qint64 internalId, bool add = false); Q_INVOKABLE void openMaterialEditor(); + Q_INVOKABLE bool isCopiedMaterialValid() const; + + struct PropertyCopyData + { + PropertyName name; + QVariant value; + bool isBinding = false; + bool isValid = false; + }; signals: void isEmptyChanged(); @@ -83,9 +92,10 @@ signals: void applyToSelectedTriggered(const QmlDesigner::ModelNode &material, bool add = false); void addNewMaterialTriggered(); void duplicateMaterialTriggered(const QmlDesigner::ModelNode &material); - void pasteMaterialPropertiesTriggered(const QmlDesigner::ModelNode &material, - const QList &props, - bool all); + void pasteMaterialPropertiesTriggered( + const QmlDesigner::ModelNode &material, + const QList &props, + bool all); private: bool isMaterialVisible(int idx) const; @@ -96,7 +106,8 @@ private: QStringList m_defaultMaterialSections; QStringList m_principledMaterialSections; QStringList m_customMaterialSections; - QList m_copiedMaterialProps; + ModelNode m_copiedMaterial; + QList m_copiedMaterialProps; QHash m_materialIndexHash; // internalId -> index QJsonObject m_propertyGroupsObj; diff --git a/src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp b/src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp index 791b42a059d..f6f9bb498d5 100644 --- a/src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp +++ b/src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp @@ -72,29 +72,43 @@ WidgetInfo MaterialBrowserView::widgetInfo() }); connect(matBrowserModel, &MaterialBrowserModel::pasteMaterialPropertiesTriggered, this, - [&] (const ModelNode &material, const QList &props, bool all) { + [&] (const ModelNode &material, + const QList &propDatas, + bool all) { QmlObjectNode mat(material); executeInTransaction(__FUNCTION__, [&] { if (all) { // all material properties copied // remove current properties - const PropertyNameList propNames = material.propertyNames(); - for (const PropertyName &propName : propNames) { + PropertyNameList propNames; + if (mat.isInBaseState()) { + propNames = material.propertyNames(); + } else { + QmlPropertyChanges changes = mat.propertyChangeForCurrentState(); + if (changes.isValid()) { + const QList changedProps = changes.targetProperties(); + for (const auto &changedProp : changedProps) + propNames.append(changedProp.name()); + } + } + for (const PropertyName &propName : qAsConst(propNames)) { if (propName != "objectName") mat.removeProperty(propName); } } // apply pasted properties - for (const AbstractProperty &prop : props) { - if (prop.name() == "objectName") + for (const QmlDesigner::MaterialBrowserModel::PropertyCopyData &propData : propDatas) { + if (propData.name == "objectName") continue; - if (prop.isVariantProperty()) - mat.setVariantProperty(prop.name(), prop.toVariantProperty().value()); - else if (prop.isBindingProperty()) - mat.setBindingProperty(prop.name(), prop.toBindingProperty().expression()); - else if (!all) - mat.removeProperty(prop.name()); + if (propData.isValid) { + if (propData.isBinding) + mat.setBindingProperty(propData.name, propData.value.toString()); + else + mat.setVariantProperty(propData.name, propData.value); + } else { + mat.removeProperty(propData.name); + } } }); }); @@ -164,7 +178,8 @@ void MaterialBrowserView::applyBundleMaterialToDropTarget(const ModelNode &bundl newMatNode = bundleMat; } - if (m_bundleMaterialDropTarget.isValid()) { + if (m_bundleMaterialDropTarget.isValid() + && m_bundleMaterialDropTarget.metaInfo().isQtQuick3DModel()) { QmlObjectNode qmlObjNode(m_bundleMaterialDropTarget); if (m_bundleMaterialAddToSelected) { // TODO: unify this logic as it exist elsewhere also @@ -211,12 +226,12 @@ void MaterialBrowserView::modelAttached(Model *model) rootModelNode().metaInfo().isQtQuick3DMaterial()); m_hasQuick3DImport = model->hasImport("QtQuick3D"); - loadPropertyGroups(); // Project load is already very busy and may even trigger puppet reset, so let's wait a moment // before refreshing the model QTimer::singleShot(1000, this, [this]() { refreshModel(true); + loadPropertyGroups(); // Needs the delay because it uses metaInfo }); } @@ -429,7 +444,6 @@ void MaterialBrowserView::customNotification(const AbstractView *view, } else if (identifier == "drop_bundle_material") { m_bundleMaterialDropTarget = nodeList.first(); - ModelNode defaultMat = getBundleMaterialDefaultInstance(m_draggedBundleMaterial->type()); if (defaultMat.isValid()) applyBundleMaterialToDropTarget(defaultMat); diff --git a/src/plugins/qmldesigner/components/materialbrowser/materialbrowserwidget.cpp b/src/plugins/qmldesigner/components/materialbrowser/materialbrowserwidget.cpp index 9df4a39b6e7..c89ec4581fa 100644 --- a/src/plugins/qmldesigner/components/materialbrowser/materialbrowserwidget.cpp +++ b/src/plugins/qmldesigner/components/materialbrowser/materialbrowserwidget.cpp @@ -110,15 +110,21 @@ bool MaterialBrowserWidget::eventFilter(QObject *obj, QEvent *event) } else if (m_bundleMaterialToDrag != nullptr) { QMouseEvent *me = static_cast(event); if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 20) { + QByteArray data; QMimeData *mimeData = new QMimeData; - mimeData->setData(Constants::MIME_TYPE_BUNDLE_MATERIAL, {}); + QDataStream stream(&data, QIODevice::WriteOnly); + stream << m_bundleMaterialToDrag->type(); + mimeData->setData(Constants::MIME_TYPE_BUNDLE_MATERIAL, data); mimeData->removeFormat("text/plain"); - model->startDrag(mimeData, m_bundleMaterialToDrag->icon().toLocalFile()); emit bundleMaterialDragStarted(m_bundleMaterialToDrag); + model->startDrag(mimeData, m_bundleMaterialToDrag->icon().toLocalFile()); m_bundleMaterialToDrag = {}; } } + } else if (event->type() == QMouseEvent::MouseButtonRelease) { + m_materialToDrag = {}; + m_bundleMaterialToDrag = {}; } return QObject::eventFilter(obj, event); diff --git a/src/plugins/qmldesigner/components/navigator/choosefrompropertylistdialog.cpp b/src/plugins/qmldesigner/components/navigator/choosefrompropertylistdialog.cpp index b07a5c9178e..7bd8fab01cb 100644 --- a/src/plugins/qmldesigner/components/navigator/choosefrompropertylistdialog.cpp +++ b/src/plugins/qmldesigner/components/navigator/choosefrompropertylistdialog.cpp @@ -36,6 +36,8 @@ ChooseFromPropertyListFilter::ChooseFromPropertyListFilter(const NodeMetaInfo &i // -> Attractor3D // Material // -> Model + // BundleMaterial + // -> Model if (insertInfo.isQtQuick3DTexture()) { if (parentInfo.isQtQuick3DDefaultMaterial() || parentInfo.isQtQuick3DPrincipledMaterial()) { @@ -83,6 +85,9 @@ ChooseFromPropertyListFilter::ChooseFromPropertyListFilter(const NodeMetaInfo &i } else if (insertInfo.isQtQuick3DMaterial()) { if (parentInfo.isQtQuick3DParticles3DModel()) propertyList.append("materials"); +// TODO merge conflict between Change-Id: If3c58f82797beabe76baf99ea2dddc59032729df and Change-Id: Iff2dea66e253b412105427134bd49cb16ed76193 +// } else if (insertInfo.typeName().startsWith("ComponentBundles.MaterialBundle")) { +// if (parentInfo.isSubclassOf("QtQuick3D.Model")) } } diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index 0f4c0581009..449405fc0c8 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -443,6 +443,7 @@ QStringList NavigatorTreeModel::mimeTypes() const const static QStringList types({Constants::MIME_TYPE_MODELNODE_LIST, Constants::MIME_TYPE_ITEM_LIBRARY_INFO, Constants::MIME_TYPE_MATERIAL, + Constants::MIME_TYPE_BUNDLE_MATERIAL, Constants::MIME_TYPE_ASSETS}); return types; @@ -540,6 +541,10 @@ bool NavigatorTreeModel::dropMimeData(const QMimeData *mimeData, handleItemLibraryItemDrop(mimeData, rowNumber, dropModelIndex); } else if (mimeData->hasFormat(Constants::MIME_TYPE_MATERIAL)) { handleMaterialDrop(mimeData, rowNumber, dropModelIndex); + } else if (mimeData->hasFormat(Constants::MIME_TYPE_BUNDLE_MATERIAL)) { + ModelNode targetNode(modelNodeForIndex(dropModelIndex)); + if (targetNode.isValid()) + m_view->emitCustomNotification("drop_bundle_material", {targetNode}); // To MaterialBrowserView } else if (mimeData->hasFormat(Constants::MIME_TYPE_ASSETS)) { const QStringList assetsPaths = QString::fromUtf8(mimeData->data(Constants::MIME_TYPE_ASSETS)).split(','); NodeAbstractProperty targetProperty; diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp index e59960f3c1f..143ac28eb45 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp @@ -260,6 +260,14 @@ void NavigatorView::dragStarted(QMimeData *mimeData) m_widget->setDragType(matNode.metaInfo().typeName()); m_widget->update(); + } else if (mimeData->hasFormat(Constants::MIME_TYPE_BUNDLE_MATERIAL)) { + QByteArray data = mimeData->data(Constants::MIME_TYPE_BUNDLE_MATERIAL); + QDataStream stream(data); + TypeName bundleMatType; + stream >> bundleMatType; + + m_widget->setDragType(bundleMatType); + m_widget->update(); } } diff --git a/src/plugins/qmldesigner/components/propertyeditor/dynamicpropertiesproxymodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/dynamicpropertiesproxymodel.cpp index acc6744e2ce..f0a27f5a980 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/dynamicpropertiesproxymodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/dynamicpropertiesproxymodel.cpp @@ -335,7 +335,8 @@ void DynamicPropertyRow::commitValue(const QVariant &value) QByteArrayLiteral("DynamicPropertiesModel::commitValue")); try { QmlObjectNode objectNode = variantProperty.parentQmlObjectNode(); - if (view->currentState().isBaseState() && !objectNode.timelineIsActive()) { + if (view->currentState().isBaseState() + && !(objectNode.timelineIsActive() && objectNode.currentTimeline().isRecording())) { if (variantProperty.value() != value) variantProperty.setDynamicTypeNameAndValue(variantProperty.dynamicTypeName(), value); } else { diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp index 84e7b8284e0..15b35a5adb0 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp @@ -446,7 +446,7 @@ QmlDesigner::AbstractView *GradientModel::view() const void GradientModel::resetPuppet() { - QTimer::singleShot(1000, [this]() { view()->resetPuppet(); }); + QTimer::singleShot(1000, view(), &QmlDesigner::AbstractView::resetPuppet); } QmlDesigner::ModelNode GradientModel::createGradientNode() diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 6c41274a51a..a8625ca784c 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -704,7 +704,7 @@ QString PropertyEditorQmlBackend::templateGeneration(const NodeMetaInfo &metaTyp QString qmlInnerTemplate = ""; qmlInnerTemplate += "Section {\n"; - qmlInnerTemplate += "caption: \""+ QObject::tr("User Added Properties") + "\"\n"; + qmlInnerTemplate += "caption: \"" + QObject::tr("Exposed Custom Properties") + "\"\n"; qmlInnerTemplate += anchorLeftRight; qmlInnerTemplate += "leftPadding: 0\n"; qmlInnerTemplate += "rightPadding: 0\n"; diff --git a/src/plugins/qmldesigner/components/stateseditornew/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditornew/stateseditormodel.cpp index 826161fc0a2..158ca4af0fa 100644 --- a/src/plugins/qmldesigner/components/stateseditornew/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditornew/stateseditormodel.cpp @@ -95,6 +95,7 @@ void StatesEditorModel::reset() QAbstractListModel::endResetModel(); evaluateExtend(); + emit baseStateChanged(); } QVariant StatesEditorModel::data(const QModelIndex &index, int role) const diff --git a/src/plugins/qmldesigner/components/stateseditornew/stateseditorview.h b/src/plugins/qmldesigner/components/stateseditornew/stateseditorview.h index e453ef212a0..8442917c544 100644 --- a/src/plugins/qmldesigner/components/stateseditornew/stateseditorview.h +++ b/src/plugins/qmldesigner/components/stateseditornew/stateseditorview.h @@ -122,7 +122,6 @@ public slots: void removeState(int nodeId); private: - StatesEditorWidget *statesEditorWidget() const; void resetModel(); void resetPropertyChangesModels(); void resetExtend(); diff --git a/src/plugins/qmldesigner/designercore/model/model.cpp b/src/plugins/qmldesigner/designercore/model/model.cpp index 9875d06f12b..927d66e5140 100644 --- a/src/plugins/qmldesigner/designercore/model/model.cpp +++ b/src/plugins/qmldesigner/designercore/model/model.cpp @@ -216,7 +216,7 @@ void ModelPrivate::changeNodeType(const InternalNodePointer &node, const TypeNam try { notifyNodeTypeChanged(node, typeName, majorVersion, minorVersion); - } catch (const RewritingException &e) { + } catch (const RewritingException &) { } } @@ -348,7 +348,7 @@ void ModelPrivate::changeNodeId(const InternalNodePointer &node, const QString & try { notifyNodeIdChanged(node, id, oldId); - } catch (const RewritingException &e) { + } catch (const RewritingException &) { } } diff --git a/src/plugins/qmldesigner/designersettings.cpp b/src/plugins/qmldesigner/designersettings.cpp index 874adf8e8fe..23df15e0470 100644 --- a/src/plugins/qmldesigner/designersettings.cpp +++ b/src/plugins/qmldesigner/designersettings.cpp @@ -35,7 +35,7 @@ void DesignerSettings::insert(const QHash &settingsHash) QVariant DesignerSettings::value(const QByteArray &key, const QVariant &defaultValue) const { QMutexLocker locker(&m_mutex); - return m_cache.value(key); + return m_cache.value(key, defaultValue); } void DesignerSettings::restoreValue(QSettings *settings, const QByteArray &key, const QVariant &defaultValue) diff --git a/src/plugins/qmlprofiler/debugmessagesmodel.cpp b/src/plugins/qmlprofiler/debugmessagesmodel.cpp index 60234005917..2beebbeb125 100644 --- a/src/plugins/qmlprofiler/debugmessagesmodel.cpp +++ b/src/plugins/qmlprofiler/debugmessagesmodel.cpp @@ -11,7 +11,7 @@ namespace Internal { DebugMessagesModel::DebugMessagesModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent) : - QmlProfilerTimelineModel(manager, DebugMessage, MaximumRangeType, ProfileDebugMessages, parent), + QmlProfilerTimelineModel(manager, DebugMessage, UndefinedRangeType, ProfileDebugMessages, parent), m_maximumMsgType(-1) { } diff --git a/src/plugins/qmlprofiler/inputeventsmodel.cpp b/src/plugins/qmlprofiler/inputeventsmodel.cpp index 267e6c2d98d..00c9cbb36a8 100644 --- a/src/plugins/qmlprofiler/inputeventsmodel.cpp +++ b/src/plugins/qmlprofiler/inputeventsmodel.cpp @@ -17,7 +17,7 @@ namespace Internal { InputEventsModel::InputEventsModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent) : - QmlProfilerTimelineModel(manager, Event, MaximumRangeType, ProfileInputEvents, parent), + QmlProfilerTimelineModel(manager, Event, UndefinedRangeType, ProfileInputEvents, parent), m_keyTypeId(-1), m_mouseTypeId(-1) { } @@ -128,6 +128,8 @@ int InputEventsModel::collapsedRow(int index) const void InputEventsModel::loadEvent(const QmlEvent &event, const QmlEventType &type) { + if (type.detailType() >= MaximumInputEventType) + return; m_data.insert(insert(event.timestamp(), 0, type.detailType()), Item(static_cast(event.number(0)), event.number(1), event.number(2))); diff --git a/src/plugins/qmlprofiler/inputeventsmodel.h b/src/plugins/qmlprofiler/inputeventsmodel.h index 5a6342a2050..2257c44d803 100644 --- a/src/plugins/qmlprofiler/inputeventsmodel.h +++ b/src/plugins/qmlprofiler/inputeventsmodel.h @@ -14,7 +14,7 @@ class InputEventsModel : public QmlProfilerTimelineModel public: struct Item { - Item(InputEventType type = MaximumInputEventType, int a = 0, int b = 0); + Item(InputEventType type = UndefinedInputEventType, int a = 0, int b = 0); InputEventType type; int a; int b; diff --git a/src/plugins/qmlprofiler/memoryusagemodel.cpp b/src/plugins/qmlprofiler/memoryusagemodel.cpp index a713626c5d1..8beb399e74e 100644 --- a/src/plugins/qmlprofiler/memoryusagemodel.cpp +++ b/src/plugins/qmlprofiler/memoryusagemodel.cpp @@ -13,7 +13,7 @@ namespace Internal { MemoryUsageModel::MemoryUsageModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent) : - QmlProfilerTimelineModel(manager, MemoryAllocation, MaximumRangeType, ProfileMemory, parent) + QmlProfilerTimelineModel(manager, MemoryAllocation, UndefinedRangeType, ProfileMemory, parent) { // Register additional features. The base class already registers the main feature. // Don't register initializer, finalizer, or clearer as the base class has done so already. @@ -121,7 +121,7 @@ QVariantMap MemoryUsageModel::details(int index) const void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type) { if (type.message() != MemoryAllocation) { - if (type.rangeType() != MaximumRangeType) { + if (type.rangeType() != UndefinedRangeType) { m_continuation = ContinueNothing; if (event.rangeStage() == RangeStart) m_rangeStack.push(RangeStackFrame(event.typeIndex(), event.timestamp())); diff --git a/src/plugins/qmlprofiler/pixmapcachemodel.cpp b/src/plugins/qmlprofiler/pixmapcachemodel.cpp index 532ec9b2992..24ecf32f289 100644 --- a/src/plugins/qmlprofiler/pixmapcachemodel.cpp +++ b/src/plugins/qmlprofiler/pixmapcachemodel.cpp @@ -13,7 +13,7 @@ namespace Internal { PixmapCacheModel::PixmapCacheModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent) : - QmlProfilerTimelineModel(manager, PixmapCacheEvent, MaximumRangeType, ProfilePixmapCache, + QmlProfilerTimelineModel(manager, PixmapCacheEvent, UndefinedRangeType, ProfilePixmapCache, parent) { } diff --git a/src/plugins/qmlprofiler/qmleventtype.cpp b/src/plugins/qmlprofiler/qmleventtype.cpp index 25547dd8fa0..535f240efb0 100644 --- a/src/plugins/qmlprofiler/qmleventtype.cpp +++ b/src/plugins/qmlprofiler/qmleventtype.cpp @@ -17,7 +17,7 @@ static ProfileFeature qmlFeatureFromType(Message message, RangeType rangeType, i case AnimationFrame: return ProfileAnimations; default: - return MaximumProfileFeature; + return UndefinedProfileFeature; } } case PixmapCacheEvent: @@ -29,7 +29,11 @@ static ProfileFeature qmlFeatureFromType(Message message, RangeType rangeType, i case DebugMessage: return ProfileDebugMessages; case Quick3DEvent: - return ProfileQuick3D; + // Check if it's actually Quick3DEvent since old traces used MaximumMessage + // (whose value is now Quick3DEvent value) as undefined value + if (rangeType == UndefinedRangeType) + return ProfileQuick3D; + return featureFromRangeType(rangeType); default: return featureFromRangeType(rangeType); } @@ -46,6 +50,9 @@ QDataStream &operator>>(QDataStream &stream, QmlEventType &type) type.m_message = static_cast(message); type.m_rangeType = static_cast(rangeType); type.setFeature(qmlFeatureFromType(type.m_message, type.m_rangeType, type.m_detailType)); + // Update message if qmlFeatureFromType determined it is not Quick3D event + if (type.m_message == Quick3DEvent && type.feature() != ProfileQuick3D) + type.m_message = UndefinedMessage; return stream; } diff --git a/src/plugins/qmlprofiler/qmleventtype.h b/src/plugins/qmlprofiler/qmleventtype.h index e2d91c14f31..74aa91ba253 100644 --- a/src/plugins/qmlprofiler/qmleventtype.h +++ b/src/plugins/qmlprofiler/qmleventtype.h @@ -17,7 +17,7 @@ class QmlEventType : public Timeline::TraceEventType { public: static const qint32 staticClassId = 0x716d6c74; // 'qmlt'; - QmlEventType(Message message = MaximumMessage, RangeType rangeType = MaximumRangeType, + QmlEventType(Message message = UndefinedMessage, RangeType rangeType = UndefinedRangeType, int detailType = -1, const QmlEventLocation &location = QmlEventLocation(), const QString &data = QString(), const QString &displayName = QString()); diff --git a/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp index 8c43af70cda..f6bd6701e59 100644 --- a/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp @@ -21,7 +21,7 @@ namespace Internal { QmlProfilerAnimationsModel::QmlProfilerAnimationsModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent) : - QmlProfilerTimelineModel(manager, Event, MaximumRangeType, ProfileAnimations, parent) + QmlProfilerTimelineModel(manager, Event, UndefinedRangeType, ProfileAnimations, parent) { m_minNextStartTimes[0] = m_minNextStartTimes[1] = 0; } diff --git a/src/plugins/qmlprofiler/qmlprofilereventtypes.h b/src/plugins/qmlprofiler/qmlprofilereventtypes.h index db19aaf05d5..8ad7e2ab270 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventtypes.h +++ b/src/plugins/qmlprofiler/qmlprofilereventtypes.h @@ -8,7 +8,8 @@ namespace QmlProfiler { enum Message { - Event, + UndefinedMessage = 0xff, + Event = 0, RangeStart, RangeData, RangeLocation, @@ -24,7 +25,8 @@ enum Message { }; enum EventType { - FramePaint, // unused + UndefinedEventType = 0xff, + FramePaint = 0, // unused Mouse, Key, AnimationFrame, // new Qt5 paint events @@ -35,7 +37,8 @@ enum EventType { }; enum Quick3DEventType { - Quick3DRenderFrame, + UndefinedQuick3DEventType = 0xff, + Quick3DRenderFrame = 0, Quick3DSynchronizeFrame, Quick3DPrepareFrame, Quick3DMeshLoad, @@ -50,7 +53,8 @@ enum Quick3DEventType { }; enum RangeType { - Painting, // old Qt4 paint events + UndefinedRangeType = 0xff, + Painting = 0, // old Qt4 paint events Compiling, Creating, Binding, @@ -61,7 +65,8 @@ enum RangeType { }; enum BindingType { - QmlBinding, + UndefinedBindingType = 0xff, + QmlBinding = 0, V8Binding, OptimizedBinding, QPainterEvent, @@ -70,7 +75,8 @@ enum BindingType { }; enum PixmapEventType { - PixmapSizeKnown, + UndefinedPixmapEventType = 0xff, + PixmapSizeKnown = 0, PixmapReferenceCountChanged, PixmapCacheCountChanged, PixmapLoadingStarted, @@ -81,7 +87,8 @@ enum PixmapEventType { }; enum InputEventType { - InputKeyPress, + UndefinedInputEventType = 0xff, + InputKeyPress = 0, InputKeyRelease, InputKeyUnknown, @@ -96,7 +103,8 @@ enum InputEventType { }; enum SceneGraphFrameType { - SceneGraphRendererFrame, // Render Thread + UndefinedSceheGraphFrameType = 0xff, + SceneGraphRendererFrame = 0, // Render Thread SceneGraphAdaptationLayerFrame, // Render Thread SceneGraphContextFrame, // Render Thread SceneGraphRenderLoopFrame, // Render Thread @@ -111,7 +119,8 @@ enum SceneGraphFrameType { }; enum MemoryType { - HeapPage, + UndefinedMemoryType = 0xff, + HeapPage = 0, LargeItem, SmallItem, @@ -119,14 +128,16 @@ enum MemoryType { }; enum AnimationThread { - GuiThread, + UndefinedAnimationThread = 0xff, + GuiThread = 0, RenderThread, MaximumAnimationThread }; enum ProfileFeature { - ProfileJavaScript, + UndefinedProfileFeature = 0xff, + ProfileJavaScript = 0, ProfileMemory, ProfilePixmapCache, ProfileSceneGraph, @@ -159,7 +170,7 @@ inline ProfileFeature featureFromRangeType(RangeType range) case Javascript: return ProfileJavaScript; default: - return MaximumProfileFeature; + return UndefinedProfileFeature; } } diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp index 695685a0660..90619b61258 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp @@ -377,7 +377,7 @@ QmlProfilerModelManager::rangeFilter(qint64 rangeStart, qint64 rangeEnd) const // Double-check if rangeStart has been crossed. Some versions of Qt send dirty data. qint64 adjustedTimestamp = event.timestamp(); if (event.timestamp() < rangeStart && !crossedRangeStart) { - if (type.rangeType() != MaximumRangeType) { + if (type.rangeType() != UndefinedRangeType) { if (event.rangeStage() == RangeStart) stack.push(event); else if (event.rangeStage() == RangeEnd && !stack.isEmpty()) @@ -398,7 +398,7 @@ QmlProfilerModelManager::rangeFilter(qint64 rangeStart, qint64 rangeEnd) const crossedRangeStart = true; } if (event.timestamp() > rangeEnd) { - if (type.rangeType() != MaximumRangeType) { + if (type.rangeType() != UndefinedRangeType) { if (event.rangeStage() == RangeEnd) { if (stack.isEmpty()) { QmlEvent endEvent(event); diff --git a/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp index ff4dfb8a7ac..98088b581a2 100644 --- a/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp @@ -23,7 +23,7 @@ namespace Internal { QmlProfilerRangeModel::QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range, Timeline::TimelineModelAggregator *parent) : - QmlProfilerTimelineModel(manager, MaximumMessage, range, featureFromRangeType(range), parent) + QmlProfilerTimelineModel(manager, UndefinedMessage, range, featureFromRangeType(range), parent) { m_expandedRowTypes << -1; } diff --git a/src/plugins/qmlprofiler/qmlprofilertraceclient.cpp b/src/plugins/qmlprofiler/qmlprofilertraceclient.cpp index d5de095f96b..d6560533ba2 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceclient.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceclient.cpp @@ -148,7 +148,7 @@ void QmlProfilerTraceClientPrivate::processCurrentEvent() // all ranges are perfectly nested. This is why we can defer the type resolution until either // the range ends or a child range starts. With only the information in RangeStart we wouldn't // be able to uniquely identify the event type. - Message rangeStage = currentEvent.type.rangeType() == MaximumRangeType ? + Message rangeStage = currentEvent.type.rangeType() == UndefinedRangeType ? currentEvent.type.message() : currentEvent.event.rangeStage(); switch (rangeStage) { case RangeStart: @@ -311,7 +311,7 @@ void QmlProfilerTraceClient::setRequestedFeatures(quint64 features) d->currentEvent.event.setTimestamp(context.timestamp > 0 ? context.timestamp : 0); d->currentEvent.event.setTypeIndex(-1); d->currentEvent.event.setString(text); - d->currentEvent.type = QmlEventType(DebugMessage, MaximumRangeType, type, + d->currentEvent.type = QmlEventType(DebugMessage, UndefinedRangeType, type, QmlEventLocation(context.file, context.line, 1)); d->currentEvent.serverTypeId = 0; d->processCurrentEvent(); @@ -328,6 +328,8 @@ void QmlProfilerTraceClient::setFlushInterval(quint32 flushInterval) bool QmlProfilerTraceClientPrivate::updateFeatures(quint8 feature) { + if (feature == UndefinedProfileFeature) + return true; quint64 flag = 1ULL << feature; if (!(requestedFeatures & flag)) return false; diff --git a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp index 629d692124e..4b1e6badf8d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp @@ -59,7 +59,7 @@ Q_STATIC_ASSERT(sizeof(MESSAGE_STRINGS) == MaximumMessage * sizeof(const char *) static QPair qmlTypeAsEnum(const QString &typeString) { - QPair ret(MaximumMessage, MaximumRangeType); + QPair ret(UndefinedMessage, UndefinedRangeType); for (int i = 0; i < MaximumMessage; ++i) { if (typeString == _(MESSAGE_STRINGS[i])) { @@ -75,7 +75,7 @@ static QPair qmlTypeAsEnum(const QString &typeString) } } - if (ret.first == MaximumMessage && ret.second == MaximumRangeType) { + if (ret.first == UndefinedMessage && ret.second == UndefinedRangeType) { bool isNumber = false; int type = typeString.toUInt(&isNumber); if (isNumber && type < MaximumRangeType) @@ -288,7 +288,7 @@ void QmlProfilerTraceFile::loadEventTypes(QXmlStreamReader &stream) int typeIndex = -1; - QPair messageAndRange(MaximumMessage, MaximumRangeType); + QPair messageAndRange(UndefinedMessage, UndefinedRangeType); int detailType = -1; QString displayName; QString data; @@ -296,7 +296,7 @@ void QmlProfilerTraceFile::loadEventTypes(QXmlStreamReader &stream) int line = 0, column = 0; auto clearType = [&](){ - messageAndRange = QPair(MaximumMessage, MaximumRangeType); + messageAndRange = QPair(UndefinedMessage, UndefinedRangeType); detailType = -1; displayName.clear(); data.clear(); @@ -368,7 +368,7 @@ void QmlProfilerTraceFile::loadEventTypes(QXmlStreamReader &stream) // confusing), even though they clearly aren't ranges. Convert that to something // sane here. if (detailType == 4) { - messageAndRange = QPair(Event, MaximumRangeType); + messageAndRange = QPair(Event, UndefinedRangeType); detailType = AnimationFrame; } } @@ -674,13 +674,13 @@ void QmlProfilerTraceFile::saveQtd(QIODevice *device) QStack stack; qint64 lastProgressTimestamp = traceStart(); modelManager()->replayQmlEvents([&](const QmlEvent &event, const QmlEventType &type) { - if (type.rangeType() != MaximumRangeType && event.rangeStage() == RangeStart) { + if (type.rangeType() != UndefinedRangeType && event.rangeStage() == RangeStart) { stack.push(event); return; } stream.writeStartElement(_("range")); - if (type.rangeType() != MaximumRangeType && event.rangeStage() == RangeEnd) { + if (type.rangeType() != UndefinedRangeType && event.rangeStage() == RangeEnd) { QmlEvent start = stack.pop(); stream.writeAttribute(_("startTime"), QString::number(start.timestamp())); stream.writeAttribute(_("duration"), diff --git a/src/plugins/qmlprofiler/qmltypedevent.cpp b/src/plugins/qmlprofiler/qmltypedevent.cpp index 0b2a184d48f..88e7b5d64c2 100644 --- a/src/plugins/qmlprofiler/qmltypedevent.cpp +++ b/src/plugins/qmlprofiler/qmltypedevent.cpp @@ -14,10 +14,10 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) stream >> time >> messageType; - if (messageType < 0 || messageType > MaximumMessage) - messageType = MaximumMessage; + if (messageType < 0 || messageType >= MaximumMessage) + messageType = UndefinedMessage; - RangeType rangeType = MaximumRangeType; + RangeType rangeType = UndefinedRangeType; if (!stream.atEnd()) { stream >> subtype; if (subtype >= 0 && subtype < MaximumRangeType) @@ -32,7 +32,9 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) switch (messageType) { case Event: { - event.type = QmlEventType(static_cast(messageType), MaximumRangeType, subtype); + if (subtype >= MaximumEventType) + subtype = UndefinedEventType; + event.type = QmlEventType(static_cast(messageType), UndefinedRangeType, subtype); switch (subtype) { case StartTrace: case EndTrace: { @@ -76,7 +78,7 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) break; } case Complete: { - event.type = QmlEventType(static_cast(messageType), MaximumRangeType, subtype); + event.type = QmlEventType(static_cast(messageType), UndefinedRangeType, subtype); break; } case SceneGraphFrame: { @@ -88,7 +90,7 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) params.push_back(param); } - event.type = QmlEventType(static_cast(messageType), MaximumRangeType, subtype); + event.type = QmlEventType(static_cast(messageType), UndefinedRangeType, subtype); event.event.setNumbers, qint64>(params); break; } @@ -103,7 +105,7 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) refcount = 1; } - event.type = QmlEventType(static_cast(messageType), MaximumRangeType, subtype, + event.type = QmlEventType(static_cast(messageType), UndefinedRangeType, subtype, QmlEventLocation(filename, 0, 0)); event.event.setNumbers({width, height, refcount}); break; @@ -112,7 +114,7 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) qint64 delta; stream >> delta; - event.type = QmlEventType(static_cast(messageType), MaximumRangeType, subtype); + event.type = QmlEventType(static_cast(messageType), UndefinedRangeType, subtype); event.event.setNumbers({delta}); break; } @@ -125,7 +127,7 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) // otherwise it's the old binding type of 4 bytes } - event.type = QmlEventType(MaximumMessage, rangeType, -1); + event.type = QmlEventType(UndefinedMessage, rangeType, -1); event.event.setRangeStage(RangeStart); break; } @@ -133,7 +135,7 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) QString data; stream >> data; - event.type = QmlEventType(MaximumMessage, rangeType, -1, QmlEventLocation(), data); + event.type = QmlEventType(UndefinedMessage, rangeType, -1, QmlEventLocation(), data); event.event.setRangeStage(RangeData); if (!stream.atEnd()) stream >> event.serverTypeId; @@ -151,13 +153,13 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) stream >> event.serverTypeId; } - event.type = QmlEventType(MaximumMessage, rangeType, -1, + event.type = QmlEventType(UndefinedMessage, rangeType, -1, QmlEventLocation(filename, line, column)); event.event.setRangeStage(RangeLocation); break; } case RangeEnd: { - event.type = QmlEventType(MaximumMessage, rangeType, -1); + event.type = QmlEventType(UndefinedMessage, rangeType, -1); event.event.setRangeStage(RangeEnd); break; } @@ -170,13 +172,13 @@ QDataStream &operator>>(QDataStream &stream, QmlTypedEvent &event) stream >> param; params.push_back(param); } - event.type = QmlEventType(static_cast(messageType), MaximumRangeType, subtype); + event.type = QmlEventType(static_cast(messageType), UndefinedRangeType, subtype); event.event.setNumbers, qint64>(params); break; } default: event.event.setNumbers({}); - event.type = QmlEventType(static_cast(messageType), MaximumRangeType, subtype); + event.type = QmlEventType(static_cast(messageType), UndefinedRangeType, subtype); break; } diff --git a/src/plugins/qmlprofiler/quick3dmodel.cpp b/src/plugins/qmlprofiler/quick3dmodel.cpp index 48f6409fe17..110140d7de0 100644 --- a/src/plugins/qmlprofiler/quick3dmodel.cpp +++ b/src/plugins/qmlprofiler/quick3dmodel.cpp @@ -12,7 +12,7 @@ namespace Internal { Quick3DModel::Quick3DModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent) : - QmlProfilerTimelineModel(manager, Quick3DEvent, MaximumRangeType, ProfileQuick3D, parent), + QmlProfilerTimelineModel(manager, Quick3DEvent, UndefinedRangeType, ProfileQuick3D, parent), m_maximumMsgType(-1) { } @@ -135,7 +135,9 @@ int Quick3DModel::collapsedRow(int index) const void Quick3DModel::loadEvent(const QmlEvent &event, const QmlEventType &type) { - auto detailType = type.detailType(); + int detailType = type.detailType(); + if (detailType >= MaximumQuick3DFrameType) + return; qint64 eventDuration = event.number(0); qint64 eventTime = event.timestamp() - eventDuration; QVector numbers = event.numbers>(); diff --git a/src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp b/src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp index d6ddc9ed5c4..af43e03e6f0 100644 --- a/src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp +++ b/src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp @@ -56,7 +56,7 @@ Q_STATIC_ASSERT(sizeof(StageLabels) == SceneGraphTimelineModel::SceneGraphTimelineModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent) : - QmlProfilerTimelineModel(manager, SceneGraphFrame, MaximumRangeType, ProfileSceneGraph, parent) + QmlProfilerTimelineModel(manager, SceneGraphFrame, UndefinedRangeType, ProfileSceneGraph, parent) { } diff --git a/src/plugins/qmlprofiler/tests/check.dat b/src/plugins/qmlprofiler/tests/check.dat index 7431903a1e9..3895dfc1820 100644 Binary files a/src/plugins/qmlprofiler/tests/check.dat and b/src/plugins/qmlprofiler/tests/check.dat differ diff --git a/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp b/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp index 12effcf12fd..72e06f728ba 100644 --- a/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp +++ b/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp @@ -24,7 +24,7 @@ void DebugMessagesModelTest::initTestCase() QmlEvent event; event.setTimestamp(i); event.setString(QString::fromLatin1("message %1").arg(i)); - QmlEventType type(DebugMessage, MaximumRangeType, i % (QtMsgType::QtInfoMsg + 1), + QmlEventType type(DebugMessage, UndefinedRangeType, i % (QtMsgType::QtInfoMsg + 1), QmlEventLocation("somefile.js", i, 10 - i)); event.setTypeIndex(manager.numEventTypes()); manager.appendEventType(std::move(type)); diff --git a/src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp b/src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp index 4fa4d145623..3547647ab00 100644 --- a/src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp +++ b/src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp @@ -34,7 +34,7 @@ int FlameGraphModelTest::generateData(QmlProfilerModelManager *manager, QmlEvent event; if (i < 5) { typeIndex = manager->appendEventType( - QmlEventType(MaximumMessage, + QmlEventType(UndefinedMessage, static_cast(static_cast(Javascript) - i), -1, QmlEventLocation("somefile.js", i, 20 - i), QString("funcfunc"))); diff --git a/src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp b/src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp index 76771f37228..0144616bab9 100644 --- a/src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp +++ b/src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp @@ -20,8 +20,8 @@ static InputEventType inputType(int i) InputEventsModelTest::InputEventsModelTest(QObject *parent) : QObject(parent), model(&manager, &aggregator) { - keyTypeId = manager.appendEventType(QmlEventType(Event, MaximumRangeType, Key)); - mouseTypeId = manager.appendEventType(QmlEventType(Event, MaximumRangeType, Mouse)); + keyTypeId = manager.appendEventType(QmlEventType(Event, UndefinedRangeType, Key)); + mouseTypeId = manager.appendEventType(QmlEventType(Event, UndefinedRangeType, Mouse)); } void InputEventsModelTest::initTestCase() diff --git a/src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp b/src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp index ff24db3c704..3e4c3213b97 100644 --- a/src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp +++ b/src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp @@ -20,11 +20,11 @@ void MemoryUsageModelTest::initTestCase() heapPageTypeId = manager.numEventTypes(); - manager.appendEventType(QmlEventType(MemoryAllocation, MaximumRangeType, HeapPage)); + manager.appendEventType(QmlEventType(MemoryAllocation, UndefinedRangeType, HeapPage)); smallItemTypeId = manager.numEventTypes(); - manager.appendEventType(QmlEventType(MemoryAllocation, MaximumRangeType, SmallItem)); + manager.appendEventType(QmlEventType(MemoryAllocation, UndefinedRangeType, SmallItem)); largeItemTypeId = manager.numEventTypes(); - manager.appendEventType(QmlEventType(MemoryAllocation, MaximumRangeType, LargeItem)); + manager.appendEventType(QmlEventType(MemoryAllocation, UndefinedRangeType, LargeItem)); auto addMemoryEvents = [&]() { QmlEvent event; @@ -53,7 +53,7 @@ void MemoryUsageModelTest::initTestCase() addMemoryEvents(); rangeTypeId = manager.numEventTypes(); - manager.appendEventType(QmlEventType(MaximumMessage, Javascript, -1, + manager.appendEventType(QmlEventType(UndefinedMessage, Javascript, -1, QmlEventLocation(QString("somefile.js"), 10, 20), QString("funcfunc"))); diff --git a/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp b/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp index c7262e1876b..0f021d2ac52 100644 --- a/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp +++ b/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp @@ -22,7 +22,7 @@ void PixmapCacheModelTest::initTestCase() for (int i = 0; i < MaximumPixmapEventType; ++i) { eventTypeIndices[i] = manager.numEventTypes(); - manager.appendEventType(QmlEventType(PixmapCacheEvent, MaximumRangeType, i, + manager.appendEventType(QmlEventType(PixmapCacheEvent, UndefinedRangeType, i, QmlEventLocation("dings.png", 0, 0))); } @@ -37,7 +37,7 @@ void PixmapCacheModelTest::initTestCase() for (int i = 0; i < MaximumPixmapEventType; ++i) { eventTypeIndices[i + MaximumPixmapEventType] = manager.numEventTypes(); - manager.appendEventType(QmlEventType(PixmapCacheEvent, MaximumRangeType, i, + manager.appendEventType(QmlEventType(PixmapCacheEvent, UndefinedRangeType, i, QmlEventLocation("blah.png", 0, 0))); } diff --git a/src/plugins/qmlprofiler/tests/qmleventtype_test.cpp b/src/plugins/qmlprofiler/tests/qmleventtype_test.cpp index 3c70fe4d8eb..f8a1a8b8d6b 100644 --- a/src/plugins/qmlprofiler/tests/qmleventtype_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmleventtype_test.cpp @@ -15,13 +15,13 @@ QmlEventTypeTest::QmlEventTypeTest(QObject *parent) : QObject(parent) void QmlEventTypeTest::testAccessors() { QmlEventType type; - QCOMPARE(type.message(), MaximumMessage); - QCOMPARE(type.rangeType(), MaximumRangeType); + QCOMPARE(type.message(), UndefinedMessage); + QCOMPARE(type.rangeType(), UndefinedMessage); QCOMPARE(type.detailType(), -1); QVERIFY(!type.location().isValid()); QVERIFY(type.data().isEmpty()); QVERIFY(type.displayName().isEmpty()); - QCOMPARE(static_cast(type.feature()), MaximumProfileFeature); + QCOMPARE(static_cast(type.feature()), UndefinedProfileFeature); type.setLocation(QmlEventLocation("blah.js", 12, 13)); QCOMPARE(type.location().filename(), QString("blah.js")); @@ -34,9 +34,9 @@ void QmlEventTypeTest::testAccessors() type.setDisplayName("disdis"); QCOMPARE(type.displayName(), QString("disdis")); - QmlEventType type2(MaximumMessage, Javascript, 12, QmlEventLocation("lala.js", 2, 3), "nehhh", + QmlEventType type2(UndefinedMessage, Javascript, 12, QmlEventLocation("lala.js", 2, 3), "nehhh", "brbr"); - QCOMPARE(type2.message(), MaximumMessage); + QCOMPARE(type2.message(), UndefinedMessage); QCOMPARE(type2.rangeType(), Javascript); QCOMPARE(type2.detailType(), 12); QCOMPARE(type2.location(), QmlEventLocation("lala.js", 2, 3)); @@ -49,23 +49,23 @@ void QmlEventTypeTest::testFeature() { const quint8 features[][MaximumEventType] = { // Event - {MaximumProfileFeature, ProfileInputEvents, ProfileInputEvents, - ProfileAnimations, MaximumProfileFeature, MaximumProfileFeature}, + {UndefinedProfileFeature, ProfileInputEvents, ProfileInputEvents, + ProfileAnimations, UndefinedProfileFeature, UndefinedProfileFeature}, // RangeStart - {MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature, - MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature}, + {UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature, + UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature}, // RangeData - {MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature, - MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature}, + {UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature, + UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature}, // RangeLocation - {MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature, - MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature}, + {UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature, + UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature}, // RangeEnd - {MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature, - MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature}, + {UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature, + UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature}, // Complete - {MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature, - MaximumProfileFeature, MaximumProfileFeature, MaximumProfileFeature}, + {UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature, + UndefinedProfileFeature, UndefinedProfileFeature, UndefinedProfileFeature}, // PixmapCacheEvent {ProfilePixmapCache, ProfilePixmapCache, ProfilePixmapCache, ProfilePixmapCache, ProfilePixmapCache, ProfilePixmapCache}, @@ -85,13 +85,13 @@ void QmlEventTypeTest::testFeature() for (int i = 0; i < MaximumMessage; ++i) { for (int j = 0; j < MaximumEventType; ++j) { - QmlEventType type(static_cast(i), MaximumRangeType, j); + QmlEventType type(static_cast(i), UndefinedRangeType, j); QCOMPARE(type.feature(), features[i][j]); } } for (int i = 0; i < MaximumRangeType; ++i) { - QmlEventType type(MaximumMessage, static_cast(i)); + QmlEventType type(UndefinedMessage, static_cast(i)); QCOMPARE(static_cast(type.feature()), featureFromRangeType(static_cast(i))); } @@ -99,7 +99,7 @@ void QmlEventTypeTest::testFeature() void QmlEventTypeTest::testStreamOps() { - QmlEventType type(MaximumMessage, Javascript, -1, QmlEventLocation("socken.js", 12, 13), + QmlEventType type(UndefinedMessage, Javascript, -1, QmlEventLocation("socken.js", 12, 13), "lalala", "lelele"); QBuffer wbuffer; diff --git a/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp index 9d3d8f7b433..a7521072697 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp @@ -25,7 +25,7 @@ void QmlProfilerAnimationsModelTest::initTestCase() QmlEvent event; event.setTypeIndex(manager.appendEventType( - QmlEventType(Event, MaximumRangeType, AnimationFrame))); + QmlEventType(Event, UndefinedRangeType, AnimationFrame))); for (int i = 0; i < 10; ++i) { event.setTimestamp(i); diff --git a/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp index 84416c7b91f..4067dd8a763 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp @@ -27,7 +27,7 @@ DummyModel::DummyModel(QmlProfilerModelManager *manager, void DummyModel::loadData() { - QmlEventType type(MaximumMessage, Binding); + QmlEventType type(UndefinedMessage, Binding); const int typeIndex = modelManager()->appendEventType(QmlEventType(type)); QCOMPARE(typeIndex, 0); diff --git a/src/plugins/qmlprofiler/tests/qmlprofilertraceclient_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilertraceclient_test.cpp index 8780708156c..b57db7bcfa8 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilertraceclient_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilertraceclient_test.cpp @@ -57,9 +57,13 @@ void QmlProfilerTraceClientTest::testMessageReceived() modelManager.replayQmlEvents([&](const QmlEvent &event, const QmlEventType &type) { qint64 timestamp; - qint32 message; - qint32 rangeType; + quint8 message; + quint8 rangeType; checkStream >> timestamp >> message >> rangeType; + QVERIFY(message != MaximumMessage); + QVERIFY(rangeType != MaximumRangeType); + QVERIFY(type.message() != MaximumMessage); + QVERIFY(type.rangeType() != MaximumRangeType); QCOMPARE(event.timestamp(), timestamp); QCOMPARE(type.message(), static_cast(message)); QCOMPARE(type.rangeType(), static_cast(rangeType)); diff --git a/src/plugins/qnx/qnxconfiguration.cpp b/src/plugins/qnx/qnxconfiguration.cpp index a147df4a6ba..b17c240a469 100644 --- a/src/plugins/qnx/qnxconfiguration.cpp +++ b/src/plugins/qnx/qnxconfiguration.cpp @@ -264,7 +264,7 @@ QnxConfiguration::QnxToolChainMap QnxConfiguration::createToolChain(const Target toolChain->resetToolChain(qccCompilerPath()); ToolChainManager::registerToolChain(toolChain); - toolChainMap.insert(std::make_pair(language, toolChain)); + toolChainMap.insert({language, toolChain}); } return toolChainMap; diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 8b2115f7c1d..ada5f3c842e 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -629,14 +629,14 @@ void QtOptionsPageWidget::addQtDir() if (BuildableHelperLibrary::isQtChooser(qtVersion)) qtVersion = BuildableHelperLibrary::qtChooserToQmakePath(qtVersion.symLinkTarget()); - auto checkAlreadyExists = [qtVersion](TreeItem *parent) { + auto checkAlreadyExists = [qtVersion](TreeItem *parent) -> QPair { for (int i = 0; i < parent->childCount(); ++i) { auto item = static_cast(parent->childAt(i)); if (item->version()->qmakeFilePath() == qtVersion) { - return std::make_pair(true, item->version()->displayName()); + return {true, item->version()->displayName()}; } } - return std::make_pair(false, QString()); + return {false, {}}; }; bool alreadyExists; diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 88be06dd539..ce97e2a5a73 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -1034,6 +1034,12 @@ DeviceEnvironmentFetcher::Ptr LinuxDevice::environmentFetcher() const return DeviceEnvironmentFetcher::Ptr(new LinuxDeviceEnvironmentFetcher(sharedFromThis())); } +bool LinuxDevice::usableAsBuildDevice() const +{ + const bool isUsable = qtcEnvironmentVariableIntValue("QTC_ALLOW_REMOTE_LINUX_BUILD_DEVICES"); + return isUsable; +} + QString LinuxDevice::userAtHost() const { return sshParameters().userAtHost(); diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index 4897e87e6b4..0d4748cb308 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -30,6 +30,7 @@ public: ProjectExplorer::DeviceTester *createDeviceTester() const override; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; ProjectExplorer::DeviceEnvironmentFetcher::Ptr environmentFetcher() const override; + bool usableAsBuildDevice() const override; QString userAtHost() const; diff --git a/src/plugins/squish/scripthelper.cpp b/src/plugins/squish/scripthelper.cpp index d6e18872098..18c605b3d81 100644 --- a/src/plugins/squish/scripthelper.cpp +++ b/src/plugins/squish/scripthelper.cpp @@ -12,23 +12,25 @@ namespace Squish { namespace Internal { -static QByteArray startApplication(Language language, const QString &application, - const QStringList &args) +static QByteArray startApplication(Language language, + const QString &application, + const QString &args) { + const QString app = application.contains(' ') ? QString("\\\"" + application + "\\\"") + : application; + QStringList parameters; + parameters << app; + if (!args.isEmpty()) + parameters << QString(args).replace('"', "\\\""); + switch (language) { case Language::Python: case Language::Perl: case Language::JavaScript: case Language::Ruby: - if (args.isEmpty()) - return QByteArray("startApplication(\"" + application.toUtf8() + "\")"); - return QByteArray("startApplication(\"" + application.toUtf8() + ' ' - + args.join(' ').toUtf8() + "\")"); + return QByteArray("startApplication(\"" + parameters.join(' ').toUtf8() + "\")"); case Language::Tcl: - if (args.isEmpty()) - return QByteArray("startApplication \"" + application.toUtf8() + "\""); - return QByteArray("startApplication \"" + application.toUtf8() + ' ' - + args.join(' ').toUtf8() + "\""); + return QByteArray("startApplication \"" + parameters.join(' ').toUtf8() + "\""); } return {}; } @@ -115,7 +117,7 @@ ScriptHelper::ScriptHelper(Language language) bool ScriptHelper::writeScriptFile(const Utils::FilePath &outScriptFile, const Utils::FilePath &snippetFile, const QString &application, - const QStringList &arguments) const + const QString &arguments) const { if (!snippetFile.isReadableFile()) return false; diff --git a/src/plugins/squish/scripthelper.h b/src/plugins/squish/scripthelper.h index 56dfdea5f31..34ed79bca92 100644 --- a/src/plugins/squish/scripthelper.h +++ b/src/plugins/squish/scripthelper.h @@ -21,7 +21,7 @@ public: bool writeScriptFile(const Utils::FilePath &outScriptFile, const Utils::FilePath &snippetFile, const QString &application, - const QStringList &arguments) const; + const QString &arguments) const; private: Language m_language; }; diff --git a/src/plugins/squish/squish.qrc b/src/plugins/squish/squish.qrc index d9c7130419d..830a60d5aa7 100644 --- a/src/plugins/squish/squish.qrc +++ b/src/plugins/squish/squish.qrc @@ -8,5 +8,6 @@ images/jumpTo@2x.png images/data.png images/data@2x.png + wizard/wizard.json diff --git a/src/plugins/squish/squishfilehandler.cpp b/src/plugins/squish/squishfilehandler.cpp index 6c3bfea6a06..85fdb85c596 100644 --- a/src/plugins/squish/squishfilehandler.cpp +++ b/src/plugins/squish/squishfilehandler.cpp @@ -5,6 +5,7 @@ #include "opensquishsuitesdialog.h" #include "squishconstants.h" +#include "squishsettings.h" #include "squishtesttreemodel.h" #include "squishtools.h" #include "suiteconf.h" @@ -12,22 +13,92 @@ #include #include +#include +#include +#include +#include #include +#include +#include +#include #include #include #include #include +#include +#include namespace Squish { namespace Internal { +static const char SK_OpenSuites[] = "SquishOpenSuites"; + static SquishFileHandler *m_instance = nullptr; +class MappedAutDialog : public QDialog +{ +public: + MappedAutDialog() + { + auto label = new QLabel(Tr::tr("Application:"), this); + aut.addItem(Tr::tr("")); + arguments.setLabelText(Tr::tr("Arguments:")); + arguments.setDisplayStyle(Utils::StringAspect::LineEditDisplay); + + QWidget *widget = new QWidget(this); + auto buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); + + using namespace Utils::Layouting; + Form { + label, &aut, br, + arguments, + st + }.attachTo(widget); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->addWidget(widget); + layout->addWidget(buttons); + setLayout(layout); + + QPushButton *okButton = buttons->button(QDialogButtonBox::Ok); + okButton->setEnabled(false); + connect(okButton, &QPushButton::clicked, + this, &QDialog::accept); + connect(buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, + this, &QDialog::reject); + connect(&aut, &QComboBox::currentIndexChanged, + this, [this, okButton] (int index) { + okButton->setEnabled(index > 0); + }); + setWindowTitle(Tr::tr("Recording Settings")); + + auto squishTools = SquishTools::instance(); + connect(squishTools, &SquishTools::queryFinished, this, + [this] (const QString &out) { + SquishServerSettings s; + s.setFromXmlOutput(out); + QApplication::restoreOverrideCursor(); + for (const QString &app : s.mappedAuts.keys()) + aut.addItem(app); + }); + + QApplication::setOverrideCursor(Qt::WaitCursor); + squishTools->queryServerSettings(); + } + + + QComboBox aut; + Utils::StringAspect arguments; +}; + SquishFileHandler::SquishFileHandler(QObject *parent) : QObject(parent) { m_instance = this; + auto sessionManager = ProjectExplorer::SessionManager::instance(); + connect(sessionManager, &ProjectExplorer::SessionManager::sessionLoaded, + this, &SquishFileHandler::onSessionLoaded); } SquishFileHandler *SquishFileHandler::instance() @@ -191,6 +262,7 @@ void SquishFileHandler::openTestSuites() } } emit suitesOpened(); + ProjectExplorer::SessionManager::setValue(SK_OpenSuites, m_suites.values()); } void SquishFileHandler::openTestSuite(const Utils::FilePath &suitePath, bool isReopen) @@ -221,6 +293,7 @@ void SquishFileHandler::openTestSuite(const Utils::FilePath &suitePath, bool isR m_suites.insert(suiteName, suitePathStr); emit testTreeItemCreated(item); } + ProjectExplorer::SessionManager::setValue(SK_OpenSuites, m_suites.values()); } void SquishFileHandler::closeTestSuite(const QString &suiteName) @@ -232,9 +305,16 @@ void SquishFileHandler::closeTestSuite(const QString &suiteName) // TODO remove file watcher m_suites.remove(suiteName); emit suiteTreeItemRemoved(suiteName); + ProjectExplorer::SessionManager::setValue(SK_OpenSuites, m_suites.values()); } void SquishFileHandler::closeAllTestSuites() +{ + closeAllInternal(); + ProjectExplorer::SessionManager::setValue(SK_OpenSuites, m_suites.values()); +} + +void SquishFileHandler::closeAllInternal() { // TODO close respective editors if there are any // TODO remove file watcher @@ -315,8 +395,13 @@ void SquishFileHandler::recordTestCase(const QString &suiteName, const QString & SuiteConf conf = SuiteConf::readSuiteConf( Utils::FilePath::fromString(m_suites.value(suiteName))); if (conf.aut().isEmpty()) { - // provide a choice of apps & args, set aut & args for conf - return; + MappedAutDialog dialog; + + if (dialog.exec() != QDialog::Accepted) + return; + + conf.setAut(dialog.aut.currentText()); + conf.setArguments(dialog.arguments.value()); } SquishTools::instance()->recordTestCase(suitePath.absolutePath(), testCaseName, conf); @@ -395,5 +480,21 @@ void SquishFileHandler::openObjectsMap(const QString &suiteName) } } +void SquishFileHandler::onSessionLoaded() +{ + // remove currently opened "silently" (without storing into session) + closeAllInternal(); + + const QVariant variant = ProjectExplorer::SessionManager::value(SK_OpenSuites); + const Utils::FilePaths suitePaths = Utils::transform(variant.toStringList(), + &Utils::FilePath::fromString); + + // open suites of the old session + for (const Utils::FilePath &fp : suitePaths) { + if (fp.exists()) + openTestSuite(fp); + } +} + } // namespace Internal } // namespace Squish diff --git a/src/plugins/squish/squishfilehandler.h b/src/plugins/squish/squishfilehandler.h index adaccbf0f46..e1ea6f29bb8 100644 --- a/src/plugins/squish/squishfilehandler.h +++ b/src/plugins/squish/squishfilehandler.h @@ -40,6 +40,9 @@ signals: void suitesOpened(); private: + void closeAllInternal(); + void onSessionLoaded(); + QMap m_suites; QStringList m_sharedFolders; diff --git a/src/plugins/squish/squishplugin.cpp b/src/plugins/squish/squishplugin.cpp index 5f3cfaea4e4..ced619fbca5 100644 --- a/src/plugins/squish/squishplugin.cpp +++ b/src/plugins/squish/squishplugin.cpp @@ -105,6 +105,7 @@ void SquishPluginPrivate::initializeMenuEntries() bool SquishPlugin::initialize(const QStringList &, QString *) { dd = new SquishPluginPrivate; + ProjectExplorer::JsonWizardFactory::addWizardPath(":/squish/wizard/"); return true; } diff --git a/src/plugins/squish/squishtools.cpp b/src/plugins/squish/squishtools.cpp index a5fc9a2c2ab..463109eda60 100644 --- a/src/plugins/squish/squishtools.cpp +++ b/src/plugins/squish/squishtools.cpp @@ -739,7 +739,7 @@ void SquishTools::onRecorderFinished() "test" + m_suiteConf.scriptExtension()); bool result = helper.writeScriptFile(testFile, m_currentRecorderSnippetFile, m_suiteConf.aut(), - m_suiteConf.arguments().split(' ', Qt::SkipEmptyParts)); + m_suiteConf.arguments()); qCInfo(LOG) << "Wrote recorded test case" << testFile.toUserOutput() << " " << result; m_currentRecorderSnippetFile.removeFile(); m_currentRecorderSnippetFile.clear(); diff --git a/src/plugins/squish/squishwizardpages.cpp b/src/plugins/squish/squishwizardpages.cpp index 55d6aa371a8..8287482bf24 100644 --- a/src/plugins/squish/squishwizardpages.cpp +++ b/src/plugins/squish/squishwizardpages.cpp @@ -4,10 +4,12 @@ #include "squishwizardpages.h" #include "squishfilehandler.h" +#include "squishplugin.h" #include "squishsettings.h" #include "squishtools.h" #include "squishtr.h" +#include #include #include @@ -47,7 +49,7 @@ SquishToolkitsPage::SquishToolkitsPage() resize(400, 300); setTitle(Tr::tr("Create New Squish Test Suite")); - auto layout = new QHBoxLayout(this); + auto layout = new QVBoxLayout(this); auto groupBox = new QGroupBox(Tr::tr("Available GUI toolkits:"), this); auto buttonLayout = new QVBoxLayout(groupBox); @@ -63,6 +65,15 @@ SquishToolkitsPage::SquishToolkitsPage() } groupBox->setLayout(buttonLayout); layout->addWidget(groupBox); + + m_errorLabel = new Utils::InfoLabel(Tr::tr("Invalid Squish settings. Configure Squish " + "installation path inside " + "Preferences... > Squish > General to use " + "this wizard."), + Utils::InfoLabel::Error, this); + m_errorLabel->setVisible(false); + layout->addWidget(m_errorLabel); + auto hiddenLineEdit = new QLineEdit(this); hiddenLineEdit->setVisible(false); layout->addWidget(hiddenLineEdit); @@ -99,7 +110,13 @@ bool SquishToolkitsPage::handleReject() void SquishToolkitsPage::delayedInitialize() { - fetchServerSettings(); + const auto s = SquishPlugin::squishSettings(); + const Utils::FilePath server = s->squishPath.filePath().pathAppended( + Utils::HostOsInfo::withExecutableSuffix("bin/squishserver")); + if (server.isExecutableFile()) + fetchServerSettings(); + else + m_errorLabel->setVisible(true); } void SquishToolkitsPage::fetchServerSettings() @@ -311,6 +328,8 @@ Core::GeneratedFiles SquishFileGenerator::fileList(Utils::MacroExpander *expande QString aut = expander->expand(QString{"%{AUT}"}); if (aut == Tr::tr("")) aut.clear(); + if (aut.contains(' ')) + aut = QString('"' + aut + '"'); const QString lang = expander->expand(QString{"%{Language}"}); const QString toolkit = expander->expand(QString{"%{Toolkit}"});; const Utils::FilePath suiteConf = projectDir.pathAppended("suite.conf"); diff --git a/src/plugins/squish/squishwizardpages.h b/src/plugins/squish/squishwizardpages.h index 84e8840680f..81cbbfc7e2f 100644 --- a/src/plugins/squish/squishwizardpages.h +++ b/src/plugins/squish/squishwizardpages.h @@ -13,6 +13,8 @@ class QComboBox; class QLineEdit; QT_END_NAMESPACE +namespace Utils { class InfoLabel; } + namespace Squish { namespace Internal { @@ -43,6 +45,7 @@ private: QButtonGroup *m_buttonGroup = nullptr; QLineEdit *m_hiddenLineEdit = nullptr; + Utils::InfoLabel *m_errorLabel = nullptr; }; class SquishScriptLanguagePageFactory : public ProjectExplorer::JsonWizardPageFactory diff --git a/share/qtcreator/templates/wizards/projects/squish/wizard.json b/src/plugins/squish/wizard/wizard.json similarity index 100% rename from share/qtcreator/templates/wizards/projects/squish/wizard.json rename to src/plugins/squish/wizard/wizard.json diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 9fb57091d2d..3419e9212ed 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -129,7 +129,7 @@ StatusList parseStatusOutput(const QString &output) StatusList changeSet; const QString newLine = QString(QLatin1Char('\n')); const QStringList list = output.split(newLine, Qt::SkipEmptyParts); - foreach (const QString &l, list) { + for (const QString &l : list) { const QString line =l.trimmed(); if (line.size() > 8) { const QByteArray state = line.left(1).toLatin1(); @@ -1039,7 +1039,7 @@ QString SubversionPluginPrivate::monitorFile(const FilePath &repository) const { QTC_ASSERT(!repository.isEmpty(), return QString()); QDir repoDir(repository.toString()); - foreach (const QString &svnDir, m_svnDirectories) { + for (const QString &svnDir : qAsConst(m_svnDirectories)) { if (repoDir.exists(svnDir)) { QFileInfo fi(repoDir.absoluteFilePath(svnDir + QLatin1String("/wc.db"))); if (fi.exists() && fi.isFile()) diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index b8a3ab24808..a225479c69d 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -379,8 +379,7 @@ QList> BaseFileFind::createPatternWidgets() d->m_exclusionCombo->setToolTip(msgFilePatternToolTip()); exclusionLabel->setBuddy(d->m_exclusionCombo); syncComboWithSettings(d->m_exclusionCombo, d->m_exclusionSetting); - return { qMakePair(filterLabel, d->m_filterCombo), - qMakePair(exclusionLabel, d->m_exclusionCombo) }; + return {{filterLabel, d->m_filterCombo}, {exclusionLabel, d->m_exclusionCombo}}; } void BaseFileFind::writeCommonSettings(QSettings *settings) @@ -508,10 +507,9 @@ FilePaths BaseFileFind::replaceAll(const QString &text, ChangeSet changeSet; RefactoringFilePtr file = refactoring.file(filePath); - QSet > processed; + QSet> processed; for (const SearchResultItem &item : changeItems) { - const QPair &p = qMakePair(item.mainRange().begin.line, - item.mainRange().begin.column); + const QPair p{item.mainRange().begin.line, item.mainRange().begin.column}; if (processed.contains(p)) continue; processed.insert(p); diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index d259674fb96..a4afd319821 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -43,8 +43,7 @@ RefactoringSelections RefactoringChanges::rangesToSelections(QTextDocument *docu start.setKeepPositionOnInsert(true); QTextCursor end(document); end.setPosition(qMin(range.end, document->characterCount() - 1)); - - selections.append(qMakePair(start, end)); + selections.push_back({start, end}); } return selections; diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index 71da641ecef..6b221c310fa 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -274,9 +274,34 @@ TextDocument *TextDocument::textDocumentForFilePath(const Utils::FilePath &fileP return qobject_cast(DocumentModel::documentForFilePath(filePath)); } +QString TextDocument::convertToPlainText(const QString &rawText) +{ + // This is basically a copy of QTextDocument::toPlainText but since toRawText returns a + // text containing formating characters and toPlainText replaces non breaking spaces, we + // provide our own plain text conversion to be able to save and copy document content + // containing non breaking spaces. + + QString txt = rawText; + QChar *uc = txt.data(); + QChar *e = uc + txt.size(); + + for (; uc != e; ++uc) { + switch (uc->unicode()) { + case 0xfdd0: // QTextBeginningOfFrame + case 0xfdd1: // QTextEndOfFrame + case QChar::ParagraphSeparator: + case QChar::LineSeparator: + *uc = QLatin1Char('\n'); + break; + default:; + } + } + return txt; +} + QString TextDocument::plainText() const { - return document()->toPlainText(); + return convertToPlainText(d->m_document.toRawText()); } QString TextDocument::textAt(int pos, int length) const @@ -638,7 +663,7 @@ bool TextDocument::save(QString *errorString, const FilePath &filePath, bool aut } } - const bool ok = write(savePath, saveFormat, d->m_document.toPlainText(), errorString); + const bool ok = write(savePath, saveFormat, plainText(), errorString); // restore text cursor and scroll bar positions if (autoSave && undos < d->m_document.availableUndoSteps()) { diff --git a/src/plugins/texteditor/textdocument.h b/src/plugins/texteditor/textdocument.h index fbddd843848..4a73cc124a5 100644 --- a/src/plugins/texteditor/textdocument.h +++ b/src/plugins/texteditor/textdocument.h @@ -53,6 +53,7 @@ public: static QMap openedTextDocumentEncodings(); static TextDocument *currentTextDocument(); static TextDocument *textDocumentForFilePath(const Utils::FilePath &filePath); + static QString convertToPlainText(const QString &rawText); virtual QString plainText() const; virtual QString textAt(int pos, int length) const; diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index dc28b7f3bfc..1b4c0be2b34 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -889,6 +889,10 @@ void TextEditorWidgetFind::cancelCurrentSelectAll() TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) : q(parent) + , m_overlay(new TextEditorOverlay(q)) + , m_snippetOverlay(new SnippetOverlay(q)) + , m_searchResultOverlay(new TextEditorOverlay(q)) + , m_refactorOverlay(new RefactorOverlay(q)) , m_marksVisible(false) , m_codeFoldingVisible(false) , m_codeFoldingSupported(false) @@ -901,10 +905,6 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) , m_hoverHandlerRunner(parent, m_hoverHandlers) , m_clipboardAssistProvider(new ClipboardAssistProvider) , m_autoCompleter(new AutoCompleter) - , m_overlay(new TextEditorOverlay(q)) - , m_snippetOverlay(new SnippetOverlay(q)) - , m_searchResultOverlay(new TextEditorOverlay(q)) - , m_refactorOverlay(new RefactorOverlay(q)) { auto aggregate = new Aggregation::Aggregate; m_find = new TextEditorWidgetFind(q); @@ -1097,36 +1097,12 @@ QString TextEditorWidget::plainTextFromSelection(const QTextCursor &cursor) cons { // Copy the selected text as plain text QString text = cursor.selectedText(); - return convertToPlainText(text); + return TextDocument::convertToPlainText(text); } QString TextEditorWidget::plainTextFromSelection(const Utils::MultiTextCursor &cursor) const { - return convertToPlainText(cursor.selectedText()); -} - -QString TextEditorWidget::convertToPlainText(const QString &txt) -{ - QString ret = txt; - QChar *uc = ret.data(); - QChar *e = uc + ret.size(); - - for (; uc != e; ++uc) { - switch (uc->unicode()) { - case 0xfdd0: // QTextBeginningOfFrame - case 0xfdd1: // QTextEndOfFrame - case QChar::ParagraphSeparator: - case QChar::LineSeparator: - *uc = QLatin1Char('\n'); - break; - case QChar::Nbsp: - *uc = QLatin1Char(' '); - break; - default: - ; - } - } - return ret; + return TextDocument::convertToPlainText(cursor.selectedText()); } static const char kTextBlockMimeType[] = "application/vnd.qtcreator.blocktext"; diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index ae7f2f82cce..75ccb493578 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -522,7 +522,6 @@ protected: virtual QString plainTextFromSelection(const QTextCursor &cursor) const; virtual QString plainTextFromSelection(const Utils::MultiTextCursor &cursor) const; - static QString convertToPlainText(const QString &txt); virtual QString lineNumber(int blockNumber) const; virtual int lineNumberDigits() const; diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 0e5d50b5d2f..674e6aab52b 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -261,20 +261,21 @@ void TextEditorPluginPrivate::updateSearchResultsFont(const FontSettings &settin const Format containingFunctionResultFormat = settings.formatFor(C_SEARCH_RESULT_CONTAINING_FUNCTION); window->setTextEditorFont(QFont(settings.family(), settings.fontSize() * settings.fontZoom() / 100), - {std::make_pair(SearchResultColor::Style::Default, - SearchResultColor(textFormat.background(), textFormat.foreground(), - defaultResultFormat.background(), defaultResultFormat.foreground(), - containingFunctionResultFormat.background(), containingFunctionResultFormat.foreground())), - std::make_pair(SearchResultColor::Style::Alt1, - SearchResultColor(textFormat.background(), textFormat.foreground(), - alt1ResultFormat.background(), alt1ResultFormat.foreground(), - containingFunctionResultFormat.background(), - containingFunctionResultFormat.foreground())), - std::make_pair(SearchResultColor::Style::Alt2, - SearchResultColor(textFormat.background(), textFormat.foreground(), - alt2ResultFormat.background(), alt2ResultFormat.foreground(), - containingFunctionResultFormat.background(), - containingFunctionResultFormat.foreground()))}); + {{SearchResultColor::Style::Default, + {textFormat.background(), textFormat.foreground(), + defaultResultFormat.background(), defaultResultFormat.foreground(), + containingFunctionResultFormat.background(), + containingFunctionResultFormat.foreground()}}, + {SearchResultColor::Style::Alt1, + {textFormat.background(), textFormat.foreground(), + alt1ResultFormat.background(), alt1ResultFormat.foreground(), + containingFunctionResultFormat.background(), + containingFunctionResultFormat.foreground()}}, + {SearchResultColor::Style::Alt2, + {textFormat.background(), textFormat.foreground(), + alt2ResultFormat.background(), alt2ResultFormat.foreground(), + containingFunctionResultFormat.background(), + containingFunctionResultFormat.foreground()}}}); } } diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index 021f0b9cce1..5aef0531dc2 100644 --- a/src/plugins/updateinfo/updateinfoplugin.cpp +++ b/src/plugins/updateinfo/updateinfoplugin.cpp @@ -120,7 +120,8 @@ void UpdateInfoPlugin::doAutoCheckForUpdates() void UpdateInfoPlugin::startCheckForUpdates() { - stopCheckForUpdates(); + if (d->m_maintenanceToolProcess) + return; // do not trigger while update task is already running QFutureInterface futureIf; FutureProgress *futureProgress diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp index 3b188d4029f..e012168001f 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp @@ -320,11 +320,11 @@ Parser::Private::NamePair Parser::Private::parseName(const char *begin, const ch if (*current == '(') { current++; if ((nameShorthand = parseNameShorthand(¤t, end)) == -1) - return qMakePair(qint64(-1), QString()); // error + return {qint64(-1), {}}; // error } skipSpace(¤t, end); - return qMakePair(nameShorthand, QString::fromUtf8(QByteArray(current, end - current))); + return {nameShorthand, QString::fromUtf8(QByteArray(current, end - current))}; } /* diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp index 8b3b446b8d4..0d4253c4d13 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.cpp +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.cpp @@ -284,13 +284,11 @@ void ValgrindMemcheckParserTest::testMemcheckSample1() expectedErrors << error; } - QVector > expectedErrorCounts; - expectedErrorCounts.push_back(QPair(9, 2)); - - QVector > expectedSuppCounts; - expectedSuppCounts.push_back(qMakePair(QString("X on SUSE11 writev uninit padding"), static_cast(12))); - expectedSuppCounts.push_back(qMakePair(QString("dl-hack3-cond-1"), static_cast(2))); - expectedSuppCounts.push_back(qMakePair(QString("glibc-2.5.x-on-SUSE-10.2-(PPC)-2a"), static_cast(2))); + const QVector> expectedErrorCounts{{9, 2}}; + const QVector> expectedSuppCounts{ + {QString("X on SUSE11 writev uninit padding"), 12}, + {QString("dl-hack3-cond-1"), 2}, + {QString("glibc-2.5.x-on-SUSE-10.2-(PPC)-2a"), 2}}; Parser parser; Recorder rec(&parser); diff --git a/src/plugins/valgrind/valgrindmemcheckparsertest.h b/src/plugins/valgrind/valgrindmemcheckparsertest.h index 12966b3a46b..2343a6fcec1 100644 --- a/src/plugins/valgrind/valgrindmemcheckparsertest.h +++ b/src/plugins/valgrind/valgrindmemcheckparsertest.h @@ -51,12 +51,12 @@ public: void errorCount(qint64 unique, qint64 count) { - errorcounts.push_back(qMakePair(unique, count)); + errorcounts.push_back({unique, count}); } void suppressionCount(const QString &name, qint64 count) { - suppcounts.push_back(qMakePair(name, count)); + suppcounts.push_back({name, count}); } }; diff --git a/src/plugins/vcsbase/cleandialog.cpp b/src/plugins/vcsbase/cleandialog.cpp index 1a0bb7ae71f..ad1add7eb2d 100644 --- a/src/plugins/vcsbase/cleandialog.cpp +++ b/src/plugins/vcsbase/cleandialog.cpp @@ -28,6 +28,8 @@ #include #include +using namespace Utils; + namespace VcsBase { namespace Internal { @@ -65,7 +67,7 @@ static void removeFileRecursion(QFutureInterface &futureInterface, // Cleaning files in the background static void runCleanFiles(QFutureInterface &futureInterface, - const QString &repository, const QStringList &files, + const FilePath &repository, const QStringList &files, const std::function &errorHandler) { QString errorMessage; @@ -80,7 +82,7 @@ static void runCleanFiles(QFutureInterface &futureInterface, if (!errorMessage.isEmpty()) { // Format and emit error. const QString msg = CleanDialog::tr("There were errors when cleaning the repository %1:"). - arg(QDir::toNativeSeparators(repository)); + arg(repository.toUserOutput()); errorMessage.insert(0, QLatin1Char('\n')); errorMessage.insert(0, msg); errorHandler(errorMessage); @@ -108,7 +110,7 @@ public: QTreeView *m_filesTreeView; QStandardItemModel *m_filesModel; - QString m_workingDirectory; + FilePath m_workingDirectory; }; @@ -150,7 +152,7 @@ CleanDialog::CleanDialog(QWidget *parent) : d->m_filesTreeView->setAllColumnsShowFocus(true); d->m_filesTreeView->setRootIsDecorated(false); - using namespace Utils::Layouting; + using namespace Layouting; Column { d->m_selectAllCheckBox, @@ -178,12 +180,11 @@ CleanDialog::~CleanDialog() delete d; } -void CleanDialog::setFileList(const QString &workingDirectory, const QStringList &files, +void CleanDialog::setFileList(const FilePath &workingDirectory, const QStringList &files, const QStringList &ignoredFiles) { d->m_workingDirectory = workingDirectory; - d->m_groupBox->setTitle(tr("Repository: %1"). - arg(QDir::toNativeSeparators(workingDirectory))); + d->m_groupBox->setTitle(tr("Repository: %1").arg(workingDirectory.toUserOutput())); if (const int oldRowCount = d->m_filesModel->rowCount()) d->m_filesModel->removeRows(0, oldRowCount); @@ -199,32 +200,27 @@ void CleanDialog::setFileList(const QString &workingDirectory, const QStringList d->m_selectAllCheckBox->setChecked(true); } -void CleanDialog::addFile(const QString &workingDirectory, QString fileName, bool checked) +void CleanDialog::addFile(const FilePath &workingDirectory, const QString &fileName, bool checked) { QStyle *style = QApplication::style(); const QIcon folderIcon = style->standardIcon(QStyle::SP_DirIcon); const QIcon fileIcon = style->standardIcon(QStyle::SP_FileIcon); - const QChar slash = QLatin1Char('/'); - // Clean the trailing slash of directories - if (fileName.endsWith(slash)) - fileName.chop(1); - QFileInfo fi(workingDirectory + slash + fileName); - bool isDir = fi.isDir(); - if (isDir) - checked = false; + const FilePath fullPath = workingDirectory.pathAppended(fileName); + const bool isDir = fullPath.isDir(); + const bool isChecked = checked && !isDir; auto nameItem = new QStandardItem(QDir::toNativeSeparators(fileName)); nameItem->setFlags(Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); nameItem->setIcon(isDir ? folderIcon : fileIcon); nameItem->setCheckable(true); - nameItem->setCheckState(checked ? Qt::Checked : Qt::Unchecked); - nameItem->setData(QVariant(fi.absoluteFilePath()), Internal::fileNameRole); + nameItem->setCheckState(isChecked ? Qt::Checked : Qt::Unchecked); + nameItem->setData(fullPath.absoluteFilePath().toVariant(), Internal::fileNameRole); nameItem->setData(QVariant(isDir), Internal::isDirectoryRole); // Tooltip with size information - if (fi.isFile()) { - const QString lastModified = - QLocale::system().toString(fi.lastModified(), QLocale::ShortFormat); + if (fullPath.isFile()) { + const QString lastModified = QLocale::system().toString(fullPath.lastModified(), + QLocale::ShortFormat); nameItem->setToolTip(tr("%n bytes, last modified %1.", nullptr, - fi.size()).arg(lastModified)); + fullPath.fileSize()).arg(lastModified)); } d->m_filesModel->appendRow(nameItem); } @@ -261,11 +257,10 @@ bool CleanDialog::promptToDelete() return false; // Remove in background - QFuture task = Utils::runAsync(Internal::runCleanFiles, d->m_workingDirectory, - selectedFiles, Internal::handleError); + QFuture task = runAsync(Internal::runCleanFiles, d->m_workingDirectory, + selectedFiles, Internal::handleError); - const QString taskName = tr("Cleaning \"%1\""). - arg(QDir::toNativeSeparators(d->m_workingDirectory)); + const QString taskName = tr("Cleaning \"%1\"").arg(d->m_workingDirectory.toUserOutput()); Core::ProgressManager::addTask(task, taskName, "VcsBase.cleanRepository"); return true; } @@ -275,7 +270,7 @@ void CleanDialog::slotDoubleClicked(const QModelIndex &index) // Open file on doubleclick if (const QStandardItem *item = d->m_filesModel->itemFromIndex(index)) if (!item->data(Internal::isDirectoryRole).toBool()) { - const auto fname = Utils::FilePath::fromVariant(item->data(Internal::fileNameRole)); + const auto fname = FilePath::fromVariant(item->data(Internal::fileNameRole)); Core::EditorManager::openEditor(fname); } } diff --git a/src/plugins/vcsbase/cleandialog.h b/src/plugins/vcsbase/cleandialog.h index fbab96c1fc8..c400f1e4950 100644 --- a/src/plugins/vcsbase/cleandialog.h +++ b/src/plugins/vcsbase/cleandialog.h @@ -11,6 +11,8 @@ QT_BEGIN_NAMESPACE class QModelIndex; QT_END_NAMESPACE +namespace Utils { class FilePath; } + namespace VcsBase { namespace Internal { class CleanDialogPrivate; } @@ -23,7 +25,7 @@ public: explicit CleanDialog(QWidget *parent = nullptr); ~CleanDialog() override; - void setFileList(const QString &workingDirectory, const QStringList &files, + void setFileList(const Utils::FilePath &workingDirectory, const QStringList &files, const QStringList &ignoredFiles); public slots: @@ -36,7 +38,7 @@ private: QStringList checkedFiles() const; bool promptToDelete(); - void addFile(const QString &workingDirectory, QString fileName, bool checked); + void addFile(const Utils::FilePath &workingDirectory, const QString &fileName, bool checked); Internal::CleanDialogPrivate *const d; }; diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index b816f0cfe99..689de58428e 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -76,17 +76,17 @@ public: inline bool hasProject() const { return !currentProjectTopLevel.isEmpty(); } inline bool isEmpty() const { return !hasFile() && !hasProject(); } - QString currentFile; + FilePath currentFile; QString currentFileName; - QString currentPatchFile; + FilePath currentPatchFile; QString currentPatchFileDisplayName; - QString currentFileDirectory; - QString currentFileTopLevel; + FilePath currentFileDirectory; + FilePath currentFileTopLevel; - QString currentProjectPath; + FilePath currentProjectPath; QString currentProjectName; - QString currentProjectTopLevel; + FilePath currentProjectTopLevel; }; void State::clearFile() @@ -218,15 +218,15 @@ QString StateListener::windowTitleVcsTopic(const FilePath &filePath) } if (searchPath.isEmpty()) return QString(); - QString topLevelPath; + FilePath topLevelPath; IVersionControl *vc = VcsManager::findVersionControlForDirectory( searchPath, &topLevelPath); - return (vc && !topLevelPath.isEmpty()) ? vc->vcsTopic(FilePath::fromString(topLevelPath)) : QString(); + return (vc && !topLevelPath.isEmpty()) ? vc->vcsTopic(topLevelPath) : QString(); } -static inline QString displayNameOfEditor(const QString &fileName) +static inline QString displayNameOfEditor(const FilePath &fileName) { - IDocument *document = DocumentModel::documentForFilePath(FilePath::fromString(fileName)); + IDocument *document = DocumentModel::documentForFilePath(fileName); if (document) return document->displayName(); return QString(); @@ -240,18 +240,16 @@ void StateListener::slotStateChanged() State state; IDocument *currentDocument = EditorManager::currentDocument(); if (currentDocument) { - state.currentFile = currentDocument->filePath().toString(); + state.currentFile = currentDocument->filePath(); if (state.currentFile.isEmpty() || currentDocument->isTemporary()) - state.currentFile = VcsBase::source(currentDocument); + state.currentFile = FilePath::fromString(VcsBase::source(currentDocument)); } // Get the file and its control. Do not use the file unless we find one IVersionControl *fileControl = nullptr; if (!state.currentFile.isEmpty()) { - QFileInfo currentFi(state.currentFile); - - if (currentFi.exists()) { + if (state.currentFile.exists()) { // Quick check: Does it look like a patch? const bool isPatch = state.currentFile.endsWith(".patch") || state.currentFile.endsWith(".diff"); @@ -261,18 +259,18 @@ void StateListener::slotStateChanged() state.currentPatchFile = state.currentFile; state.currentPatchFileDisplayName = displayNameOfEditor(state.currentPatchFile); if (state.currentPatchFileDisplayName.isEmpty()) - state.currentPatchFileDisplayName = currentFi.fileName(); + state.currentPatchFileDisplayName = state.currentFile.fileName(); } - if (currentFi.isDir()) { + if (state.currentFile.isDir()) { state.currentFile.clear(); - state.currentFileDirectory = currentFi.absoluteFilePath(); + state.currentFileDirectory = state.currentFile.absoluteFilePath(); } else { - state.currentFileDirectory = currentFi.absolutePath(); - state.currentFileName = currentFi.fileName(); + state.currentFileDirectory = state.currentFile.absolutePath(); + state.currentFileName = state.currentFile.fileName(); } fileControl = VcsManager::findVersionControlForDirectory( - FilePath::fromString(state.currentFileDirectory), &state.currentFileTopLevel); + state.currentFileDirectory, &state.currentFileTopLevel); } if (!fileControl) @@ -286,10 +284,10 @@ void StateListener::slotStateChanged() currentProject = SessionManager::startupProject(); if (currentProject) { - state.currentProjectPath = currentProject->projectDirectory().toString(); + state.currentProjectPath = currentProject->projectDirectory(); state.currentProjectName = currentProject->displayName(); projectControl = VcsManager::findVersionControlForDirectory( - FilePath::fromString(state.currentProjectPath), &state.currentProjectTopLevel); + state.currentProjectPath, &state.currentProjectTopLevel); if (projectControl) { // If we have both, let the file's one take preference if (fileControl && projectControl != fileControl) @@ -353,7 +351,7 @@ VcsBasePluginState &VcsBasePluginState::operator=(const VcsBasePluginState &rhs) QString VcsBasePluginState::currentFile() const { - return data->m_state.currentFile; + return data->m_state.currentFile.toString(); } QString VcsBasePluginState::currentFileName() const @@ -363,23 +361,23 @@ QString VcsBasePluginState::currentFileName() const FilePath VcsBasePluginState::currentFileTopLevel() const { - return FilePath::fromString(data->m_state.currentFileTopLevel); + return data->m_state.currentFileTopLevel; } FilePath VcsBasePluginState::currentFileDirectory() const { - return FilePath::fromString(data->m_state.currentFileDirectory); + return data->m_state.currentFileDirectory; } QString VcsBasePluginState::relativeCurrentFile() const { - QTC_ASSERT(hasFile(), return QString()); - return QDir(data->m_state.currentFileTopLevel).relativeFilePath(data->m_state.currentFile); + QTC_ASSERT(hasFile(), return {}); + return data->m_state.currentFile.relativePath(data->m_state.currentFileTopLevel).toString(); } QString VcsBasePluginState::currentPatchFile() const { - return data->m_state.currentPatchFile; + return data->m_state.currentPatchFile.toString(); } QString VcsBasePluginState::currentPatchFileDisplayName() const @@ -389,7 +387,7 @@ QString VcsBasePluginState::currentPatchFileDisplayName() const FilePath VcsBasePluginState::currentProjectPath() const { - return FilePath::fromString(data->m_state.currentProjectPath); + return data->m_state.currentProjectPath; } QString VcsBasePluginState::currentProjectName() const @@ -399,15 +397,15 @@ QString VcsBasePluginState::currentProjectName() const FilePath VcsBasePluginState::currentProjectTopLevel() const { - return FilePath::fromString(data->m_state.currentProjectTopLevel); + return data->m_state.currentProjectTopLevel; } QString VcsBasePluginState::relativeCurrentProject() const { QTC_ASSERT(hasProject(), return QString()); - if (data->m_state.currentProjectTopLevel != data->m_state.currentProjectPath) - return QDir(data->m_state.currentProjectTopLevel).relativeFilePath(data->m_state.currentProjectPath); - return QString(); + if (data->m_state.currentProjectTopLevel == data->m_state.currentProjectPath) + return {}; + return data->m_state.currentProjectPath.relativePath(data->m_state.currentProjectTopLevel).toString(); } bool VcsBasePluginState::hasTopLevel() const @@ -417,7 +415,7 @@ bool VcsBasePluginState::hasTopLevel() const FilePath VcsBasePluginState::topLevel() const { - return FilePath::fromString(hasFile() ? data->m_state.currentFileTopLevel : data->m_state.currentProjectTopLevel); + return hasFile() ? data->m_state.currentFileTopLevel : data->m_state.currentProjectTopLevel; } bool VcsBasePluginState::equals(const Internal::State &rhs) const diff --git a/src/plugins/vcsbase/vcsoutputwindow.cpp b/src/plugins/vcsbase/vcsoutputwindow.cpp index b6911cdcd35..e0c7c3b5568 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsoutputwindow.cpp @@ -163,7 +163,7 @@ void OutputWindowPlainTextEdit::contextMenuEvent(QContextMenuEvent *event) if (repo.isFile()) { menu->addSeparator(); openAction = menu->addAction(VcsOutputWindow::tr("Open \"%1\"").arg(repo.nativePath())); - openAction->setData(repo.absoluteFilePath().toString()); + openAction->setData(repo.absoluteFilePath().toVariant()); } } QAction *clearAction = nullptr; diff --git a/src/plugins/vcsbase/vcsplugin.cpp b/src/plugins/vcsbase/vcsplugin.cpp index dd81f84a555..60343d27a8e 100644 --- a/src/plugins/vcsbase/vcsplugin.cpp +++ b/src/plugins/vcsbase/vcsplugin.cpp @@ -95,10 +95,10 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage) tr("The current version control topic (branch or tag) identification of the current project."), []() -> QString { IVersionControl *vc = nullptr; - QString topLevel; + FilePath topLevel; if (Project *project = ProjectTree::currentProject()) vc = VcsManager::findVersionControlForDirectory(project->projectDirectory(), &topLevel); - return vc ? vc->vcsTopic(FilePath::fromString(topLevel)) : QString(); + return vc ? vc->vcsTopic(topLevel) : QString(); }); expander->registerVariable(Constants::VAR_VCS_TOPLEVELPATH, diff --git a/src/plugins/webassembly/webassemblydevice.cpp b/src/plugins/webassembly/webassemblydevice.cpp index ca5e0f2a1ce..86611d6f91e 100644 --- a/src/plugins/webassembly/webassemblydevice.cpp +++ b/src/plugins/webassembly/webassemblydevice.cpp @@ -3,6 +3,7 @@ #include "webassemblyconstants.h" #include "webassemblydevice.h" +#include "webassemblytr.h" #include @@ -16,7 +17,7 @@ WebAssemblyDevice::WebAssemblyDevice() { setupId(IDevice::AutoDetected, Constants::WEBASSEMBLY_DEVICE_DEVICE_ID); setType(Constants::WEBASSEMBLY_DEVICE_TYPE); - const QString displayNameAndType = tr("Web Browser"); + const QString displayNameAndType = Tr::tr("Web Browser"); setDefaultDisplayName(displayNameAndType); setDisplayType(displayNameAndType); setDeviceState(IDevice::DeviceStateUnknown); @@ -26,13 +27,13 @@ WebAssemblyDevice::WebAssemblyDevice() IDevice::Ptr WebAssemblyDevice::create() { - return IDevice::Ptr(new WebAssemblyDevice); + return IDevicePtr(new WebAssemblyDevice); } WebAssemblyDeviceFactory::WebAssemblyDeviceFactory() : ProjectExplorer::IDeviceFactory(Constants::WEBASSEMBLY_DEVICE_TYPE) { - setDisplayName(WebAssemblyDevice::tr("WebAssembly Runtime")); + setDisplayName(Tr::tr("WebAssembly Runtime")); setCombinedIcon(":/webassembly/images/webassemblydevicesmall.png", ":/webassembly/images/webassemblydevice.png"); setConstructionFunction(&WebAssemblyDevice::create); diff --git a/src/plugins/webassembly/webassemblydevice.h b/src/plugins/webassembly/webassemblydevice.h index 5f66ed830e0..962c348e310 100644 --- a/src/plugins/webassembly/webassemblydevice.h +++ b/src/plugins/webassembly/webassemblydevice.h @@ -10,8 +10,6 @@ namespace Internal { class WebAssemblyDevice final : public ProjectExplorer::DesktopDevice { - Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyDevice) - public: static ProjectExplorer::IDevice::Ptr create(); diff --git a/src/plugins/webassembly/webassemblyoptionspage.cpp b/src/plugins/webassembly/webassemblyoptionspage.cpp index 85bcdf533e2..038d93ed110 100644 --- a/src/plugins/webassembly/webassemblyoptionspage.cpp +++ b/src/plugins/webassembly/webassemblyoptionspage.cpp @@ -6,6 +6,7 @@ #include "webassemblyoptionspage.h" #include "webassemblyqtversion.h" #include "webassemblytoolchain.h" +#include "webassemblytr.h" #include #include @@ -24,8 +25,6 @@ namespace Internal { class WebAssemblyOptionsWidget : public Core::IOptionsPageWidget { - Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyOptionsWidget) - public: WebAssemblyOptionsWidget(); @@ -47,18 +46,16 @@ WebAssemblyOptionsWidget::WebAssemblyOptionsWidget() auto mainLayout = new QVBoxLayout(this); { - auto pathChooserBox = new QGroupBox(tr("Emscripten SDK path:")); + auto pathChooserBox = new QGroupBox(Tr::tr("Emscripten SDK path:")); pathChooserBox->setFlat(true); auto layout = new QVBoxLayout(pathChooserBox); auto instruction = new QLabel( - tr("Select the root directory of an " - "" - "installed Emscripten SDK. Ensure that the activated SDK version is " - "compatible with the " - "Qt 5 " - "or " - "Qt 6 " - "version that you plan to develop against.")); + Tr::tr("Select the root directory of an installed %1. " + "Ensure that the activated SDK version is compatible with the %2 " + "or %3 version that you plan to develop against.") + .arg(R"(Emscripten SDK)") + .arg(R"(Qt 5)") + .arg(R"(Qt 6)")); instruction->setOpenExternalLinks(true); instruction->setWordWrap(true); @@ -78,7 +75,7 @@ WebAssemblyOptionsWidget::WebAssemblyOptionsWidget() } { - m_emSdkEnvGroupBox = new QGroupBox(tr("Emscripten SDK environment:")); + m_emSdkEnvGroupBox = new QGroupBox(Tr::tr("Emscripten SDK environment:")); m_emSdkEnvGroupBox->setFlat(true); m_emSdkEnvGroupBox->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding); auto layout = new QVBoxLayout(m_emSdkEnvGroupBox); @@ -95,8 +92,8 @@ WebAssemblyOptionsWidget::WebAssemblyOptionsWidget() const QString minimumSupportedQtVersion = WebAssemblyQtVersion::minimumSupportedQtVersion().toString(); m_qtVersionDisplay = new InfoLabel( - tr("Note: %1 supports Qt %2 for WebAssembly and higher. " - "Your installed lower version(s) are not supported.") + Tr::tr("Note: %1 supports Qt %2 for WebAssembly and higher. " + "Your installed lower Qt version(s) are not supported.") .arg(Core::ICore::versionString(), minimumSupportedQtVersion), InfoLabel::Warning); m_qtVersionDisplay->setElideMode(Qt::ElideNone); @@ -110,9 +107,10 @@ static QString environmentDisplay(const FilePath &sdkRoot) Environment env; WebAssemblyEmSdk::addToEnvironment(sdkRoot, env); QString result; - result.append(WebAssemblyOptionsWidget::tr("

Adding directories to PATH:

")); + auto h4 = [](const QString &text) { return QString("

" + text + "

"); }; + result.append(h4(Tr::tr("Adding directories to PATH:"))); result.append(env.value("PATH").replace(OsSpecificAspects::pathListSeparator(sdkRoot.osType()), "
")); - result.append(WebAssemblyOptionsWidget::tr("

Setting environment variables:

")); + result.append(h4(Tr::tr("Setting environment variables:"))); for (const QString &envVar : env.toStringList()) { if (!envVar.startsWith("PATH")) // Path was already printed out above result.append(envVar + "
"); @@ -135,12 +133,15 @@ void WebAssemblyOptionsWidget::updateStatus() const QVersionNumber minVersion = WebAssemblyToolChain::minimumSupportedEmSdkVersion(); const bool versionTooLow = sdkVersion < minVersion; m_emSdkVersionDisplay->setType(versionTooLow ? InfoLabel::NotOk : InfoLabel::Ok); + auto bold = [](const QString &text) { return QString("" + text + ""); }; m_emSdkVersionDisplay->setText( - versionTooLow ? tr("The activated version %1 is not supported by %2." - "
Activate version %3 or higher.") - .arg(sdkVersion.toString(), Core::ICore::versionString(), - minVersion.toString()) - : tr("Activated version: %1").arg(sdkVersion.toString())); + versionTooLow ? Tr::tr("The activated version %1 is not supported by %2. " + "Activate version %3 or higher.") + .arg(bold(sdkVersion.toString())) + .arg(bold(Core::ICore::versionString())) + .arg(bold(minVersion.toString())) + : Tr::tr("Activated version: %1") + .arg(bold(sdkVersion.toString()))); m_emSdkEnvDisplay->setText(environmentDisplay(sdkPath)); } @@ -165,7 +166,7 @@ void WebAssemblyOptionsWidget::apply() WebAssemblyOptionsPage::WebAssemblyOptionsPage() { setId(Id(Constants::SETTINGS_ID)); - setDisplayName(WebAssemblyOptionsWidget::tr("WebAssembly")); + setDisplayName(Tr::tr("WebAssembly")); setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); setWidgetCreator([] { return new WebAssemblyOptionsWidget; }); } diff --git a/src/plugins/webassembly/webassemblyplugin.cpp b/src/plugins/webassembly/webassemblyplugin.cpp index b59adcec7a4..7466208cbbd 100644 --- a/src/plugins/webassembly/webassemblyplugin.cpp +++ b/src/plugins/webassembly/webassemblyplugin.cpp @@ -1,13 +1,14 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 -#include "webassemblyplugin.h" #include "webassemblyconstants.h" #include "webassemblydevice.h" #include "webassemblyoptionspage.h" +#include "webassemblyplugin.h" #include "webassemblyqtversion.h" #include "webassemblyrunconfiguration.h" #include "webassemblytoolchain.h" +#include "webassemblytr.h" #include #include @@ -83,10 +84,10 @@ void WebAssemblyPlugin::askUserAboutEmSdkSetup() return; InfoBarEntry info(setupWebAssemblyEmSdk, - tr("Setup Emscripten SDK for WebAssembly? " + Tr::tr("Setup Emscripten SDK for WebAssembly? " "To do it later, select Edit > Preferences > Devices > WebAssembly."), InfoBarEntry::GlobalSuppression::Enabled); - info.addCustomButton(tr("Setup Emscripten SDK"), [setupWebAssemblyEmSdk] { + info.addCustomButton(Tr::tr("Setup Emscripten SDK"), [setupWebAssemblyEmSdk] { ICore::infoBar()->removeInfo(setupWebAssemblyEmSdk); QTimer::singleShot(0, []() { ICore::showOptionsDialog(Constants::SETTINGS_ID); }); }); diff --git a/src/plugins/webassembly/webassemblyqtversion.cpp b/src/plugins/webassembly/webassemblyqtversion.cpp index bb76a4a7fdd..28f155dd525 100644 --- a/src/plugins/webassembly/webassemblyqtversion.cpp +++ b/src/plugins/webassembly/webassemblyqtversion.cpp @@ -3,6 +3,7 @@ #include "webassemblyconstants.h" #include "webassemblyqtversion.h" +#include "webassemblytr.h" #include #include @@ -29,8 +30,7 @@ WebAssemblyQtVersion::WebAssemblyQtVersion() = default; QString WebAssemblyQtVersion::description() const { - return QCoreApplication::translate("WebAssemblyPlugin", "WebAssembly", - "Qt Version is meant for WebAssembly"); + return Tr::tr("WebAssembly", "Qt Version is meant for WebAssembly"); } QSet WebAssemblyQtVersion::targetDeviceTypes() const @@ -59,7 +59,7 @@ QString WebAssemblyQtVersion::invalidReason() const if (!baseReason.isEmpty()) return baseReason; - return tr("%1 does not support Qt for WebAssembly below version %2.") + return Tr::tr("%1 does not support Qt for WebAssembly below version %2.") .arg(Core::ICore::versionString()) .arg(minimumSupportedQtVersion().toString()); } diff --git a/src/plugins/webassembly/webassemblyqtversion.h b/src/plugins/webassembly/webassemblyqtversion.h index d7541154cd1..b7fee8a4536 100644 --- a/src/plugins/webassembly/webassemblyqtversion.h +++ b/src/plugins/webassembly/webassemblyqtversion.h @@ -11,8 +11,6 @@ namespace Internal { class WebAssemblyQtVersion : public QtSupport::QtVersion { - Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyQtVersion) - public: WebAssemblyQtVersion(); diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index 1b76826671c..bdbc58e7ed3 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -1,9 +1,10 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 -#include "webassemblyrunconfigurationaspects.h" -#include "webassemblyrunconfiguration.h" #include "webassemblyconstants.h" +#include "webassemblyrunconfiguration.h" +#include "webassemblyrunconfigurationaspects.h" +#include "webassemblytr.h" #include #include @@ -73,7 +74,7 @@ public: auto webBrowserAspect = addAspect(target); auto effectiveEmrunCall = addAspect(); - effectiveEmrunCall->setLabelText(EmrunRunConfigurationFactory::tr("Effective emrun call:")); + effectiveEmrunCall->setLabelText(Tr::tr("Effective emrun call:")); effectiveEmrunCall->setDisplayStyle(StringAspect::TextEditDisplay); effectiveEmrunCall->setReadOnly(true); diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.h b/src/plugins/webassembly/webassemblyrunconfiguration.h index 8019880c73d..d613cffe9fa 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.h +++ b/src/plugins/webassembly/webassemblyrunconfiguration.h @@ -11,8 +11,6 @@ namespace Internal { class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory { - Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::EmrunRunConfigurationFactory) - public: EmrunRunConfigurationFactory(); }; diff --git a/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp b/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp index f68d23ed221..8dbe9b3c183 100644 --- a/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp +++ b/src/plugins/webassembly/webassemblyrunconfigurationaspects.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "webassemblyrunconfigurationaspects.h" +#include "webassemblytr.h" #include #include @@ -34,7 +35,7 @@ static WebBrowserEntries parseEmrunOutput(const QByteArray &output) while (ts.readLineInto(&line)) { const QRegularExpressionMatch match = regExp.match(line); if (match.hasMatch()) - result << qMakePair(match.captured(1), match.captured(2).trimmed()); + result.push_back({match.captured(1), match.captured(2).trimmed()}); } return result; } @@ -42,7 +43,7 @@ static WebBrowserEntries parseEmrunOutput(const QByteArray &output) static WebBrowserEntries emrunBrowsers(ProjectExplorer::Target *target) { WebBrowserEntries result; - result.append(qMakePair(QString(), WebBrowserSelectionAspect::tr("Default Browser"))); + result.append(qMakePair(QString(), Tr::tr("Default Browser"))); if (auto bc = target->activeBuildConfiguration()) { const Utils::Environment environment = bc->environment(); const Utils::FilePath emrunPath = environment.searchInPath("emrun"); @@ -65,7 +66,7 @@ WebBrowserSelectionAspect::WebBrowserSelectionAspect(ProjectExplorer::Target *ta const int defaultIndex = qBound(0, m_availableBrowsers.count() - 1, 1); m_currentBrowser = m_availableBrowsers.at(defaultIndex).first; } - setDisplayName(tr("Web Browser")); + setDisplayName(Tr::tr("Web Browser")); setId("WebBrowserAspect"); setSettingsKey("RunConfiguration.WebBrowser"); @@ -83,7 +84,7 @@ void WebBrowserSelectionAspect::addToLayout(LayoutBuilder &builder) m_currentBrowser = m_webBrowserComboBox->currentData().toString(); emit changed(); }); - builder.addItems({tr("Web browser:"), m_webBrowserComboBox}); + builder.addItems({Tr::tr("Web browser:"), m_webBrowserComboBox}); } void WebBrowserSelectionAspect::fromMap(const QVariantMap &map) @@ -134,8 +135,8 @@ Even if your browser was not detected, you can use --browser /path/to/browser/ex )") << WebBrowserEntries({ - qMakePair(QLatin1String("firefox"), QLatin1String("Mozilla Firefox")), - qMakePair(QLatin1String("chrome"), QLatin1String("Google Chrome"))}); + {QLatin1String("firefox"), QLatin1String("Mozilla Firefox")}, + {QLatin1String("chrome"), QLatin1String("Google Chrome")}}); QTest::newRow("emsdk 2.0.14") << QByteArray( @@ -149,8 +150,8 @@ Even if your browser was not detected, you can use --browser /path/to/browser/ex )") << WebBrowserEntries({ - qMakePair(QLatin1String("firefox"), QLatin1String("Mozilla Firefox 96.0.0.8041")), - qMakePair(QLatin1String("chrome"), QLatin1String("Google Chrome 97.0.4692.71"))}); + {QLatin1String("firefox"), QLatin1String("Mozilla Firefox 96.0.0.8041")}, + {QLatin1String("chrome"), QLatin1String("Google Chrome 97.0.4692.71")}}); } #endif // WITH_TESTS diff --git a/src/plugins/webassembly/webassemblytoolchain.cpp b/src/plugins/webassembly/webassemblytoolchain.cpp index 2e224049504..bbed53e96df 100644 --- a/src/plugins/webassembly/webassemblytoolchain.cpp +++ b/src/plugins/webassembly/webassemblytoolchain.cpp @@ -1,9 +1,10 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 -#include "webassemblytoolchain.h" #include "webassemblyconstants.h" #include "webassemblyemsdk.h" +#include "webassemblytoolchain.h" +#include "webassemblytr.h" #include #include @@ -58,7 +59,7 @@ WebAssemblyToolChain::WebAssemblyToolChain() : { setSupportedAbis({toolChainAbi()}); setTargetAbi(toolChainAbi()); - setTypeDisplayName(tr("Emscripten Compiler")); + setTypeDisplayName(Tr::tr("Emscripten Compiler")); } FilePath WebAssemblyToolChain::makeCommand(const Environment &environment) const @@ -117,7 +118,7 @@ static Toolchains doAutoDetect(const ToolchainDetector &detector) const FilePath scriptFile = sdk.withNewPath(script).searchInDirectories(env.path()); toolChain->setCompilerCommand(scriptFile); - const QString displayName = WebAssemblyToolChain::tr("Emscripten Compiler %1 for %2") + const QString displayName = Tr::tr("Emscripten Compiler %1 for %2") .arg(toolChain->version(), QLatin1String(cLanguage ? "C" : "C++")); toolChain->setDisplayName(displayName); result.append(toolChain); @@ -159,7 +160,7 @@ bool WebAssemblyToolChain::areToolChainsRegistered() WebAssemblyToolChainFactory::WebAssemblyToolChainFactory() { - setDisplayName(WebAssemblyToolChain::tr("Emscripten")); + setDisplayName(Tr::tr("Emscripten")); setSupportedToolChainType(Constants::WEBASSEMBLY_TOOLCHAIN_TYPEID); setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID, ProjectExplorer::Constants::CXX_LANGUAGE_ID}); diff --git a/src/plugins/webassembly/webassemblytoolchain.h b/src/plugins/webassembly/webassemblytoolchain.h index 13d4d11009d..cc97573d93e 100644 --- a/src/plugins/webassembly/webassemblytoolchain.h +++ b/src/plugins/webassembly/webassemblytoolchain.h @@ -12,8 +12,6 @@ namespace Internal { class WebAssemblyToolChain final : public ProjectExplorer::GccToolChain { - Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyToolChain) - public: WebAssemblyToolChain(); diff --git a/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp b/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp index e7959540f21..45d5f51577e 100644 --- a/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp +++ b/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp @@ -311,13 +311,13 @@ void tst_ImportCheck::moduleMapping_data() QTest::newRow("check that QtQuick controls cannot be found with a mapping") << QString(TESTSRCDIR "/moduleMapping/importQtQuick.qml") << QString(TESTSRCDIR "/moduleMapping") - << StrStrHash({ std::make_pair(QStringLiteral("QtQuick.Controls"), QStringLiteral("MyControls")) }) + << StrStrHash({{QStringLiteral("QtQuick.Controls"), QStringLiteral("MyControls")}}) << QStringList({ "Item", "Button" }) << false; QTest::newRow("check that custom controls can be found with a mapping") << QString(TESTSRCDIR "/moduleMapping/importQtQuick.qml") << QString(TESTSRCDIR "/moduleMapping") - << StrStrHash({ std::make_pair(QStringLiteral("QtQuick.Controls"), QStringLiteral("MyControls")) }) + << StrStrHash({{QStringLiteral("QtQuick.Controls"), QStringLiteral("MyControls")}}) << QStringList({ "Item", "Oblong" }) // item is in QtQuick, and should still be found, as only // the QtQuick.Controls are redirected << true; diff --git a/tests/auto/utils/fileutils/tst_fileutils.cpp b/tests/auto/utils/fileutils/tst_fileutils.cpp index ddbbd5647b3..f93aa74a58d 100644 --- a/tests/auto/utils/fileutils/tst_fileutils.cpp +++ b/tests/auto/utils/fileutils/tst_fileutils.cpp @@ -498,6 +498,7 @@ void tst_fileutils::fromString_data() QTest::newRow("single-colon") << D(":", "", "", ":"); QTest::newRow("single-slash") << D("/", "", "", "/"); QTest::newRow("single-char") << D("a", "", "", "a"); + QTest::newRow("relative") << D("./rel", "", "", "./rel"); QTest::newRow("qrc") << D(":/test.txt", "", "", ":/test.txt"); QTest::newRow("qrc-no-slash") << D(":test.txt", "", "", ":test.txt"); @@ -520,6 +521,7 @@ void tst_fileutils::fromString_data() QTest::newRow("docker-root-url") << D("docker://1234/", "docker", "1234", "/"); QTest::newRow("docker-root-url-special-linux") << D("/__qtc_devices__/docker/1234/", "docker", "1234", "/"); QTest::newRow("docker-root-url-special-win") << D("c:/__qtc_devices__/docker/1234/", "docker", "1234", "/"); + QTest::newRow("docker-relative-path") << D("docker://1234/./rel", "docker", "1234", "rel"); QTest::newRow("qtc-dev-linux") << D("/__qtc_devices__", "", "", "/__qtc_devices__"); QTest::newRow("qtc-dev-win") << D("c:/__qtc_devices__", "", "", "c:/__qtc_devices__"); diff --git a/tests/manual/cmakepresets/CMakePresets.json b/tests/manual/cmakepresets/CMakePresets.json index 9af5b24cd40..64e5a6bc965 100644 --- a/tests/manual/cmakepresets/CMakePresets.json +++ b/tests/manual/cmakepresets/CMakePresets.json @@ -1,8 +1,8 @@ { - "version": 2, + "version": 3, "cmakeMinimumRequired": { "major": 3, - "minor": 20, + "minor": 21, "patch": 0 }, "configurePresets": [ @@ -15,6 +15,11 @@ "CMAKE_BUILD_TYPE": "Release", "CMAKE_PREFIX_PATH": "c:/Qt/6.3.2/mingw_64" }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, "environment": { "PATH": "c:/Qt/Tools/mingw1120_64/bin;$penv{PATH}" }, @@ -36,8 +41,29 @@ "architecture" : { "value": "x64" }, - "cacheVariables": { - "CMAKE_PREFIX_PATH": "c:/Qt/6.3.2/msvc2019_64" + "toolchainFile" : "c:/Qt/6.3.2/msvc2019_64/lib/cmake/Qt6/qt.toolchain.cmake", + "condition" : { + "type": "not", + "condition": { + "type": "notEquals", + "lhs": "${hostSystemName}", + "rhs": "$env{HOST_SYSTEM_NAME}" + } + }, + "environment" : { + "HOST_SYSTEM_NAME": "Windows" + } + }, + { + "name": "linux-gcc", + "displayName": "Linux GCC", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build-${presetName}", + "toolchainFile" : "$penv{HOME}/Qt/6.3.2/gcc_64/lib/cmake/Qt6/qt.toolchain.cmake", + "condition" : { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" } } ],