From af52b65d6a6b4fe50deb074474c55817c669556f Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 26 Feb 2020 08:07:28 +0100 Subject: [PATCH 01/29] Editor: Fix self recursive update The update rect should be identical to the calculated line rect when repainting the current line highlight. And the offset must not be calculated into the line rect since we just want to repaint the complete viewport width. Fixes: QTCREATORBUG-23647 Change-Id: I0656f0fee4823c8ff55c70b2a4cd69f0183e141d Reviewed-by: Eike Ziller --- src/plugins/texteditor/texteditor.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index a48d58d1261..43e125e2fcd 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4334,16 +4334,12 @@ void TextEditorWidgetPrivate::paintCurrentLineHighlight(const PaintEventData &da QRectF lineRect = data.block.layout()->lineForTextPosition(data.textCursor.positionInBlock()).rect(); lineRect.moveTop(lineRect.top() + blockRect.top()); lineRect.setLeft(0); - lineRect.setRight(data.viewportRect.width() - data.offset.x()); + lineRect.setRight(data.viewportRect.width()); QColor color = m_document->fontSettings().toTextCharFormat(C_CURRENT_LINE).background().color(); // set alpha, otherwise we cannot see block highlighting and find scope underneath color.setAlpha(128); - if (!data.eventRect.contains(lineRect.toRect())) { - QRect updateRect = data.eventRect; - updateRect.setLeft(0); - updateRect.setRight(data.viewportRect.width() - int(data.offset.x())); - q->viewport()->update(updateRect); - } + if (!data.eventRect.contains(lineRect.toRect())) + q->viewport()->update(lineRect.toRect()); painter.fillRect(lineRect, color); } From 4cd4316a16c15cb0344ddd2bc84f43483913340c Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 25 Feb 2020 11:24:03 +0100 Subject: [PATCH 02/29] Doc: Replace "pane" with "view" ...for anything listed in Window > Views, except "Output Pane". Task-number: QTCREATORBUG-23582 Change-Id: I1a46de22657dd5779d693a5078b5aca8b1b57a37 Reviewed-by: Thomas Hartmann --- doc/qtcreator/src/howto/creator-help.qdoc | 8 +++---- .../src/howto/creator-keyboard-shortcuts.qdoc | 10 ++++---- .../creator-projects-creating.qdoc | 10 ++++---- .../creator-projects-libraries.qdoc | 6 ++--- .../creator-mobile-app-tutorial.qdoc | 4 ++-- .../creator-only/qtquick-app-development.qdoc | 4 ++-- .../creator-only/qtquick-states-scxml.qdocinc | 4 ++-- .../src/qtquick/qtquick-buttons.qdoc | 12 +++++----- .../src/qtquick/qtquick-components.qdoc | 16 ++++++------- .../src/qtquick/qtquick-designer.qdoc | 10 ++++---- .../src/qtquick/qtquick-navigator.qdoc | 6 ++--- .../src/qtquick/qtquick-pathview-editor.qdoc | 4 ++-- .../src/qtquick/qtquick-properties.qdoc | 16 ++++++------- doc/qtcreator/src/qtquick/qtquick-states.qdoc | 24 +++++++++---------- doc/qtcreator/src/vcs/creator-vcs-git.qdoc | 4 ++-- .../src/widgets/qtdesigner-app-tutorial.qdoc | 8 +++---- doc/qtdesignstudio/examples/doc/loginui1.qdoc | 4 ++-- doc/qtdesignstudio/examples/doc/loginui3.qdoc | 6 ++--- doc/qtdesignstudio/examples/doc/loginui4.qdoc | 8 +++---- .../src/qtdesignstudio-components.qdocinc | 4 ++-- .../src/qtdesignstudio-prototyping.qdoc | 4 ++-- 21 files changed, 86 insertions(+), 86 deletions(-) diff --git a/doc/qtcreator/src/howto/creator-help.qdoc b/doc/qtcreator/src/howto/creator-help.qdoc index 7d8e7908bcc..bdfca10777f 100644 --- a/doc/qtcreator/src/howto/creator-help.qdoc +++ b/doc/qtcreator/src/howto/creator-help.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -51,7 +51,7 @@ \li To display the full help on a Qt class or function, press \key F1 or select \uicontrol {Context Help} in the context menu. The documentation is displayed in a - pane next to the code editor, or, if there is not enough vertical + view next to the code editor, or, if there is not enough vertical space, in the fullscreen \uicontrol Help mode. \li To select and configure how the documentation is displayed in the @@ -215,7 +215,7 @@ You can select the page to display when you open the \uicontrol Help mode in the \uicontrol Tools > \uicontrol Options > \uicontrol Help > \uicontrol General > \uicontrol {On help start} field. - To display the page and help panes that were open when you exited the mode, + To display the page and help views that were open when you exited the mode, select the \uicontrol {Show My Tabs from Last Session} option. However, Web pages are not opened, because loading them would slow down opening the \uicontrol Help mode. @@ -232,7 +232,7 @@ You can filter the documents displayed in the \uicontrol Help mode to find relevant information faster. Select a filter from a list of filters (1). The contents of the \uicontrol Index and \uicontrol Contents - pane in the sidebar change accordingly. + view in the sidebar change accordingly. \image qtcreator-help-filters.png "Help filters" diff --git a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc index 6fc434fdd71..59048bf5eec 100644 --- a/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc +++ b/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -239,14 +239,14 @@ Where the number is the number of the output pane. \if defined(qtcreator) \row - \li Activate \uicontrol Bookmarks pane + \li Activate \uicontrol Bookmarks view \li Alt+M \endif \row - \li Activate \uicontrol{File System} pane + \li Activate \uicontrol{File System} view \li Alt+Y \row - \li Activate \uicontrol{Open Documents} pane + \li Activate \uicontrol{Open Documents} view \li Alt+O \row \li Maximize output panes @@ -258,7 +258,7 @@ \li Move to previous item in output panes \li Shift+F6 \row - \li Activate \uicontrol Projects pane + \li Activate \uicontrol Projects view \li Alt+X \row \li Full screen diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index d84cfd537fa..2b249293704 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -434,16 +434,16 @@ \image qtcreator-new-opengl-file.png "New OpenGL file wizard" - \section2 Displaying Additional File Types in Projects Pane + \section2 Displaying Additional File Types in Projects View \QC determines whether to display files from the project folder - in the \uicontrol Projects pane depending on the file type (.pro, .pri, .cpp, + in the \uicontrol Projects view depending on the file type (.pro, .pri, .cpp, .h, .qrc, and so on). To display other types of files, edit the project file. Add filenames as values of the \c {DISTFILES} variable. You can also use wildcards. For example, the following code specifies that text files are displayed - in the \uicontrol Projects pane: + in the \uicontrol Projects view: \code @@ -478,7 +478,7 @@ {SUBDIRS variable}. It also adds all the necessary files for the subproject. To create more subprojects, right-click the project name in the - \uicontrol Projects pane to open the context menu, and select + \uicontrol Projects view to open the context menu, and select \uicontrol {New Subproject}. Follow the steps in the \uicontrol {New Subproject} wizard to create a subproject. @@ -489,7 +489,7 @@ In the file browser dialog, locate your subproject. To remove subprojects, right-click the project name in the \uicontrol Projects - pane, and select \uicontrol {Remove Subproject} in the context menu. + view, and select \uicontrol {Remove Subproject} in the context menu. To specify dependencies, use the \uicontrol{Add Library} wizard. For more information, see \l{Adding Libraries to Projects}. diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc index a29ea16293a..ff99faefaa2 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-libraries.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -88,7 +88,7 @@ \list 1 - \li In the \uicontrol Projects pane, right-click the project name to open the + \li In the \uicontrol Projects view, right-click the project name to open the context menu and select \uicontrol {Add Library}. @@ -122,7 +122,7 @@ \uicontrol {Project Management} dialog. In the \uicontrol {Add to project} list, select a project. For example, \b myapp. - \li In the \uicontrol Projects pane, right-click the project name to open the + \li In the \uicontrol Projects view, right-click the project name to open the context menu and select \uicontrol {Add Library > Internal Library > Next}. diff --git a/doc/qtcreator/src/qtquick/creator-only/creator-mobile-app-tutorial.qdoc b/doc/qtcreator/src/qtquick/creator-only/creator-mobile-app-tutorial.qdoc index 7165df0c4c6..7769b7501c7 100644 --- a/doc/qtcreator/src/qtquick/creator-only/creator-mobile-app-tutorial.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/creator-mobile-app-tutorial.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -109,7 +109,7 @@ \li In \uicontrol Library > \uicontrol Assets, select Bluebubble.svg and drag and drop it to \e mainWindow in the navigator. - \li In the \uicontrol Properties pane, \uicontrol Id field, enter + \li In the \uicontrol Properties view, \uicontrol Id field, enter \e bubble to be able to reference the image from other places. \li Select the \inlineimage export_unchecked.png diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-development.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-development.qdoc index 2fa9e55fb78..a7938078ab7 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-development.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-development.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -98,7 +98,7 @@ properties. Some properties, such as position, size, and visibility, are common to all QML types, whereas others are specific to the QML type. You can specify properties for your components in the - \uicontrol Properties pane. + \uicontrol Properties view. \li \l {Creating Animations} diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-states-scxml.qdocinc b/doc/qtcreator/src/qtquick/creator-only/qtquick-states-scxml.qdocinc index 6614ade1f34..ccbc2362290 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-states-scxml.qdocinc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-states-scxml.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -32,7 +32,7 @@ the state machine in the \uicontrol Backends tab in the Design mode, as described in \l {Managing C++ Backend Objects}. - In the \uicontrol States pane, you can edit the \c when condition of states + In the \uicontrol States view, you can edit the \c when condition of states to map QML states to the states of the SCXML state machine. For an example, see \l {Qt SCXML Traffic Light QML Example (Dynamic)}. diff --git a/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc b/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc index 104605a7b86..68e2aaadb81 100644 --- a/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -58,14 +58,14 @@ \li In the \uicontrol Navigator, select \uicontrol Item and set the width (\uicontrol W) and height (\uicontrol H) of the button in the - \uicontrol Properties pane. + \uicontrol Properties view. \li Drag and drop a \uicontrol Rectangle from the \uicontrol Library to the item in the navigator. This creates a nested item where the item is the parent of the rectangle. Items are positioned relative to their parents. - \li In the \uicontrol Properties pane, modify the appearance of the + \li In the \uicontrol Properties view, modify the appearance of the rectangle: \list a @@ -85,7 +85,7 @@ \li Drag and drop a \uicontrol {Text} type to the item in the navigator. - \li In the \uicontrol Properties pane, edit the properties of the \uicontrol Text + \li In the \uicontrol Properties view, edit the properties of the \uicontrol Text type. \list a @@ -167,7 +167,7 @@ \li In the \uicontrol Navigator, select \uicontrol Item and set the width (\uicontrol W) and height (\uicontrol H) of the button in the - \uicontrol Properties pane. + \uicontrol Properties view. \li Select \uicontrol Connections > \uicontrol {Properties} > \uicontrol Add to add properties for the item: @@ -193,7 +193,7 @@ navigator. \li In the navigator, select a border image to specify settings for it - in the \uicontrol Properties pane: + in the \uicontrol Properties view: \list a diff --git a/doc/qtcreator/src/qtquick/qtquick-components.qdoc b/doc/qtcreator/src/qtquick/qtquick-components.qdoc index fac448c820a..f2e3f922a11 100644 --- a/doc/qtcreator/src/qtquick/qtquick-components.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-components.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -47,7 +47,7 @@ is generally defined in its own QML file. You can import components to applications. - The \uicontrol {Library} pane lists the available QML types, UI + The \uicontrol {Library} view lists the available QML types, UI components, assets, and QML imports. \image qmldesigner-qml-components.png "QML Components" @@ -77,13 +77,13 @@ \li Drag and drop components from the \uicontrol Library (2) to the \uicontrol Navigator (3) or \uicontrol {Form Editor} (1). \li Select components in the \uicontrol Navigator to edit their - properties in the \uicontrol Properties pane (4). For more + properties in the \uicontrol Properties view (4). For more information, see \l {Specifying Item Properties}. \li Connect components to signals or create bindings between components - in the \uicontrol Connections pane (5). For more information, see + in the \uicontrol Connections view (5). For more information, see \l{Adding Connections}. \li Add states to apply sets of changes to the properties of one or - several components in the \uicontrol States pane (6). For more + several components in the \uicontrol States view (6). For more information, see \l{Adding States}. \endlist @@ -135,7 +135,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. - You can edit item properties in the \uicontrol Properties pane or + You can edit item properties in the \uicontrol Properties view or in the \uicontrol {Text Editor}. You can also replace the default model and delegate with other, more complex models and delegates in the \uicontrol {Text Editor}. \l{ItemDelegate}{Item Delegate} and @@ -212,7 +212,7 @@ invisible \e anchor lines: top, bottom, left, right, fill, horizontal center, vertical center, and baseline. - In the \uicontrol Layout pane you can set anchors and margins for items. To + In the \uicontrol Layout tab you can set anchors and margins for items. To set the anchors of an item, click the anchor buttons. You can combine the top/bottom, left/right, and horizontal/vertical anchors to anchor items in the corners of the parent item or center them horizontally or vertically @@ -558,7 +558,7 @@ \li Drag and drop a QML type from the \uicontrol Library to the \uicontrol Navigator or \uicontrol {Form Editor}. - \li Edit its properties in the \uicontrol Properties pane. + \li Edit its properties in the \uicontrol Properties view. The available properties depend on the QML type. diff --git a/doc/qtcreator/src/qtquick/qtquick-designer.qdoc b/doc/qtcreator/src/qtquick/qtquick-designer.qdoc index c1d2cb3fa12..6666f421ddc 100644 --- a/doc/qtcreator/src/qtquick/qtquick-designer.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-designer.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -102,13 +102,13 @@ \endlist - \li \uicontrol {States} pane (6) displays the different states of the item. + \li \uicontrol {States} view (6) displays the different states of the item. QML states typically describe user interface configurations, such as the UI controls, their properties and behavior and the available actions. For more information, see \l{Adding States}. \if defined(qtdesignstudio) - \li \uicontrol Timeline pane (7) provides a timeline and keyframe based + \li \uicontrol Timeline view (7) provides a timeline and keyframe based editor that enables you to animate the properties of UI components. \endif @@ -165,9 +165,9 @@ To experiment with different component sizes, enter values in the \uicontrol {Override Width} and \uicontrol {Override Height} fields (1) on the canvas toolbar. The changes are displayed on the canvas (2) - and in the \uicontrol States pane (3), but the property + and in the \uicontrol States view (3), but the property values are not changed permanently in the QML file. You can permanently - change the property values in the \uicontrol Properties pane (4). + change the property values in the \uicontrol Properties view (4). \image qmldesigner-preview-size.png "Canvas width and height" diff --git a/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc b/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc index db8921630cb..5ae3344d4f9 100644 --- a/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -38,7 +38,7 @@ \image qmldesigner-navigator.png "Navigator" You can select items in the \uicontrol Navigator to edit their properties - in the \uicontrol Properties pane. Items can access the properties of their + in the \uicontrol Properties view. Items can access the properties of their parent item. To select items on the canvas, right-click an item, and select another type in the context menu. @@ -55,7 +55,7 @@ To show and hide items on the canvas when focusing on specific parts of the application, click \inlineimage eye_open.png . To change the visibility of an item in the application code, select the - \uicontrol Visibility check box in the \uicontrol Properties pane or select + \uicontrol Visibility check box in the \uicontrol Properties view or select \uicontrol Edit > \uicontrol Visibility in the context menu. You can also set the \uicontrol Opacity field to 0 to hide items that you diff --git a/doc/qtcreator/src/qtquick/qtquick-pathview-editor.qdoc b/doc/qtcreator/src/qtquick/qtquick-pathview-editor.qdoc index 41b5bb02e96..489a84da257 100644 --- a/doc/qtcreator/src/qtquick/qtquick-pathview-editor.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-pathview-editor.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -59,7 +59,7 @@ To add intermediary points to a curve segment, select \uicontrol {Split Segment} in the context menu. - In the \uicontrol Properties pane, you can specify other properties for + In the \uicontrol Properties view, you can specify other properties for the path view. For example, what is the maximum distance from the path that initiates mouse dragging and what is the rate at which a flick will decelerate. diff --git a/doc/qtcreator/src/qtquick/qtquick-properties.qdoc b/doc/qtcreator/src/qtquick/qtquick-properties.qdoc index e0995815f12..3f6ef08d6aa 100644 --- a/doc/qtcreator/src/qtquick/qtquick-properties.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-properties.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -35,19 +35,19 @@ \title Specifying Item Properties - The \uicontrol Properties pane displays all the properties of the selected - item. The properties are grouped by type. The top part of the pane displays + The \uicontrol Properties view displays all the properties of the selected + item. The properties are grouped by type. The top part of the view displays properties that are common to all QML types, such as position, size, and visibility. - The bottom part of the pane displays properties that are specific to each + The bottom part of the view displays properties that are specific to each QML type. For example, the following image displays the properties you can set for \uicontrol Rectangle (1) and \uicontrol Text (2) items. \image qmldesigner-element-properties.png To change the item type, double-click the \uicontrol Type field in the - \uicontrol Properties pane, and enter the name of another QML type in the + \uicontrol Properties view, and enter the name of another QML type in the field. If you have specified properties for the item that are not supported for the new type, the type cannot be changed and an error message is displayed. Select the \inlineimage icons/action-icon.png @@ -130,7 +130,7 @@ \section1 Picking Colors To specify the color of the selected item in the color picker view (1), - select the color picker icon (2) in the \uicontrol Properties pane. + select the color picker icon (2) in the \uicontrol Properties view. \image qtquick-designer-color-picker.png "Color Picker view" @@ -163,7 +163,7 @@ \section1 Marking Text Items for Translation To support translators, mark each text item that should be translated. - In the \uicontrol Properties pane, \uicontrol Text field, select \uicontrol tr (1). + In the \uicontrol Properties view, \uicontrol Text field, select \uicontrol tr (1). \image qmldesigner-text-property-tr.png "Text properties" @@ -281,7 +281,7 @@ \section1 Building Transformations on Items - The \uicontrol Advanced pane allows you to configure advanced + The \uicontrol Advanced tab allows you to configure advanced transformations, such as rotation, scale, and translation. You can assign any number of transformations to an item. Each transformation is applied in order, one at a time. diff --git a/doc/qtcreator/src/qtquick/qtquick-states.qdoc b/doc/qtcreator/src/qtquick/qtquick-states.qdoc index 5a40828f766..d836643191e 100644 --- a/doc/qtcreator/src/qtquick/qtquick-states.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-states.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -62,12 +62,12 @@ \li Show a different view. \endlist - The \uicontrol States pane displays the different \l{State}{states} - of the component in the Design mode. The \uicontrol States pane is + The \uicontrol States view displays the different \l{State}{states} + of the component in the Design mode. The \uicontrol States view is collapsed by default to save space. Select \uicontrol Expand in - the context menu to view the whole pane. + the context menu to view the whole view. - \image qmldesigner-transitions.png "States pane" + \image qmldesigner-transitions.png "States view" To add states, click the \inlineimage plus.png button. Then modify the new state in the editor. For example, to change the @@ -86,9 +86,9 @@ a button is pressed, you could select a button component and its pressed property. - \image qtquick-states-binding-editor.png "Binding editor in States pane" + \image qtquick-states-binding-editor.png "Binding editor in States view" - You can preview the states in the \uicontrol States pane and click them to + You can preview the states in the \uicontrol States view and click them to switch between states on the canvas. \section1 Using States @@ -97,11 +97,11 @@ controls, their properties and behavior and the available actions. For example, you can use states to create two views. - To add states, click the empty slot in the \uicontrol States pane. + To add states, click the empty slot in the \uicontrol States view. Then modify the new state in the \uicontrol {Form Editor} or the - \uicontrol Properties pane. + \uicontrol Properties view. - \image qmldesigner-states.png "States pane" + \image qmldesigner-states.png "States view" The properties that you change in a state are highlighted with blue color. In the \uicontrol {Text Editor}, you can see the changes recorded as changes @@ -130,9 +130,9 @@ (1). While you work on one view, you can click the \inlineimage eye_open.png icon to hide items on the canvas that are not part of a view. - \li In the \uicontrol States pane, click the empty slot to create a + \li In the \uicontrol States view, click the empty slot to create a new state and give it a name. For example, \c Normal. - \li In the \uicontrol Properties pane (2), deselect the + \li In the \uicontrol Properties view (2), deselect the \uicontrol Visibility check box or set \uicontrol Opacity to 0 for each item that is not needed in this view. If you specify the setting for the parent item, all child items inherit it and diff --git a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc index ec6b1a2ebe0..ca1512bb9eb 100644 --- a/doc/qtcreator/src/vcs/creator-vcs-git.qdoc +++ b/doc/qtcreator/src/vcs/creator-vcs-git.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -189,7 +189,7 @@ The \uicontrol {Diff Selected Files} button brings up a diff view of the files selected in the file list. Since the commit page is just another editor, you can go back to it by closing the diff view. You can also switch - to an open diff view by selecting it in the \uicontrol {Open Documents} pane + to an open diff view by selecting it in the \uicontrol {Open Documents} view in the sidebar. \section2 Amending Commits diff --git a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc index cef1c5a1bab..cca4674da38 100644 --- a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc +++ b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -157,7 +157,7 @@ \li Double-click the \uicontrol{Push Button} widget and enter the text \b{Find}. - \li In the \uicontrol Properties pane, change the \uicontrol objectName to + \li In the \uicontrol Properties view, change the \uicontrol objectName to \b findButton. \image qtcreator-textfinder-objectname.png "Changing object names" @@ -216,7 +216,7 @@ \list 1 - \li In the \uicontrol{Projects} pane in the \uicontrol {Edit view}, double-click the + \li In the \uicontrol{Projects} view in the \uicontrol {Edit view}, double-click the \c{textfinder.h} file to open it for editing. \li Add a private function to the \c{private} section, after the @@ -234,7 +234,7 @@ \list 1 - \li In the \uicontrol{Projects} pane in the \uicontrol Edit view, double-click the + \li In the \uicontrol{Projects} view in the \uicontrol Edit view, double-click the textfinder.cpp file to open it for editing. \li Add code to load a text file using QFile, read it with QTextStream, diff --git a/doc/qtdesignstudio/examples/doc/loginui1.qdoc b/doc/qtdesignstudio/examples/doc/loginui1.qdoc index 18a7d8d4994..3be68658aa2 100644 --- a/doc/qtdesignstudio/examples/doc/loginui1.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui1.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Design Studio documentation. @@ -79,7 +79,7 @@ \QDS creates a set of boilerplate files and folders that you need to create a UI using Qt Quick and QML. The files are listed in the \uicontrol Project - tab in the \uicontrol Navigator and in the \uicontrol Projects pane. For + tab in the \uicontrol Navigator and in the \uicontrol Projects view. For more information, see \l {Viewing Project Files}. \image loginui1-project-files.png diff --git a/doc/qtdesignstudio/examples/doc/loginui3.qdoc b/doc/qtdesignstudio/examples/doc/loginui3.qdoc index 1bfa856b3e4..e4b143a7a6f 100644 --- a/doc/qtdesignstudio/examples/doc/loginui3.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui3.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Design Studio documentation. @@ -117,9 +117,9 @@ components on the canvas: \list 1 - \li In the \uicontrol States pane, select the \inlineimage plus.png + \li In the \uicontrol States view, select the \inlineimage plus.png button. - \image loginui3-login-state.png "States pane" + \image loginui3-login-state.png "States view" \li Enter \e loginState as the state name. \li Select \e verifyPasswordField in the \uicontrol Navigator, and deselect the \uicontrol Visibility check box in diff --git a/doc/qtdesignstudio/examples/doc/loginui4.qdoc b/doc/qtdesignstudio/examples/doc/loginui4.qdoc index 66fd5886c55..93204d05f35 100644 --- a/doc/qtdesignstudio/examples/doc/loginui4.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui4.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Design Studio documentation. @@ -85,7 +85,7 @@ \list 1 \li Open \e {Screen01.ui.qml} in the Design mode for editing. - \li In the \uicontrol States pane, select the \inlineimage close.png + \li In the \uicontrol States view, select the \inlineimage close.png (\uicontrol Close) button in \e loginState and \e registerState to remove the states. \li In the \uicontrol {Text Editor}, remove the following line: @@ -259,11 +259,11 @@ \section1 Binding Animation to States You will now bring back the \l{Adding States}{states} in the - \uicontrol States pane and bind them to the animation settings + \uicontrol States view and bind them to the animation settings in the \uicontrol Timeline view: \list 1 - \li In the \uicontrol States pane, select the \inlineimage plus.png + \li In the \uicontrol States view, select the \inlineimage plus.png button twice to add two states called \e loginState and \e registerState. You don't need to make any property changes this time, because you'll bind the states to property animations. diff --git a/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc b/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc index 71857f95a7a..808872eef01 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc +++ b/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Design Studio documentation. @@ -70,7 +70,7 @@ \note Components are listed in the \uicontrol {QML Components} section of the \uicontrol Library only if the filename begins with a capital letter. - \li Edit component properties in the \uicontrol Properties pane. + \li Edit component properties in the \uicontrol Properties view. The available properties depend on the QML type. \endlist diff --git a/doc/qtdesignstudio/src/qtdesignstudio-prototyping.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-prototyping.qdoc index df42f2fca0b..d511c23359f 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-prototyping.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-prototyping.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Design Studio documentation. @@ -72,7 +72,7 @@ properties. Some properties, such as position, size, and visibility, are common to all QML types, whereas others are specific to the QML type. You can specify properties for your components in the - \uicontrol Properties pane. + \uicontrol Properties view. \li \l {Using Custom Fonts} From 1f37eaa26585263f528d40aeaa6589f17ebe263d Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 26 Feb 2020 08:50:43 +0100 Subject: [PATCH 03/29] Editor: Fix crash in codeassist We have to report back to the code assistant even if we have no results. Otherwise the processors aren't correctly reset and may be called after deletion. Change-Id: Id7af2e0ee9f631efc00beb2a84bfe1824e138d24 Reviewed-by: Christian Stenger --- .../clangcodemodel/clangcompletionassistprocessor.cpp | 5 ++++- .../languageclient/languageclientcompletionassist.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp index 09f5ee95075..592f7c8795c 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp @@ -215,8 +215,11 @@ void ClangCompletionAssistProcessor::handleAvailableCompletions(const CodeComple return; } - if (!m_fallbackToNormalCompletion) + if (!m_fallbackToNormalCompletion) { + // We must report back to the code assistant under all circumstances + setAsyncProposalAvailable(nullptr); return; + } // else: Proceed with a normal completion in case: // 1) it was not a function call, but e.g. a function declaration like "void f(" // 2) '{' meant not a constructor call. diff --git a/src/plugins/languageclient/languageclientcompletionassist.cpp b/src/plugins/languageclient/languageclientcompletionassist.cpp index ae2eca2ff63..54b9740809c 100644 --- a/src/plugins/languageclient/languageclientcompletionassist.cpp +++ b/src/plugins/languageclient/languageclientcompletionassist.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -361,6 +362,9 @@ void LanguageClientCompletionAssistProcessor::cancel() void LanguageClientCompletionAssistProcessor::handleCompletionResponse( const CompletionRequest::Response &response) { + LanguageClientCompletionProposal *proposal = nullptr; + // We must report back to the code assistant under all circumstances + Utils::ExecuteOnDestruction eod([this, proposal]() { setAsyncProposalAvailable(proposal); }); qCDebug(LOGLSPCOMPLETION) << QTime::currentTime() << " : got completions"; m_currentRequest = MessageId(); QTC_ASSERT(m_client, return); @@ -383,12 +387,11 @@ void LanguageClientCompletionAssistProcessor::handleCompletionResponse( model->loadContent(Utils::transform(items, [](const CompletionItem &item){ return static_cast(new LanguageClientCompletionItem(item)); })); - auto proposal = new LanguageClientCompletionProposal(m_pos, model); + proposal = new LanguageClientCompletionProposal(m_pos, model); proposal->m_document = m_document; proposal->m_pos = m_pos; proposal->setFragile(true); proposal->setSupportsPrefix(false); - setAsyncProposalAvailable(proposal); qCDebug(LOGLSPCOMPLETION) << QTime::currentTime() << " : " << items.count() << " completions handled"; } From 72d57083882a8dfb22b9235fa968bb2ae6d03869 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 25 Feb 2020 18:02:59 +0100 Subject: [PATCH 04/29] More change log for 4.12 Change-Id: I4a3302b95561fb99650d8c29fdedc4f629139567 Reviewed-by: Leena Miettinen --- dist/changes-4.12.0.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.12.0.md b/dist/changes-4.12.0.md index 3ff61f12893..ccdca281858 100644 --- a/dist/changes-4.12.0.md +++ b/dist/changes-4.12.0.md @@ -35,15 +35,16 @@ Editing * Added `Go to Last Edit` * Added option for default line terminator style (QTCREATORBUG-3590) -* Improved performance of syntax highlighting (QTCREATORBUG-23281) * Fixed that wizards ignored default file encoding * Fixed that only restricted number of sizes were allowed for font size (QTCREATORBUG-22536) +* Fixed completion after undo (QTCREATORBUG-15038) ### Language Client * Added support for Markdown in tooltips * Added support for auto-formatting * Added outline dropdown (QTCREATORBUG-21916) +* Improved protocol error reporting * Fixed `Ctrl-click` for `Follow Symbol Under Cursor` (QTCREATORBUG-21848) ### QML @@ -93,6 +94,7 @@ Projects * Added automatic registration of CMake documentation, if available (QTCREATORBUG-21338) * Fixed issues with `snap` on Ubuntu Linux (QTCREATORBUG-23376) * Fixed handling of `Enable QML` in debugger settings (QTCREATORBUG-23541) +* Fixed unneeded reparsing of files ### Qbs @@ -122,6 +124,8 @@ Debugging --------- * Added option to hide columns from views (QTCREATORBUG-23342) +* Added option for `init` and `reset` GDB commands when attaching to remote server +* Fixed pretty printer for `std::optional` (QTCREATORBUG-22436) Analyzer -------- @@ -149,6 +153,7 @@ Qt Quick Designer ----------------- * Added locking and pinning of animation curves (QDS-550, QDS-551) +* Added support for annotations (QDS-39) * Fixed dragging of keyframes in curve editor (QDS-1405) Version Control Systems @@ -159,6 +164,8 @@ Version Control Systems * Added option to create branch when trying to push to a non-existing branch (QTCREATORBUG-21154) * Added option to start interactive rebase from log view (QTCREATORBUG-11200) * Added information about upstream status to `Git Branches` view +* Added option to `grep` and `pickaxe` git log (QTCREATORBUG-22512) +* Made references in VCS output view clickable (QTCREATORBUG-16477) Test Integration ---------------- @@ -184,8 +191,15 @@ Platforms * Added auto-detection of Java JDK (QTCREATORBUG-23407) * Added option to automatically download and install required Android tools (QTCREATORBUG-23285) +* Added automatic selection of correct NDK for Qt version (QTCREATORBUG-23583) +* Added support for Android 11 with API level 30 +* Improved examples browser to only show items tagged with `android` (QTBUG-80716) * Fixed several issues with AVD manager (QTCREATORBUG-23284, QTCREATORBUG-23448) +### iOS + +* Improved examples browser to only show items tagged with `ios` + ### Remote Linux * Added option to use custom command for install step (QTCREATORBUG-23320) From 4422805cec9e6568f060a7379805b9544b537730 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 24 Feb 2020 10:37:40 +0100 Subject: [PATCH 05/29] Dumper: replace xrange with range Change-Id: I09b3dd4da548643e927dbc5bb3130c28a746396b Reviewed-by: Eike Ziller --- share/qtcreator/debugger/cdbbridge.py | 2 +- share/qtcreator/debugger/dumper.py | 15 +++++++-------- share/qtcreator/debugger/gdbbridge.py | 2 +- share/qtcreator/debugger/lldbbridge.py | 20 ++++++++++---------- share/qtcreator/debugger/misctypes.py | 12 ++++++------ share/qtcreator/debugger/qttypes.py | 12 ++++++------ share/qtcreator/debugger/stdtypes.py | 2 +- 7 files changed, 32 insertions(+), 33 deletions(-) diff --git a/share/qtcreator/debugger/cdbbridge.py b/share/qtcreator/debugger/cdbbridge.py index ad63a19b388..ec55b183124 100644 --- a/share/qtcreator/debugger/cdbbridge.py +++ b/share/qtcreator/debugger/cdbbridge.py @@ -353,7 +353,7 @@ class Dumper(DumperBase): def putVTableChildren(self, item, itemCount): p = item.address() - for i in xrange(itemCount): + for i in range(itemCount): deref = self.extractPointer(p) if deref == 0: n = i diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 6b0416c563d..b292b145df3 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -48,7 +48,6 @@ except ModuleNotFoundError: if sys.version_info[0] >= 3: - xrange = range toInteger = int else: toInteger = long @@ -306,8 +305,8 @@ class DumperBase: def childRange(self): if self.currentMaxNumChild is None: - return xrange(0, self.currentNumChild) - return xrange(min(self.currentMaxNumChild, self.currentNumChild)) + return range(0, self.currentNumChild) + return range(min(self.currentMaxNumChild, self.currentNumChild)) def enterSubItem(self, item): if self.useTimeStamps: @@ -820,7 +819,7 @@ class DumperBase: def putVTableChildren(self, item, itemCount): p = item.pointer() - for i in xrange(itemCount): + for i in range(itemCount): deref = self.extractPointer(p) if deref == 0: itemCount = i @@ -901,7 +900,7 @@ class DumperBase: self.warn('REDUCING READING MAXIMUM TO %s' % maximum) #DumperBase.warn('BASE: 0x%x TSIZE: %s MAX: %s' % (base, tsize, maximum)) - for i in xrange(0, maximum, tsize): + for i in range(0, maximum, tsize): t = struct.unpack_from(code, blob, i)[0] if t == 0: return 0, i, self.hexencode(blob[:i]) @@ -2090,7 +2089,7 @@ class DumperBase: base = self.extractPointer(connections) data, size, alloc = self.vectorDataHelper(base) connectionType = self.createType('@QObjectPrivate::Connection') - for i in xrange(size): + for i in range(size): first = self.extractPointer(data + i * 2 * ptrSize) while first: self.putSubItem('%s' % pp, @@ -2193,7 +2192,7 @@ class DumperBase: if self.currentIName in self.expandedINames: p = value with Children(self, n): - for i in xrange(n): + for i in range(n): self.putSubItem(i, p.dereference()) p += 1 @@ -2340,7 +2339,7 @@ class DumperBase: self.putField('exp', exp) self.putItemCount(n) self.putNoType() - for i in xrange(n): + for i in range(n): self.handleWatch(exps[i], exps[i], '%s.%d' % (iname, i)) return diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index c50ba14281c..55ad02afcd5 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -101,7 +101,7 @@ PPPCommand() def scanStack(p, n): p = int(p) r = [] - for i in xrange(n): + for i in range(n): f = gdb.parse_and_eval('{void*}%s' % p) m = gdb.execute('info symbol %s' % f, to_string=True) if not m.startswith('No symbol matches'): diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 3617d398a6a..5e049aeb246 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -810,7 +810,7 @@ class Dumper(DumperBase): needle = self.canonicalTypeName(name) #DumperBase.warn('NEEDLE: %s ' % needle) self.warn('Searching for type %s across all target modules, this could be very slow' % name) - for i in xrange(self.target.GetNumModules()): + for i in range(self.target.GetNumModules()): module = self.target.GetModuleAtIndex(i) # SBModule.GetType is new somewhere after early 300.x # So this may fail. @@ -1000,7 +1000,7 @@ class Dumper(DumperBase): return None if thread is None else thread.GetSelectedFrame() def firstStoppedThread(self): - for i in xrange(0, self.process.GetNumThreads()): + for i in range(0, self.process.GetNumThreads()): thread = self.process.GetThreadAtIndex(i) reason = thread.GetStopReason() if (reason == lldb.eStopReasonBreakpoint or @@ -1013,7 +1013,7 @@ class Dumper(DumperBase): def fetchThreads(self, args): result = 'threads=[' - for i in xrange(0, self.process.GetNumThreads()): + for i in range(0, self.process.GetNumThreads()): thread = self.process.GetThreadAtIndex(i) if thread.is_stopped: state = 'stopped' @@ -1043,7 +1043,7 @@ class Dumper(DumperBase): self.reportResult(result, args) def firstUsableFrame(self, thread): - for i in xrange(10): + for i in range(10): frame = thread.GetFrameAtIndex(i) lineEntry = frame.GetLineEntry() line = lineEntry.GetLine() @@ -1067,7 +1067,7 @@ class Dumper(DumperBase): self.currentCallContext = None result = 'stack={current-thread="%s"' % thread.GetThreadID() result += ',frames=[' - for i in xrange(n): + for i in range(n): frame = thread.GetFrameAtIndex(i) if not frame.IsValid(): isLimited = False @@ -1183,7 +1183,7 @@ class Dumper(DumperBase): with Children(self): statics = frame.GetVariables(False, False, True, False) if len(statics): - for i in xrange(len(statics)): + for i in range(len(statics)): staticVar = statics[i] staticVar.SetPreferSyntheticValue(False) typename = staticVar.GetType().GetName() @@ -1408,7 +1408,7 @@ class Dumper(DumperBase): if bp.IsValid() and isinstance(bp, lldb.SBBreakpoint): result += ',locations=[' lineEntry = None - for i in xrange(bp.GetNumLocations()): + for i in range(bp.GetNumLocations()): loc = bp.GetLocationAtIndex(i) addr = loc.GetAddress() lineEntry = addr.GetLineEntry() @@ -1539,7 +1539,7 @@ class Dumper(DumperBase): def fetchModules(self, args): result = 'modules=[' - for i in xrange(self.target.GetNumModules()): + for i in range(self.target.GetNumModules()): module = self.target.GetModuleAtIndex(i) result += '{file="%s"' % module.file.fullpath result += ',name="%s"' % module.file.basename @@ -1559,7 +1559,7 @@ class Dumper(DumperBase): moduleName = args['module'] #file = lldb.SBFileSpec(moduleName) #module = self.target.FindModule(file) - for i in xrange(self.target.GetNumModules()): + for i in range(self.target.GetNumModules()): module = self.target.GetModuleAtIndex(i) if module.file.fullpath == moduleName: break @@ -1872,7 +1872,7 @@ class Tester(Dumper): break if state == lldb.eStateStopped: # 5 stoppedThread = None - for i in xrange(0, self.process.GetNumThreads()): + for i in range(0, self.process.GetNumThreads()): thread = self.process.GetThreadAtIndex(i) reason = thread.GetStopReason() #DumperBase.warn('THREAD: %s REASON: %s' % (thread, reason)) diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py index a1343eb9dc8..9889e5ca97b 100644 --- a/share/qtcreator/debugger/misctypes.py +++ b/share/qtcreator/debugger/misctypes.py @@ -65,7 +65,7 @@ def qdump____m512d(d, value): def qdump____m128i(d, value): data = d.hexencode(value.data(16)) - d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(0, 32, 4))) + d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in range(0, 32, 4))) if d.isExpanded(): with Children(d): addr = value.address() @@ -76,7 +76,7 @@ def qdump____m128i(d, value): def qdump____m256i(d, value): data = d.hexencode(value.data(32)) - d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(0, 64, 4))) + d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in range(0, 64, 4))) if d.isExpanded(): with Children(d): addr = value.address() @@ -87,8 +87,8 @@ def qdump____m256i(d, value): def qdump____m512i(d, value): data = d.hexencode(value.data(64)) - d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(0, 64, 4)) - + ', ' + ':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(64, 128, 4))) + d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in range(0, 64, 4)) + + ', ' + ':'.join('%04x' % int(data[i:i+4], 16) for i in range(64, 128, 4))) if d.isExpanded(): with Children(d): d.putArrayItem('uint32x16', value.address(), 16, 'unsigned int') @@ -279,14 +279,14 @@ if False: d.putNoType() if d.isExpanded(): with Children(d): - for i in xrange(count): + for i in range(count): d.putSubItem(Item(entries[i], iname)) with SubItem(d, 'data'): d.putEmptyValue() d.putNoType() if d.isExpanded(): with Children(d): - for i in xrange(count): + for i in range(count): with SubItem(d, i): entry = entries[i] mpitype = str(entry['type']) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 705a0051c22..34d592ede7a 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -126,8 +126,8 @@ def qdump_X_QAbstractItemModel(d, value): if d.isExpanded(): with Children(d, numChild=rowCount * columnCount, childType=ri.type): i = 0 - for row in xrange(rowCount): - for column in xrange(columnCount): + for row in range(rowCount): + for column in range(columnCount): with SubItem(d, i): d.putName('[%s, %s]' % (row, column)) mi = d.parseAndEvaluate('%s.index(%d,%d,%s)' @@ -182,8 +182,8 @@ def qdump_X_QModelIndex(d, value): with Children(d): d.putFields(value, False) i = 0 - for row in xrange(rowCount): - for column in xrange(columnCount): + for row in range(rowCount): + for column in range(columnCount): with UnnamedSubItem(d, i): d.putName('[%s, %s]' % (row, column)) mi2 = d.parseAndEvaluate('%s.index(%d,%d,%s)' @@ -912,7 +912,7 @@ def qdump__QHostAddress(d, value): if protocol == 1: # value.d.d->a6 data = d.hexencode(a6) - address = ':'.join('%x' % int(data[i:i+4], 16) for i in xrange(0, 32, 4)) + address = ':'.join('%x' % int(data[i:i+4], 16) for i in range(0, 32, 4)) d.putValue(address) elif protocol == 0: # value.d.d->a @@ -938,7 +938,7 @@ def qdump__QHostAddress(d, value): def qdump__QIPv6Address(d, value): raw = d.split('16s', value)[0] data = d.hexencode(raw) - d.putValue(':'.join('%x' % int(data[i:i+4], 16) for i in xrange(0, 32, 4))) + d.putValue(':'.join('%x' % int(data[i:i+4], 16) for i in range(0, 32, 4))) d.putArrayData(value.address(), 16, d.lookupType('unsigned char')) def qform__QList(): diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index 83201e42e83..e9f99fc3f60 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -1160,7 +1160,7 @@ def qdump____gnu_cxx__hash_set(d, value): bucketFinish = buckets["_M_finish"] p = bucketStart itemCount = 0 - for i in xrange((bucketFinish.pointer() - bucketStart.pointer()) // d.ptrSize()): + for i in range((bucketFinish.pointer() - bucketStart.pointer()) // d.ptrSize()): if p.dereference().pointer(): cur = p.dereference() while cur.pointer(): From 5765bd8507b1e76ef61176435ce357962fb9b291 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 25 Feb 2020 18:36:05 +0200 Subject: [PATCH 06/29] Git: Make addChangeActions a static function Will move and reuse it for output window links. Change-Id: Iad5a164e9a30c38ea9bac07989196b9361384339 Reviewed-by: Eike Ziller --- src/plugins/git/giteditor.cpp | 56 +++++++++++++++++------------------ src/plugins/git/giteditor.h | 3 +- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index 47546d0df61..ac5735af200 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -216,12 +216,6 @@ void GitEditorWidget::setPlainText(const QString &text) textDocument()->setPlainText(modText); } -void GitEditorWidget::resetChange(const QByteArray &resetType) -{ - GitPlugin::client()->reset( - sourceWorkingDirectory(), QLatin1String("--" + resetType), m_currentChange); -} - void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert) { Utils::TemporaryFile patchFile("git-apply-chunk"); @@ -314,32 +308,28 @@ bool GitEditorWidget::isValidRevision(const QString &revision) const return GitPlugin::client()->isValidRevision(revision); } -void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change) +void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change, const QString &workingDir) { - m_currentChange = change; - if (contentType() == OtherContent) - return; - - menu->addAction(tr("Cherr&y-Pick Change %1").arg(change), this, [this] { - GitPlugin::client()->synchronousCherryPick(sourceWorkingDirectory(), m_currentChange); + menu->addAction(tr("Cherr&y-Pick Change %1").arg(change), [workingDir, change] { + GitPlugin::client()->synchronousCherryPick(workingDir, change); }); - menu->addAction(tr("Re&vert Change %1").arg(change), this, [this] { - GitPlugin::client()->synchronousRevert(sourceWorkingDirectory(), m_currentChange); + menu->addAction(tr("Re&vert Change %1").arg(change), [workingDir, change] { + GitPlugin::client()->synchronousRevert(workingDir, change); }); - menu->addAction(tr("C&heckout Change %1").arg(change), this, [this] { - GitPlugin::client()->checkout(sourceWorkingDirectory(), m_currentChange); + menu->addAction(tr("C&heckout Change %1").arg(change), [workingDir, change] { + GitPlugin::client()->checkout(workingDir, change); }); connect(menu->addAction(tr("&Interactive Rebase from Change %1...").arg(change)), - &QAction::triggered, this, [this] { - GitPlugin::startRebaseFromCommit(sourceWorkingDirectory(), m_currentChange); + &QAction::triggered, [workingDir, change] { + GitPlugin::startRebaseFromCommit(workingDir, change); }); - menu->addAction(tr("&Log for Change %1").arg(change), this, [this] { - GitPlugin::client()->log(sourceWorkingDirectory(), QString(), false, {m_currentChange}); + menu->addAction(tr("&Log for Change %1").arg(change), [workingDir, change] { + GitPlugin::client()->log(workingDir, QString(), false, {change}); }); - menu->addAction(tr("Add &Tag for Change %1...").arg(change), this, [this] { + menu->addAction(tr("Add &Tag for Change %1...").arg(change), [workingDir, change] { QString output; QString errorMessage; - GitPlugin::client()->synchronousTagCmd(sourceWorkingDirectory(), QStringList(), + GitPlugin::client()->synchronousTagCmd(workingDir, QStringList(), &output, &errorMessage); const QStringList tags = output.split('\n'); @@ -348,21 +338,31 @@ void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change) if (dialog.exec() == QDialog::Rejected) return; - GitPlugin::client()->synchronousTagCmd(sourceWorkingDirectory(), - {dialog.branchName(), m_currentChange}, + GitPlugin::client()->synchronousTagCmd(workingDir, + {dialog.branchName(), change}, &output, &errorMessage); VcsOutputWindow::append(output); if (!errorMessage.isEmpty()) VcsOutputWindow::append(errorMessage, VcsOutputWindow::MessageStyle::Error); }); + auto resetChange = [workingDir, change](const QByteArray &resetType) { + GitPlugin::client()->reset( + workingDir, QLatin1String("--" + resetType), change); + }; auto resetMenu = new QMenu(tr("&Reset to Change %1").arg(change), menu); - resetMenu->addAction(tr("&Hard"), this, [this] { resetChange("hard"); }); - resetMenu->addAction(tr("&Mixed"), this, [this] { resetChange("mixed"); }); - resetMenu->addAction(tr("&Soft"), this, [this] { resetChange("soft"); }); + resetMenu->addAction(tr("&Hard"), std::bind(resetChange, "hard")); + resetMenu->addAction(tr("&Mixed"), std::bind(resetChange, "mixed")); + resetMenu->addAction(tr("&Soft"), std::bind(resetChange, "soft")); menu->addMenu(resetMenu); } +void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change) +{ + if (contentType() != OtherContent) + addChangeActions(menu, change, sourceWorkingDirectory()); +} + QString GitEditorWidget::revisionSubject(const QTextBlock &inBlock) const { for (QTextBlock block = inBlock.next(); block.isValid(); block = block.next()) { diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h index 18397d94975..b2eab5de72d 100644 --- a/src/plugins/git/giteditor.h +++ b/src/plugins/git/giteditor.h @@ -58,7 +58,6 @@ private: void applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert); void init() override; - void resetChange(const QByteArray &resetType); void addDiffActions(QMenu *menu, const VcsBase::DiffChunk &chunk) override; void aboutToOpen(const QString &fileName, const QString &realFileName) override; QString changeUnderCursor(const QTextCursor &) const override; @@ -67,13 +66,13 @@ private: QStringList annotationPreviousVersions(const QString &revision) const override; bool isValidRevision(const QString &revision) const override; void addChangeActions(QMenu *menu, const QString &change) override; + static void addChangeActions(QMenu *menu, const QString &workingDir, const QString &change); QString revisionSubject(const QTextBlock &inBlock) const override; bool supportChangeLinks() const override; QString fileNameForLine(int line) const override; QString sourceWorkingDirectory() const; mutable QRegExp m_changeNumberPattern; - QString m_currentChange; GitLogFilterWidget *m_logFilterWidget = nullptr; }; From 7c4f0a9b1ed29e9440211e37e45d0e3451ac2a62 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 25 Feb 2020 20:20:25 +0200 Subject: [PATCH 07/29] Git: Store singleton instance in GitClient On many cases, GitPlugin is not required at all, and is only used as a proxy for GitClient. Change-Id: I246012658ab3e8c7a12f1a459b1b1748ff358e0b Reviewed-by: hjk --- src/plugins/git/branchview.cpp | 30 +++++++------- src/plugins/git/changeselectiondialog.cpp | 7 ++-- src/plugins/git/gerrit/branchcombobox.cpp | 5 +-- src/plugins/git/gerrit/gerritmodel.cpp | 3 +- src/plugins/git/gerrit/gerritplugin.cpp | 20 +++++----- src/plugins/git/gerrit/gerritpushdialog.cpp | 19 +++++---- .../git/gerrit/gerritremotechooser.cpp | 3 +- src/plugins/git/gerrit/gerritserver.cpp | 4 +- src/plugins/git/gitclient.cpp | 39 +++++++++++-------- src/plugins/git/gitclient.h | 1 + src/plugins/git/giteditor.cpp | 34 ++++++++-------- src/plugins/git/gitgrep.cpp | 5 +-- src/plugins/git/gitplugin.cpp | 4 +- src/plugins/git/gitsubmiteditor.cpp | 12 +++--- src/plugins/git/logchangedialog.cpp | 15 +++---- src/plugins/git/mergetool.cpp | 4 +- src/plugins/git/remotedialog.cpp | 4 +- src/plugins/git/remotemodel.cpp | 11 +++--- src/plugins/git/stashdialog.cpp | 21 +++++----- 19 files changed, 123 insertions(+), 118 deletions(-) diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index 3cac8265f18..87c4e097537 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -82,7 +82,7 @@ BranchView::BranchView() : m_refreshButton(new QToolButton(this)), m_repositoryLabel(new Utils::ElidingLabel(this)), m_branchView(new Utils::NavigationTreeView(this)), - m_model(new BranchModel(GitPlugin::client(), this)), + m_model(new BranchModel(GitClient::instance(), this)), m_filterModel(new BranchFilterModel(this)) { m_addButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon()); @@ -122,7 +122,7 @@ BranchView::BranchView() : this, &BranchView::setIncludeOldEntries); m_includeTagsAction->setCheckable(true); m_includeTagsAction->setChecked( - GitPlugin::client()->settings().boolValue(GitSettings::showTagsKey)); + GitClient::instance()->settings().boolValue(GitSettings::showTagsKey)); connect(m_includeTagsAction, &QAction::toggled, this, &BranchView::setIncludeTags); @@ -214,12 +214,12 @@ void BranchView::slotCustomContextMenu(const QPoint &point) const Utils::optional remote = m_model->remoteName(index); if (remote.has_value()) { contextMenu.addAction(tr("&Fetch"), this, [this, &remote]() { - GitPlugin::client()->fetch(m_repository, *remote); + GitClient::instance()->fetch(m_repository, *remote); }); contextMenu.addSeparator(); if (!remote->isEmpty()) { contextMenu.addAction(tr("Remove &Stale Branches"), this, [this, &remote]() { - GitPlugin::client()->removeStaleRemoteBranches(m_repository, *remote); + GitClient::instance()->removeStaleRemoteBranches(m_repository, *remote); }); contextMenu.addSeparator(); } @@ -238,7 +238,7 @@ void BranchView::slotCustomContextMenu(const QPoint &point) contextMenu.addAction(tr("&Diff"), this, [this] { const QString fullName = m_model->fullName(selectedIndex(), true); if (!fullName.isEmpty()) - GitPlugin::client()->diffBranch(m_repository, fullName); + GitClient::instance()->diffBranch(m_repository, fullName); }); contextMenu.addAction(tr("&Log"), this, [this] { log(selectedIndex()); }); contextMenu.addAction(tr("Reflo&g"), this, [this] { reflog(selectedIndex()); }); @@ -289,7 +289,7 @@ void BranchView::setIncludeOldEntries(bool filter) void BranchView::setIncludeTags(bool includeTags) { - GitPlugin::client()->settings().setValue(GitSettings::showTagsKey, includeTags); + GitClient::instance()->settings().setValue(GitSettings::showTagsKey, includeTags); refreshCurrentRepository(); } @@ -365,7 +365,7 @@ bool BranchView::checkout() ' ' + nextBranch + "-AutoStash "; BranchCheckoutDialog branchCheckoutDialog(this, currentBranch, nextBranch); - GitClient *client = GitPlugin::client(); + GitClient *client = GitClient::instance(); if (client->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) != GitClient::StatusChanged) branchCheckoutDialog.foundNoLocalChanges(); @@ -500,7 +500,7 @@ bool BranchView::reset(const QByteArray &resetType) if (QMessageBox::question(this, tr("Git Reset"), tr("Reset branch \"%1\" to \"%2\"?") .arg(currentName).arg(branchName), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { - GitPlugin::client()->reset(m_repository, QLatin1String("--" + resetType), branchName); + GitClient::instance()->reset(m_repository, QLatin1String("--" + resetType), branchName); return true; } return false; @@ -512,7 +512,7 @@ bool BranchView::isFastForwardMerge() QTC_CHECK(selected != m_model->currentBranch()); const QString branch = m_model->fullName(selected, true); - return GitPlugin::client()->isFastForwardMerge(m_repository, branch); + return GitClient::instance()->isFastForwardMerge(m_repository, branch); } bool BranchView::merge(bool allowFastForward) @@ -523,7 +523,7 @@ bool BranchView::merge(bool allowFastForward) QTC_CHECK(selected != m_model->currentBranch()); const QString branch = m_model->fullName(selected, true); - GitClient *client = GitPlugin::client(); + GitClient *client = GitClient::instance(); if (client->beginStashScope(m_repository, "merge", AllowUnstashed)) return client->synchronousMerge(m_repository, branch, allowFastForward); @@ -538,7 +538,7 @@ void BranchView::rebase() QTC_CHECK(selected != m_model->currentBranch()); const QString baseBranch = m_model->fullName(selected, true); - GitClient *client = GitPlugin::client(); + GitClient *client = GitClient::instance(); if (client->beginStashScope(m_repository, "rebase")) client->rebase(m_repository, baseBranch); } @@ -551,21 +551,21 @@ bool BranchView::cherryPick() QTC_CHECK(selected != m_model->currentBranch()); const QString branch = m_model->fullName(selected, true); - return GitPlugin::client()->synchronousCherryPick(m_repository, branch); + return GitClient::instance()->synchronousCherryPick(m_repository, branch); } void BranchView::log(const QModelIndex &idx) { const QString branchName = m_model->fullName(idx, true); if (!branchName.isEmpty()) - GitPlugin::client()->log(m_repository, QString(), false, {branchName}); + GitClient::instance()->log(m_repository, QString(), false, {branchName}); } void BranchView::reflog(const QModelIndex &idx) { const QString branchName = m_model->fullName(idx, true); if (!branchName.isEmpty()) - GitPlugin::client()->reflog(m_repository, branchName); + GitClient::instance()->reflog(m_repository, branchName); } void BranchView::push() @@ -581,7 +581,7 @@ void BranchView::push() const QString remoteBranch = fullTargetName.mid(pos + 1); const QStringList pushArgs = {remoteName, localBranch + ':' + remoteBranch}; - GitPlugin::client()->push(m_repository, pushArgs); + GitClient::instance()->push(m_repository, pushArgs); } BranchViewFactory::BranchViewFactory() diff --git a/src/plugins/git/changeselectiondialog.cpp b/src/plugins/git/changeselectiondialog.cpp index c1cc46ce984..52f8c4762fa 100644 --- a/src/plugins/git/changeselectiondialog.cpp +++ b/src/plugins/git/changeselectiondialog.cpp @@ -25,7 +25,6 @@ #include "changeselectiondialog.h" #include "logchangedialog.h" -#include "gitplugin.h" #include "gitclient.h" #include "ui_changeselectiondialog.h" @@ -57,12 +56,12 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co QWidget *parent) : QDialog(parent), m_ui(new Ui::ChangeSelectionDialog) { - m_gitExecutable = GitPlugin::client()->vcsBinary(); + m_gitExecutable = GitClient::instance()->vcsBinary(); m_ui->setupUi(this); m_ui->workingDirectoryChooser->setExpectedKind(PathChooser::ExistingDirectory); m_ui->workingDirectoryChooser->setPromptDialogTitle(tr("Select Git Directory")); m_ui->workingDirectoryChooser->setPath(workingDirectory); - m_gitEnvironment = GitPlugin::client()->processEnvironment(); + m_gitEnvironment = GitClient::instance()->processEnvironment(); m_ui->changeNumberEdit->setFocus(); m_ui->changeNumberEdit->selectAll(); @@ -203,7 +202,7 @@ void ChangeSelectionDialog::recalculateCompletion() if (workingDir.isEmpty()) return; - GitClient *client = GitPlugin::client(); + GitClient *client = GitClient::instance(); VcsBase::VcsCommand *command = client->asyncForEachRefCmd( workingDir, {"--format=%(refname:short)"}); connect(this, &QObject::destroyed, command, &VcsBase::VcsCommand::abort); diff --git a/src/plugins/git/gerrit/branchcombobox.cpp b/src/plugins/git/gerrit/branchcombobox.cpp index 6cc866ce3f1..bc7aa282df2 100644 --- a/src/plugins/git/gerrit/branchcombobox.cpp +++ b/src/plugins/git/gerrit/branchcombobox.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "branchcombobox.h" -#include "../gitplugin.h" #include "../gitclient.h" using namespace Git::Internal; @@ -36,7 +35,7 @@ BranchComboBox::BranchComboBox(QWidget *parent) : QComboBox(parent) void BranchComboBox::init(const QString &repository) { m_repository = repository; - QString currentBranch = GitPlugin::client()->synchronousCurrentLocalBranch(repository); + QString currentBranch = GitClient::instance()->synchronousCurrentLocalBranch(repository); if (currentBranch.isEmpty()) { m_detached = true; currentBranch = "HEAD"; @@ -44,7 +43,7 @@ void BranchComboBox::init(const QString &repository) } QString output; const QString branchPrefix("refs/heads/"); - if (!GitPlugin::client()->synchronousForEachRefCmd( + if (!GitClient::instance()->synchronousForEachRefCmd( m_repository, {"--format=%(refname)", branchPrefix}, &output)) { return; } diff --git a/src/plugins/git/gerrit/gerritmodel.cpp b/src/plugins/git/gerrit/gerritmodel.cpp index a9be6358ccb..c5e346aaa6e 100644 --- a/src/plugins/git/gerrit/gerritmodel.cpp +++ b/src/plugins/git/gerrit/gerritmodel.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "gerritmodel.h" -#include "../gitplugin.h" #include "../gitclient.h" #include @@ -295,7 +294,7 @@ QueryContext::QueryContext(const QString &query, connect(&m_process, &QProcess::errorOccurred, this, &QueryContext::processError); connect(&m_watcher, &QFutureWatcherBase::canceled, this, &QueryContext::terminate); m_watcher.setFuture(m_progress.future()); - m_process.setProcessEnvironment(Git::Internal::GitPlugin::client()->processEnvironment()); + m_process.setProcessEnvironment(Git::Internal::GitClient::instance()->processEnvironment()); m_progress.setProgressRange(0, 1); m_timer.setInterval(timeOutMS); diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index 656f1e34f70..85d414b9b9a 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -148,7 +148,7 @@ FetchContext::FetchContext(const QSharedPointer &change, connect(&m_watcher, &QFutureWatcher::canceled, this, &FetchContext::terminate); m_watcher.setFuture(m_progress.future()); m_process.setWorkingDirectory(repository); - m_process.setProcessEnvironment(GitPlugin::client()->processEnvironment()); + m_process.setProcessEnvironment(GitClient::instance()->processEnvironment()); m_process.closeWriteChannel(); } @@ -240,7 +240,7 @@ void FetchContext::show() { const QString title = QString::number(m_change->number) + '/' + QString::number(m_change->currentPatchSet.patchSetNumber); - GitPlugin::client()->show(m_repository, "FETCH_HEAD", title); + GitClient::instance()->show(m_repository, "FETCH_HEAD", title); } void FetchContext::cherryPick() @@ -248,12 +248,12 @@ void FetchContext::cherryPick() // Point user to errors. VcsBase::VcsOutputWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus); - GitPlugin::client()->synchronousCherryPick(m_repository, "FETCH_HEAD"); + GitClient::instance()->synchronousCherryPick(m_repository, "FETCH_HEAD"); } void FetchContext::checkout() { - GitPlugin::client()->checkout(m_repository, "FETCH_HEAD"); + GitClient::instance()->checkout(m_repository, "FETCH_HEAD"); } void FetchContext::terminate() @@ -328,7 +328,7 @@ void GerritPlugin::push(const QString &topLevel) dialog.storeTopic(); m_reviewers = dialog.reviewers(); - GitPlugin::client()->push(topLevel, {dialog.selectedRemoteName(), dialog.pushTarget()}); + GitClient::instance()->push(topLevel, {dialog.selectedRemoteName(), dialog.pushTarget()}); } static QString currentRepository() @@ -375,19 +375,19 @@ void GerritPlugin::push() Utils::FilePath GerritPlugin::gitBinDirectory() { - return GitPlugin::client()->gitBinDirectory(); + return GitClient::instance()->gitBinDirectory(); } // Find the branch of a repository. QString GerritPlugin::branch(const QString &repository) { - return GitPlugin::client()->synchronousCurrentLocalBranch(repository); + return GitClient::instance()->synchronousCurrentLocalBranch(repository); } void GerritPlugin::fetch(const QSharedPointer &change, int mode) { // Locate git. - const Utils::FilePath git = GitPlugin::client()->vcsBinary(); + const Utils::FilePath git = GitClient::instance()->vcsBinary(); if (git.isEmpty()) { VcsBase::VcsOutputWindow::appendError(tr("Git is not available.")); return; @@ -400,7 +400,7 @@ void GerritPlugin::fetch(const QSharedPointer &change, int mode) if (!repository.isEmpty()) { // Check if remote from a working dir is the same as remote from patch - QMap remotesList = GitPlugin::client()->synchronousRemotesList(repository); + QMap remotesList = GitClient::instance()->synchronousRemotesList(repository); if (!remotesList.isEmpty()) { const QStringList remotes = remotesList.values(); for (QString remote : remotes) { @@ -413,7 +413,7 @@ void GerritPlugin::fetch(const QSharedPointer &change, int mode) } if (!verifiedRepository) { - const SubmoduleDataMap submodules = GitPlugin::client()->submoduleList(repository); + const SubmoduleDataMap submodules = GitClient::instance()->submoduleList(repository); for (const SubmoduleData &submoduleData : submodules) { QString remote = submoduleData.url; if (remote.endsWith(".git")) diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index 08c280fc90f..ddd45134f79 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -27,7 +27,6 @@ #include "ui_gerritpushdialog.h" #include "branchcombobox.h" -#include "../gitplugin.h" #include "../gitclient.h" #include "../gitconstants.h" @@ -70,7 +69,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch) QString output; QString error; - if (!GitPlugin::client()->synchronousBranchCmd( + if (!GitClient::instance()->synchronousBranchCmd( m_workingDir, {"-r", "--contains", earliestCommit + '^'}, &output, &error)) { return QString(); } @@ -79,7 +78,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch) QString remoteTrackingBranch; if (localBranch != "HEAD") - remoteTrackingBranch = GitPlugin::client()->synchronousTrackingBranch(m_workingDir, localBranch); + remoteTrackingBranch = GitClient::instance()->synchronousTrackingBranch(m_workingDir, localBranch); QString remoteBranch; for (const QString &reference : refs) { @@ -103,7 +102,7 @@ void GerritPushDialog::initRemoteBranches() const QString head = "/HEAD"; QString remotesPrefix("refs/remotes/"); - if (!GitPlugin::client()->synchronousForEachRefCmd( + if (!GitClient::instance()->synchronousForEachRefCmd( m_workingDir, {"--format=%(refname)\t%(committerdate:raw)", remotesPrefix}, &output)) { return; } @@ -186,8 +185,8 @@ QString GerritPushDialog::calculateChangeRange(const QString &branch) QString number; QString error; - GitPlugin::client()->synchronousRevListCmd(m_workingDir, { remote + ".." + branch, "--count" }, - &number, &error); + GitClient::instance()->synchronousRevListCmd( + m_workingDir, { remote + ".." + branch, "--count" }, &number, &error); number.chop(1); return number; @@ -303,8 +302,8 @@ QString GerritPushDialog::pushTarget() const void GerritPushDialog::storeTopic() { const QString branch = m_ui->localBranchComboBox->currentText(); - GitPlugin::client()->setConfigValue(m_workingDir, QString("branch.%1.topic").arg(branch), - selectedTopic()); + GitClient::instance()->setConfigValue( + m_workingDir, QString("branch.%1.topic").arg(branch), selectedTopic()); } void GerritPushDialog::setRemoteBranches(bool includeOld) @@ -316,7 +315,7 @@ void GerritPushDialog::setRemoteBranches(bool includeOld) const QString remoteName = selectedRemoteName(); if (!m_remoteBranches.contains(remoteName)) { const QStringList remoteBranches = - GitPlugin::client()->synchronousRepositoryBranches(remoteName, m_workingDir); + GitClient::instance()->synchronousRepositoryBranches(remoteName, m_workingDir); for (const QString &branch : remoteBranches) m_remoteBranches.insertMulti(remoteName, qMakePair(branch, QDate())); if (remoteBranches.isEmpty()) { @@ -354,7 +353,7 @@ void GerritPushDialog::updateCommits(int index) { const QString branch = m_ui->localBranchComboBox->itemText(index); m_hasLocalCommits = m_ui->commitView->init(m_workingDir, branch, LogChangeWidget::Silent); - QString topic = GitPlugin::client()->readConfigValue( + QString topic = GitClient::instance()->readConfigValue( m_workingDir, QString("branch.%1.topic").arg(branch)); if (!topic.isEmpty()) m_ui->topicLineEdit->setText(topic); diff --git a/src/plugins/git/gerrit/gerritremotechooser.cpp b/src/plugins/git/gerrit/gerritremotechooser.cpp index 8e5e7cd8828..6b94bcd238f 100644 --- a/src/plugins/git/gerrit/gerritremotechooser.cpp +++ b/src/plugins/git/gerrit/gerritremotechooser.cpp @@ -27,7 +27,6 @@ #include "gerritparameters.h" #include "gerritserver.h" #include "../gitclient.h" -#include "../gitplugin.h" #include #include @@ -104,7 +103,7 @@ bool GerritRemoteChooser::updateRemotes(bool forceReload) m_remotes.clear(); QString errorMessage; // Mute errors. We'll just fallback to the defaults const QMap remotesList = - Git::Internal::GitPlugin::client()->synchronousRemotesList(m_repository, &errorMessage); + Git::Internal::GitClient::instance()->synchronousRemotesList(m_repository, &errorMessage); for (auto mapIt = remotesList.cbegin(), end = remotesList.cend(); mapIt != end; ++mapIt) { GerritServer server; if (!server.fillFromRemote(mapIt.value(), *m_parameters, forceReload)) diff --git a/src/plugins/git/gerrit/gerritserver.cpp b/src/plugins/git/gerrit/gerritserver.cpp index f2fae53d517..a0a6a650469 100644 --- a/src/plugins/git/gerrit/gerritserver.cpp +++ b/src/plugins/git/gerrit/gerritserver.cpp @@ -241,7 +241,7 @@ QStringList GerritServer::curlArguments() const int GerritServer::testConnection() { - static GitClient *const client = GitPlugin::client(); + static GitClient *const client = GitClient::instance(); const QStringList arguments = curlArguments() << (url(RestUrl) + accountUrlC); const SynchronousProcessResponse resp = client->vcsFullySynchronousExec( QString(), {curlBinary, arguments}, @@ -333,7 +333,7 @@ bool GerritServer::resolveRoot() void GerritServer::resolveVersion(const GerritParameters &p, bool forceReload) { - static GitClient *const client = GitPlugin::client(); + static GitClient *const client = GitClient::instance(); QSettings *settings = Core::ICore::settings(); const QString fullVersionKey = "Gerrit/" + host + '/' + versionKey; version = settings->value(fullVersionKey).toString(); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 005e0e66f86..f4130345cec 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -106,6 +106,8 @@ using namespace VcsBase; namespace Git { namespace Internal { +static GitClient *m_instance = nullptr; + // Suppress git diff warnings about "LF will be replaced by CRLF..." on Windows. static unsigned diffExecutionFlags() { @@ -300,7 +302,7 @@ void GitDiffEditorController::updateBranchList() return; const QString workingDirectory = baseDirectory(); - VcsCommand *command = GitPlugin::client()->vcsExec( + VcsCommand *command = m_instance->vcsExec( workingDirectory, {"branch", noColorOption, "-a", "--contains", revision}, nullptr, false, 0, workingDirectory); connect(command, &VcsCommand::stdOutText, this, [this](const QString &text) { @@ -375,7 +377,7 @@ QStringList GitDiffEditorController::addHeadWhenCommandInProgress() const // This is workaround for lack of support for merge commits and resolving conflicts, // we compare the current state of working tree to the HEAD of current branch // instead of showing unsupported combined diff format. - GitClient::CommandInProgress commandInProgress = GitPlugin::client()->checkCommandInProgress(workingDirectory()); + GitClient::CommandInProgress commandInProgress = m_instance->checkCommandInProgress(workingDirectory()); if (commandInProgress != GitClient::NoCommand) return {HEAD}; return QStringList(); @@ -478,7 +480,7 @@ public: setReloader([this] { m_state = GettingDescription; const QStringList args = {"show", "-s", noColorOption, showFormatC, m_id}; - runCommand({args}, GitPlugin::client()->encoding(workingDirectory(), "i18n.commitEncoding")); + runCommand({args}, m_instance->encoding(workingDirectory(), "i18n.commitEncoding")); setStartupFile(VcsBase::source(this->document())); }); } @@ -495,7 +497,7 @@ void ShowController::processCommandOutput(const QString &output) { QTC_ASSERT(m_state != Idle, return); if (m_state == GettingDescription) { - setDescription(GitPlugin::client()->extendedShowDescription(workingDirectory(), output)); + setDescription(m_instance->extendedShowDescription(workingDirectory(), output)); // stage 2 m_state = GettingDiff; const QStringList args = {"show", "--format=format:", // omit header, already generated @@ -669,12 +671,11 @@ private: { // If interactive rebase editor window is closed, plugin is terminated // but referenced here when the command ends - GitClient *client = GitPlugin::client(); if (m_commit.isEmpty() && m_files.isEmpty()) { - if (client->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand) - client->endStashScope(m_workingDirectory); + if (m_instance->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand) + m_instance->endStashScope(m_workingDirectory); } else { - client->handleMergeConflicts(m_workingDirectory, m_commit, m_files, m_abortCommand); + m_instance->handleMergeConflicts(m_workingDirectory, m_commit, m_files, m_abortCommand); } } @@ -763,11 +764,17 @@ GitClient::GitClient(GitSettings *settings) : VcsBase::VcsBaseClientImpl(setting m_cachedGitVersion(0), m_disableEditor(false) { + m_instance = this; m_gitQtcEditor = QString::fromLatin1("\"%1\" -client -block -pid %2") .arg(QCoreApplication::applicationFilePath()) .arg(QCoreApplication::applicationPid()); } +GitClient *GitClient::instance() +{ + return m_instance; +} + QString GitClient::findRepositoryForDirectory(const QString &directory) const { if (directory.isEmpty() || directory.endsWith("/.git") || directory.contains("/.git/")) @@ -3476,8 +3483,8 @@ bool GitClient::StashInfo::init(const QString &workingDirectory, const QString & m_pushAction = pushAction; QString errorMessage; QString statusOutput; - switch (GitPlugin::client()->gitStatus(m_workingDir, StatusMode(NoUntracked | NoSubmodules), - &statusOutput, &errorMessage)) { + switch (m_instance->gitStatus(m_workingDir, StatusMode(NoUntracked | NoSubmodules), + &statusOutput, &errorMessage)) { case GitClient::StatusChanged: if (m_flags & NoPrompt) executeStash(command, &errorMessage); @@ -3529,14 +3536,14 @@ void GitClient::StashInfo::stashPrompt(const QString &command, const QString &st msgBox.exec(); if (msgBox.clickedButton() == discardButton) { - m_stashResult = GitPlugin::client()->synchronousReset(m_workingDir, QStringList(), errorMessage) ? + m_stashResult = m_instance->synchronousReset(m_workingDir, QStringList(), errorMessage) ? StashUnchanged : StashFailed; } else if (msgBox.clickedButton() == ignoreButton) { // At your own risk, so. m_stashResult = NotStashed; } else if (msgBox.clickedButton() == cancelButton) { m_stashResult = StashCanceled; } else if (msgBox.clickedButton() == stashButton) { - const bool result = GitPlugin::client()->executeSynchronousStash( + const bool result = m_instance->executeSynchronousStash( m_workingDir, creatorStashMessage(command), false, errorMessage); m_stashResult = result ? StashUnchanged : StashFailed; } else if (msgBox.clickedButton() == stashAndPopButton) { @@ -3547,7 +3554,7 @@ void GitClient::StashInfo::stashPrompt(const QString &command, const QString &st void GitClient::StashInfo::executeStash(const QString &command, QString *errorMessage) { m_message = creatorStashMessage(command); - if (!GitPlugin::client()->executeSynchronousStash(m_workingDir, m_message, false, errorMessage)) + if (!m_instance->executeSynchronousStash(m_workingDir, m_message, false, errorMessage)) m_stashResult = StashFailed; else m_stashResult = Stashed; @@ -3570,12 +3577,12 @@ void GitClient::StashInfo::end() { if (m_stashResult == Stashed) { QString stashName; - if (GitPlugin::client()->stashNameFromMessage(m_workingDir, m_message, &stashName)) - GitPlugin::client()->stashPop(m_workingDir, stashName); + if (m_instance->stashNameFromMessage(m_workingDir, m_message, &stashName)) + m_instance->stashPop(m_workingDir, stashName); } if (m_pushAction == NormalPush) - GitPlugin::client()->push(m_workingDir); + m_instance->push(m_workingDir); else if (m_pushAction == PushToGerrit) GitPlugin::gerritPush(m_workingDir); diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 447238888aa..932e2ee74f7 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -139,6 +139,7 @@ public: }; explicit GitClient(GitSettings *settings); + static GitClient *instance(); Utils::FilePath vcsBinary() const override; unsigned gitVersion(QString *errorMessage = nullptr) const; diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index ac5735af200..21b688b2e8a 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -152,7 +152,7 @@ static QString sanitizeBlameOutput(const QString &b) if (b.isEmpty()) return b; - const bool omitDate = GitPlugin::client()->settings().boolValue( + const bool omitDate = GitClient::instance()->settings().boolValue( GitSettings::omitAnnotationDateKey); const QChar space(' '); const int parenPos = b.indexOf(')'); @@ -231,7 +231,7 @@ void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert) if (revert) args << "--reverse"; QString errorMessage; - if (GitPlugin::client()->synchronousApplyPatch(baseDir, patchFile.fileName(), &errorMessage, args)) { + if (GitClient::instance()->synchronousApplyPatch(baseDir, patchFile.fileName(), &errorMessage, args)) { if (errorMessage.isEmpty()) VcsOutputWindow::append(tr("Chunk successfully staged")); else @@ -280,14 +280,14 @@ void GitEditorWidget::aboutToOpen(const QString &fileName, const QString &realFi const QString gitPath = fi.absolutePath(); setSource(gitPath); textDocument()->setCodec( - GitPlugin::client()->encoding(gitPath, "i18n.commitEncoding")); + GitClient::instance()->encoding(gitPath, "i18n.commitEncoding")); } } QString GitEditorWidget::decorateVersion(const QString &revision) const { // Format verbose, SHA1 being first token - return GitPlugin::client()->synchronousShortDescription(sourceWorkingDirectory(), revision); + return GitClient::instance()->synchronousShortDescription(sourceWorkingDirectory(), revision); } QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) const @@ -295,8 +295,8 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) QStringList revisions; QString errorMessage; // Get the SHA1's of the file. - if (!GitPlugin::client()->synchronousParentRevisions(sourceWorkingDirectory(), - revision, &revisions, &errorMessage)) { + if (!GitClient::instance()->synchronousParentRevisions( + sourceWorkingDirectory(), revision, &revisions, &errorMessage)) { VcsOutputWindow::appendSilently(errorMessage); return QStringList(); } @@ -305,32 +305,32 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) bool GitEditorWidget::isValidRevision(const QString &revision) const { - return GitPlugin::client()->isValidRevision(revision); + return GitClient::instance()->isValidRevision(revision); } void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change, const QString &workingDir) { menu->addAction(tr("Cherr&y-Pick Change %1").arg(change), [workingDir, change] { - GitPlugin::client()->synchronousCherryPick(workingDir, change); + GitClient::instance()->synchronousCherryPick(workingDir, change); }); menu->addAction(tr("Re&vert Change %1").arg(change), [workingDir, change] { - GitPlugin::client()->synchronousRevert(workingDir, change); + GitClient::instance()->synchronousRevert(workingDir, change); }); menu->addAction(tr("C&heckout Change %1").arg(change), [workingDir, change] { - GitPlugin::client()->checkout(workingDir, change); + GitClient::instance()->checkout(workingDir, change); }); connect(menu->addAction(tr("&Interactive Rebase from Change %1...").arg(change)), &QAction::triggered, [workingDir, change] { GitPlugin::startRebaseFromCommit(workingDir, change); }); menu->addAction(tr("&Log for Change %1").arg(change), [workingDir, change] { - GitPlugin::client()->log(workingDir, QString(), false, {change}); + GitClient::instance()->log(workingDir, QString(), false, {change}); }); menu->addAction(tr("Add &Tag for Change %1...").arg(change), [workingDir, change] { QString output; QString errorMessage; - GitPlugin::client()->synchronousTagCmd(workingDir, QStringList(), - &output, &errorMessage); + GitClient::instance()->synchronousTagCmd(workingDir, QStringList(), + &output, &errorMessage); const QStringList tags = output.split('\n'); BranchAddDialog dialog(tags, BranchAddDialog::Type::AddTag, Core::ICore::dialogParent()); @@ -338,16 +338,16 @@ void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change, const if (dialog.exec() == QDialog::Rejected) return; - GitPlugin::client()->synchronousTagCmd(workingDir, - {dialog.branchName(), change}, - &output, &errorMessage); + GitClient::instance()->synchronousTagCmd(workingDir, + {dialog.branchName(), change}, + &output, &errorMessage); VcsOutputWindow::append(output); if (!errorMessage.isEmpty()) VcsOutputWindow::append(errorMessage, VcsOutputWindow::MessageStyle::Error); }); auto resetChange = [workingDir, change](const QByteArray &resetType) { - GitPlugin::client()->reset( + GitClient::instance()->reset( workingDir, QLatin1String("--" + resetType), change); }; auto resetMenu = new QMenu(tr("&Reset to Change %1").arg(change), menu); diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 66e249fbf70..c413c6c2311 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -26,7 +26,6 @@ #include "gitgrep.h" #include "gitclient.h" #include "gitconstants.h" -#include "gitplugin.h" #include #include @@ -187,7 +186,7 @@ public: return QString(":!" + filter); }); arguments << "--" << filterArgs << exclusionArgs; - QScopedPointer command(GitPlugin::client()->createCommand(m_directory)); + QScopedPointer command(GitClient::instance()->createCommand(m_directory)); command->addFlags(VcsCommand::SilentOutput | VcsCommand::SuppressFailMessage); command->setProgressiveOutput(true); QFutureWatcher watcher; @@ -195,7 +194,7 @@ public: connect(&watcher, &QFutureWatcher::canceled, command.data(), &VcsCommand::cancel); connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read); - SynchronousProcessResponse resp = command->runCommand({GitPlugin::client()->vcsBinary(), arguments}, 0); + SynchronousProcessResponse resp = command->runCommand({GitClient::instance()->vcsBinary(), arguments}, 0); switch (resp.result) { case SynchronousProcessResponse::TerminatedAbnormally: case SynchronousProcessResponse::StartFailed: diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 55f71643c42..be99e377d26 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1760,11 +1760,11 @@ void GitPluginPrivate::updateCurrentBranch() QObject *GitPlugin::remoteCommand(const QStringList &options, const QString &workingDirectory, const QStringList &) { - if (!GitPlugin::client() || options.size() < 2) + if (options.size() < 2) return nullptr; if (options.first() == "-git-show") - GitPlugin::client()->show(workingDirectory, options.at(1)); + dd->m_gitClient.show(workingDirectory, options.at(1)); return nullptr; } diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index 35f7892dd65..ebba5b19f37 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -88,8 +88,8 @@ CommitDataFetchResult CommitDataFetchResult::fetch(CommitType commitType, const CommitDataFetchResult result; result.commitData.commitType = commitType; QString commitTemplate; - result.success = GitPlugin::client()->getCommitData(workingDirectory, &commitTemplate, - result.commitData, &result.errorMessage); + result.success = GitClient::instance()->getCommitData( + workingDirectory, &commitTemplate, result.commitData, &result.errorMessage); return result; } @@ -202,15 +202,15 @@ void GitSubmitEditor::slotDiffSelected(const QList &rows) } } if (!unstagedFiles.empty() || !stagedFiles.empty()) - GitPlugin::client()->diffFiles(m_workingDirectory, unstagedFiles, stagedFiles); + GitClient::instance()->diffFiles(m_workingDirectory, unstagedFiles, stagedFiles); if (!unmergedFiles.empty()) - GitPlugin::client()->merge(m_workingDirectory, unmergedFiles); + GitClient::instance()->merge(m_workingDirectory, unmergedFiles); } void GitSubmitEditor::showCommit(const QString &commit) { if (!m_workingDirectory.isEmpty()) - GitPlugin::client()->show(m_workingDirectory, commit); + GitClient::instance()->show(m_workingDirectory, commit); } void GitSubmitEditor::updateFileModel() @@ -230,7 +230,7 @@ void GitSubmitEditor::updateFileModel() Core::ProgressManager::addTask(m_fetchWatcher.future(), tr("Refreshing Commit Data"), TASK_UPDATE_COMMIT); - GitPlugin::client()->addFuture(m_fetchWatcher.future()); + GitClient::instance()->addFuture(m_fetchWatcher.future()); } void GitSubmitEditor::forceUpdateFileModel() diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp index 25c59bbcb7f..d4b0a9602d3 100644 --- a/src/plugins/git/logchangedialog.cpp +++ b/src/plugins/git/logchangedialog.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "logchangedialog.h" -#include "gitplugin.h" #include "gitclient.h" #include @@ -79,7 +78,7 @@ bool LogChangeWidget::init(const QString &repository, const QString &commit, Log return true; if (!(flags & Silent)) { VcsOutputWindow::appendError( - GitPlugin::client()->msgNoCommits(flags & IncludeRemotes)); + GitClient::instance()->msgNoCommits(flags & IncludeRemotes)); } return false; } @@ -159,8 +158,10 @@ bool LogChangeWidget::populateLog(const QString &repository, const QString &comm arguments << "--not" << "--remotes"; arguments << "--"; QString output; - if (!GitPlugin::client()->synchronousLog(repository, arguments, &output, nullptr, VcsCommand::NoOutput)) + if (!GitClient::instance()->synchronousLog( + repository, arguments, &output, nullptr, VcsCommand::NoOutput)) { return false; + } const QStringList lines = output.split('\n'); for (const QString &line : lines) { const int colonPos = line.indexOf(':'); @@ -211,8 +212,8 @@ LogChangeDialog::LogChangeDialog(bool isReset, QWidget *parent) : m_resetTypeComboBox->addItem(tr("Hard"), "--hard"); m_resetTypeComboBox->addItem(tr("Mixed"), "--mixed"); m_resetTypeComboBox->addItem(tr("Soft"), "--soft"); - m_resetTypeComboBox->setCurrentIndex(GitPlugin::client()->settings().intValue( - GitSettings::lastResetIndexKey)); + m_resetTypeComboBox->setCurrentIndex( + GitClient::instance()->settings().intValue(GitSettings::lastResetIndexKey)); popUpLayout->addWidget(m_resetTypeComboBox); popUpLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); } @@ -239,8 +240,8 @@ bool LogChangeDialog::runDialog(const QString &repository, if (QDialog::exec() == QDialog::Accepted) { if (m_resetTypeComboBox) { - GitPlugin::client()->settings().setValue(GitSettings::lastResetIndexKey, - m_resetTypeComboBox->currentIndex()); + GitClient::instance()->settings().setValue( + GitSettings::lastResetIndexKey, m_resetTypeComboBox->currentIndex()); } return true; } diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp index d951200784c..adc5d1ce7b4 100644 --- a/src/plugins/git/mergetool.cpp +++ b/src/plugins/git/mergetool.cpp @@ -60,7 +60,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files) m_process->setWorkingDirectory(workingDirectory); m_process->setProcessEnvironment(env); m_process->setProcessChannelMode(QProcess::MergedChannels); - const Utils::FilePath binary = GitPlugin::client()->vcsBinary(); + const Utils::FilePath binary = GitClient::instance()->vcsBinary(); VcsOutputWindow::appendCommand(workingDirectory, {binary, arguments}); m_process->start(binary.toString(), arguments); if (m_process->waitForStarted()) { @@ -263,7 +263,7 @@ void MergeTool::done() VcsOutputWindow::appendError(tr("Merge tool process terminated with exit code %1") .arg(exitCode)); } - GitPlugin::client()->continueCommandIfNeeded(workingDirectory, exitCode == 0); + GitClient::instance()->continueCommandIfNeeded(workingDirectory, exitCode == 0); GitPlugin::emitRepositoryChanged(workingDirectory); deleteLater(); } diff --git a/src/plugins/git/remotedialog.cpp b/src/plugins/git/remotedialog.cpp index b0e629f0643..912c1be4d9b 100644 --- a/src/plugins/git/remotedialog.cpp +++ b/src/plugins/git/remotedialog.cpp @@ -203,7 +203,7 @@ void RemoteDialog::pushToRemote() const int row = indexList.at(0).row(); const QString remoteName = m_remoteModel->remoteName(row); - GitPlugin::client()->push(m_remoteModel->workingDirectory(), {remoteName}); + GitClient::instance()->push(m_remoteModel->workingDirectory(), {remoteName}); } void RemoteDialog::fetchFromRemote() @@ -214,7 +214,7 @@ void RemoteDialog::fetchFromRemote() int row = indexList.at(0).row(); const QString remoteName = m_remoteModel->remoteName(row); - GitPlugin::client()->fetch(m_remoteModel->workingDirectory(), remoteName); + GitClient::instance()->fetch(m_remoteModel->workingDirectory(), remoteName); } void RemoteDialog::updateButtonState() diff --git a/src/plugins/git/remotemodel.cpp b/src/plugins/git/remotemodel.cpp index 0a0f30c1b4e..da2e2fe2d71 100644 --- a/src/plugins/git/remotemodel.cpp +++ b/src/plugins/git/remotemodel.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "remotemodel.h" -#include "gitplugin.h" #include "gitclient.h" #include @@ -55,7 +54,7 @@ bool RemoteModel::removeRemote(int row) { QString output; QString error; - bool success = GitPlugin::client()->synchronousRemoteCmd( + bool success = GitClient::instance()->synchronousRemoteCmd( m_workingDirectory, {"rm", remoteName(row)}, &output, &error); if (success) success = refresh(m_workingDirectory, &error); @@ -69,7 +68,7 @@ bool RemoteModel::addRemote(const QString &name, const QString &url) if (name.isEmpty() || url.isEmpty()) return false; - bool success = GitPlugin::client()->synchronousRemoteCmd( + bool success = GitClient::instance()->synchronousRemoteCmd( m_workingDirectory, {"add", name, url}, &output, &error); if (success) success = refresh(m_workingDirectory, &error); @@ -80,7 +79,7 @@ bool RemoteModel::renameRemote(const QString &oldName, const QString &newName) { QString output; QString error; - bool success = GitPlugin::client()->synchronousRemoteCmd( + bool success = GitClient::instance()->synchronousRemoteCmd( m_workingDirectory, {"rename", oldName, newName}, &output, &error); if (success) success = refresh(m_workingDirectory, &error); @@ -91,7 +90,7 @@ bool RemoteModel::updateUrl(const QString &name, const QString &newUrl) { QString output; QString error; - bool success = GitPlugin::client()->synchronousRemoteCmd( + bool success = GitClient::instance()->synchronousRemoteCmd( m_workingDirectory, {"set-url", name, newUrl}, &output, &error); if (success) success = refresh(m_workingDirectory, &error); @@ -186,7 +185,7 @@ bool RemoteModel::refresh(const QString &workingDirectory, QString *errorMessage // get list of remotes. QMap remotesList - = GitPlugin::client()->synchronousRemotesList(workingDirectory, errorMessage); + = GitClient::instance()->synchronousRemotesList(workingDirectory, errorMessage); beginResetModel(); m_remotes.clear(); diff --git a/src/plugins/git/stashdialog.cpp b/src/plugins/git/stashdialog.cpp index ef1b324f58f..f33791549e8 100644 --- a/src/plugins/git/stashdialog.cpp +++ b/src/plugins/git/stashdialog.cpp @@ -161,7 +161,7 @@ void StashDialog::refresh(const QString &repository, bool force) m_model->setStashes(QList()); } else { QList stashes; - GitPlugin::client()->synchronousStashList(m_repository, &stashes); + GitClient::instance()->synchronousStashList(m_repository, &stashes); m_model->setStashes(stashes); if (!stashes.isEmpty()) { for (int c = 0; c < ColumnCount; c++) @@ -177,7 +177,7 @@ void StashDialog::deleteAll() if (!ask(title, tr("Do you want to delete all stashes?"))) return; QString errorMessage; - if (GitPlugin::client()->synchronousStashRemove(m_repository, QString(), &errorMessage)) + if (GitClient::instance()->synchronousStashRemove(m_repository, QString(), &errorMessage)) refresh(m_repository, true); else warning(title, errorMessage); @@ -194,7 +194,7 @@ void StashDialog::deleteSelection() QStringList errors; // Delete in reverse order as stashes rotate for (int r = rows.size() - 1; r >= 0; r--) - if (!GitPlugin::client()->synchronousStashRemove(m_repository, m_model->at(rows.at(r)).name, &errorMessage)) + if (!GitClient::instance()->synchronousStashRemove(m_repository, m_model->at(rows.at(r)).name, &errorMessage)) errors.push_back(errorMessage); refresh(m_repository, true); if (!errors.isEmpty()) @@ -205,7 +205,7 @@ void StashDialog::showCurrent() { const int index = currentRow(); QTC_ASSERT(index >= 0, return); - GitPlugin::client()->show(m_repository, QString(m_model->at(index).name)); + GitClient::instance()->show(m_repository, QString(m_model->at(index).name)); } // Suggest Branch name to restore 'stash@{0}' -> 'stash0-date' @@ -266,7 +266,8 @@ bool StashDialog::promptForRestore(QString *stash, { const QString stashIn = *stash; bool modifiedPromptShown = false; - switch (GitPlugin::client()->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules), nullptr, errorMessage)) { + switch (GitClient::instance()->gitStatus( + m_repository, StatusMode(NoUntracked | NoSubmodules), nullptr, errorMessage)) { case GitClient::StatusFailed: return false; case GitClient::StatusChanged: { @@ -274,13 +275,15 @@ bool StashDialog::promptForRestore(QString *stash, case ModifiedRepositoryCancel: return false; case ModifiedRepositoryStash: - if (GitPlugin::client()->synchronousStash(m_repository, QString(), GitClient::StashPromptDescription).isEmpty()) + if (GitClient::instance()->synchronousStash( + m_repository, QString(), GitClient::StashPromptDescription).isEmpty()) { return false; + } *stash = nextStash(*stash); // Our stash id to be restored changed QTC_ASSERT(!stash->isEmpty(), return false); break; case ModifiedRepositoryDiscard: - if (!GitPlugin::client()->synchronousReset(m_repository)) + if (!GitClient::instance()->synchronousReset(m_repository)) return false; break; } @@ -317,7 +320,7 @@ void StashDialog::restoreCurrent() // Make sure repository is not modified, restore. The command will // output to window on success. if (promptForRestore(&name, nullptr, &errorMessage) - && GitPlugin::client()->synchronousStashRestore(m_repository, name)) { + && GitClient::instance()->synchronousStashRestore(m_repository, name)) { refresh(m_repository, true); // Might have stashed away local changes. } else if (!errorMessage.isEmpty()) { warning(msgRestoreFailedTitle(name), errorMessage); @@ -332,7 +335,7 @@ void StashDialog::restoreCurrentInBranch() QString branch; QString name = m_model->at(index).name; if (promptForRestore(&name, &branch, &errorMessage) - && GitPlugin::client()->synchronousStashRestore(m_repository, name, false, branch)) { + && GitClient::instance()->synchronousStashRestore(m_repository, name, false, branch)) { refresh(m_repository, true); // git deletes the stash, unfortunately. } else if (!errorMessage.isEmpty()) { warning(msgRestoreFailedTitle(name), errorMessage); From b52ffa250144c364068a158aee5cb54bfd676171 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 25 Feb 2020 20:20:43 +0200 Subject: [PATCH 08/29] Git: Move addChangeActions from GitEditor to GitClient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id901994ac2909b00ca58a0a8a91d2d3a273c39b3 Reviewed-by: André Hartmann Reviewed-by: hjk --- src/plugins/git/gitclient.cpp | 49 +++++++++++++++++++++++++++++++++ src/plugins/git/gitclient.h | 3 +++ src/plugins/git/giteditor.cpp | 51 +---------------------------------- src/plugins/git/giteditor.h | 1 - 4 files changed, 53 insertions(+), 51 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index f4130345cec..8608d947e1c 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -3596,6 +3596,55 @@ GitRemote::GitRemote(const QString &location) : Core::IVersionControl::RepoUrl(l isValid = QDir(path).exists() || QDir(path + ".git").exists(); } +void GitClient::addChangeActions(QMenu *menu, const QString &workingDir, const QString &change) +{ + menu->addAction(tr("Cherr&y-Pick Change %1").arg(change), [workingDir, change] { + m_instance->synchronousCherryPick(workingDir, change); + }); + menu->addAction(tr("Re&vert Change %1").arg(change), [workingDir, change] { + m_instance->synchronousRevert(workingDir, change); + }); + menu->addAction(tr("C&heckout Change %1").arg(change), [workingDir, change] { + m_instance->checkout(workingDir, change); + }); + connect(menu->addAction(tr("&Interactive Rebase from Change %1...").arg(change)), + &QAction::triggered, [workingDir, change] { + GitPlugin::startRebaseFromCommit(workingDir, change); + }); + menu->addAction(tr("&Log for Change %1").arg(change), [workingDir, change] { + m_instance->log(workingDir, QString(), false, {change}); + }); + menu->addAction(tr("Add &Tag for Change %1...").arg(change), [workingDir, change] { + QString output; + QString errorMessage; + m_instance->synchronousTagCmd(workingDir, QStringList(), + &output, &errorMessage); + + const QStringList tags = output.split('\n'); + BranchAddDialog dialog(tags, BranchAddDialog::Type::AddTag, Core::ICore::dialogParent()); + + if (dialog.exec() == QDialog::Rejected) + return; + + m_instance->synchronousTagCmd(workingDir, + {dialog.branchName(), change}, + &output, &errorMessage); + VcsOutputWindow::append(output); + if (!errorMessage.isEmpty()) + VcsOutputWindow::append(errorMessage, VcsOutputWindow::MessageStyle::Error); + }); + + auto resetChange = [workingDir, change](const QByteArray &resetType) { + m_instance->reset( + workingDir, QLatin1String("--" + resetType), change); + }; + auto resetMenu = new QMenu(tr("&Reset to Change %1").arg(change), menu); + resetMenu->addAction(tr("&Hard"), std::bind(resetChange, "hard")); + resetMenu->addAction(tr("&Mixed"), std::bind(resetChange, "mixed")); + resetMenu->addAction(tr("&Soft"), std::bind(resetChange, "soft")); + menu->addMenu(resetMenu); +} + } // namespace Internal } // namespace Git diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 932e2ee74f7..c159fb31375 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -353,6 +353,9 @@ public: VcsBase::VcsCommand *asyncUpstreamStatus(const QString &workingDirectory, const QString &branch, const QString &upstream); + + static void addChangeActions(QMenu *menu, const QString &workingDir, const QString &change); + private: void finishSubmoduleUpdate(); void chunkActionsRequested(QMenu *menu, int fileIndex, int chunkIndex, diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index 21b688b2e8a..36463955963 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -308,59 +308,10 @@ bool GitEditorWidget::isValidRevision(const QString &revision) const return GitClient::instance()->isValidRevision(revision); } -void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change, const QString &workingDir) -{ - menu->addAction(tr("Cherr&y-Pick Change %1").arg(change), [workingDir, change] { - GitClient::instance()->synchronousCherryPick(workingDir, change); - }); - menu->addAction(tr("Re&vert Change %1").arg(change), [workingDir, change] { - GitClient::instance()->synchronousRevert(workingDir, change); - }); - menu->addAction(tr("C&heckout Change %1").arg(change), [workingDir, change] { - GitClient::instance()->checkout(workingDir, change); - }); - connect(menu->addAction(tr("&Interactive Rebase from Change %1...").arg(change)), - &QAction::triggered, [workingDir, change] { - GitPlugin::startRebaseFromCommit(workingDir, change); - }); - menu->addAction(tr("&Log for Change %1").arg(change), [workingDir, change] { - GitClient::instance()->log(workingDir, QString(), false, {change}); - }); - menu->addAction(tr("Add &Tag for Change %1...").arg(change), [workingDir, change] { - QString output; - QString errorMessage; - GitClient::instance()->synchronousTagCmd(workingDir, QStringList(), - &output, &errorMessage); - - const QStringList tags = output.split('\n'); - BranchAddDialog dialog(tags, BranchAddDialog::Type::AddTag, Core::ICore::dialogParent()); - - if (dialog.exec() == QDialog::Rejected) - return; - - GitClient::instance()->synchronousTagCmd(workingDir, - {dialog.branchName(), change}, - &output, &errorMessage); - VcsOutputWindow::append(output); - if (!errorMessage.isEmpty()) - VcsOutputWindow::append(errorMessage, VcsOutputWindow::MessageStyle::Error); - }); - - auto resetChange = [workingDir, change](const QByteArray &resetType) { - GitClient::instance()->reset( - workingDir, QLatin1String("--" + resetType), change); - }; - auto resetMenu = new QMenu(tr("&Reset to Change %1").arg(change), menu); - resetMenu->addAction(tr("&Hard"), std::bind(resetChange, "hard")); - resetMenu->addAction(tr("&Mixed"), std::bind(resetChange, "mixed")); - resetMenu->addAction(tr("&Soft"), std::bind(resetChange, "soft")); - menu->addMenu(resetMenu); -} - void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change) { if (contentType() != OtherContent) - addChangeActions(menu, change, sourceWorkingDirectory()); + GitClient::addChangeActions(menu, change, sourceWorkingDirectory()); } QString GitEditorWidget::revisionSubject(const QTextBlock &inBlock) const diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h index b2eab5de72d..0377c2d6806 100644 --- a/src/plugins/git/giteditor.h +++ b/src/plugins/git/giteditor.h @@ -66,7 +66,6 @@ private: QStringList annotationPreviousVersions(const QString &revision) const override; bool isValidRevision(const QString &revision) const override; void addChangeActions(QMenu *menu, const QString &change) override; - static void addChangeActions(QMenu *menu, const QString &workingDir, const QString &change); QString revisionSubject(const QTextBlock &inBlock) const override; bool supportChangeLinks() const override; QString fileNameForLine(int line) const override; From f15d6d0bafeb2d5be6c564413f9fd51827221af0 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 25 Feb 2020 23:02:44 +0200 Subject: [PATCH 09/29] VCS: Set repository for VcsCommand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes file names right-clickable. Change-Id: I96ba21e73d54819148f13fcb033a144146b00418 Reviewed-by: André Hartmann --- src/plugins/vcsbase/vcscommand.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp index 76a53f06e6a..3b1697c1367 100644 --- a/src/plugins/vcsbase/vcscommand.cpp +++ b/src/plugins/vcsbase/vcscommand.cpp @@ -43,6 +43,7 @@ VcsCommand::VcsCommand(const QString &workingDirectory, Core::ShellCommand(workingDirectory, environment), m_preventRepositoryChanged(false) { + VcsOutputWindow::setRepository(workingDirectory); setOutputProxyFactory([this] { auto proxy = new OutputProxy; VcsOutputWindow *outputWindow = VcsOutputWindow::instance(); From 29ab2d3644c128362b19e3a33ddde05c50d75f88 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 21 Feb 2020 15:17:04 +0100 Subject: [PATCH 10/29] Squish: Break endless loop in tst_CSUP06 Change-Id: Id0762128a9c2b6b3cc15684ff1b35c38b3a64c97 Reviewed-by: Christian Stenger --- tests/system/objects.map | 1 + tests/system/suite_CSUP/tst_CSUP06/test.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index 1144af6ce21..b5d903b7bd2 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -196,6 +196,7 @@ :Session Manager_ProjectExplorer::Internal::SessionDialog {name='ProjectExplorer__Internal__SessionDialog' type='ProjectExplorer::Internal::SessionDialog' visible='1' windowTitle='Session Manager'} :Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'} :User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'} +:Utils::FakeToolTip {type='Utils::FakeToolTip' unnamed='1' visible='1'} :Widget Box_qdesigner_internal::WidgetBoxTreeWidget {container=':*Qt Creator.Widget Box_QDockWidget' type='qdesigner_internal::WidgetBoxTreeWidget' unnamed='1' visible='1'} :Working Copy_Utils::BaseValidatingLineEdit {type='Utils::FancyLineEdit' unnamed='1' visible='1' window=':New_ProjectExplorer::JsonWizard'} :WritePermissions_Core::Internal::ReadOnlyFilesDialog {name='Core__Internal__ReadOnlyFilesDialog' type='Core::ReadOnlyFilesDialog' visible='1' windowTitle='Files Without Write Permissions'} diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 9e094b0a0dd..3626a959510 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -28,7 +28,9 @@ source("../../shared/qtcreator.py") def moveDownToNextNonEmptyLine(editor): currentLine = "" # there's no do-while in python - so use empty line which fails while not currentLine: - type(editor, "") + if waitFor("object.exists(':Utils::FakeToolTip')", 100): + type(editor, "") # close possibly shown completion tooltip so pressing + type(editor, "") # down scrolls the line, not completion alternatives currentLine = str(lineUnderCursor(editor)).strip() return currentLine From e7ca8fbee4ee32a667236500d1f27a392c83752f Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 25 Feb 2020 17:20:00 +0100 Subject: [PATCH 11/29] QmlDesigner: Allow bigger size overrides in form editor Task-number: QDS-1714 Change-Id: I12e01c5bab54ce4f796df48252709027446dd781 Reviewed-by: Alessandro Portale --- .../qmldesigner/components/formeditor/lineeditaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/formeditor/lineeditaction.cpp b/src/plugins/qmldesigner/components/formeditor/lineeditaction.cpp index 5f9e7f571ba..8f5dd75718d 100644 --- a/src/plugins/qmldesigner/components/formeditor/lineeditaction.cpp +++ b/src/plugins/qmldesigner/components/formeditor/lineeditaction.cpp @@ -55,7 +55,7 @@ QWidget *LineEditAction::createWidget(QWidget *parent) QFont font = lineEdit->font(); font.setPixelSize(Theme::instance()->smallFontPixelSize()); lineEdit->setFont(font); - lineEdit->setValidator(new QIntValidator(0, 4096, this)); + lineEdit->setValidator(new QIntValidator(0, 99999, this)); connect(lineEdit, &QLineEdit::textEdited, this, &LineEditAction::textChanged); connect(this, &LineEditAction::lineEditTextClear, lineEdit, &QLineEdit::clear); From 82b6de6db6fe2be3a2c178fb713309da84ca00b6 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 25 Feb 2020 19:28:35 +0100 Subject: [PATCH 12/29] CMake Build: Add qtdiag to Dependencies install target Change-Id: If1c56ff6e366ec4d5c4bb97e4a176cf9cf8dc4c5 Reviewed-by: Alessandro Portale --- cmake/CMakeLists.txt | 12 ++++++++++++ cmake/QtCreatorAPI.cmake | 13 ++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 47c8c696f0d..a005ce71e8c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -41,6 +41,18 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) ${exclusion_mask} ) + # QtCreator's "System Information..." needs qtdiag + set(qtdiag_destination ${IDE_BIN_PATH}) + if (NOT APPLE AND NOT WIN32) + set(qtdiag_destination ${IDE_LIBRARY_BASE_PATH}/Qt/bin) + endif() + install(PROGRAMS + "${QT_BASE_DIR}/bin/qtdiag${CMAKE_EXECUTABLE_SUFFIX}" + DESTINATION ${qtdiag_destination} + COMPONENT Dependencies + EXCLUDE_FROM_ALL + ) + # Analyze the binaries and install missing dependencies if they are # found the CMAKE_PREFIX_PATH e.g. Qt, Clang configure_file(InstallDependentSharedObjects.cmake.in InstallDependentSharedObjects.cmake @ONLY) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index bbfb0a214be..751f2d4f6f0 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -1044,7 +1044,18 @@ function(add_qtc_executable name) \"Prefix=\${qt_conf_binaries}\n\" ) endif() - + if (WIN32 OR APPLE) + file(RELATIVE_PATH qt_binaries + \"\${install_prefix}/\${base_dir}\" + \"\${install_prefix}/${IDE_BIN_PATH}\" + ) + if (NOT qt_binaries) + set(qt_binaries .) + endif() + file(APPEND \"\${CMAKE_INSTALL_PREFIX}/\${location}/qt.conf\" + \"# Needed by QtCreator for qtdiag\n\" + \"Binaries=\${qt_binaries}\n\") + endif() endfunction() if(APPLE) create_qt_conf(\"${_EXECUTABLE_PATH}\" \"${IDE_DATA_PATH}/..\") From 4e058a10b48cefa4841e9129d9bf7a99e05f3211 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 25 Feb 2020 20:02:38 +0100 Subject: [PATCH 13/29] CMake Build: Fix linking PythonPlugin in Debug mode with MinGW PythonPlugin depends on LanguageClient, which has a private dependency on LanguageServerProtocol. This fixes this error: src/plugins/python/CMakeFiles/Python.dir/pythonrunconfiguration.cpp.obj: In function `int LanguageServerProtocol::JsonObject::typedValue(QString const&) const': src/libs/languageserverprotocol/jsonobject.h:134: undefined reference to `__imp__ZN22LanguageServerProtocol13fromJsonValueIiEET_RK10QJsonValue' Change-Id: I7cacbf68a00ff9ff2a6ab9618bc6ec371247a0aa Reviewed-by: Alessandro Portale --- src/plugins/languageclient/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/languageclient/CMakeLists.txt b/src/plugins/languageclient/CMakeLists.txt index d1910757dbc..abddb9cd968 100644 --- a/src/plugins/languageclient/CMakeLists.txt +++ b/src/plugins/languageclient/CMakeLists.txt @@ -1,5 +1,5 @@ add_qtc_plugin(LanguageClient - DEPENDS LanguageServerProtocol Qt5::Core + PUBLIC_DEPENDS LanguageServerProtocol Qt5::Core PLUGIN_DEPENDS ProjectExplorer Core TextEditor SOURCES client.cpp client.h From a3635a697be34e8c301a8a1b901d1f33bd95adc0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 19 Feb 2020 16:25:38 +0100 Subject: [PATCH 14/29] ProjectExplorer: Prevent telemetry collection by VS command-line tools Apparently, recent Visual Studio installations try to collect temeletry information via powershell in vsdevcmd.bat, which interferes with our toolchain setup process. Turn this behavior off. Task-number: QTCREATORBUG-20886 Change-Id: Ia81652fc721119980da980c043991df27f10a10f Reviewed-by: Oliver Wolff --- src/plugins/projectexplorer/msvctoolchain.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 2ab52663d08..9748b52f7fb 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -2053,6 +2053,7 @@ Utils::optional MsvcToolChain::generateEnvironmentSettings(const Utils: } if (Utils::HostOsInfo::isWindowsHost()) saver.write("chcp 65001\r\n"); + saver.write("set VSCMD_SKIP_SENDTELEMETRY=1\r\n"); saver.write(call + "\r\n"); saver.write("@echo " + marker.toLocal8Bit() + "\r\n"); saver.write("set\r\n"); From c3c57087416985f41629ff7cb146ce064350bfec Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Tue, 25 Feb 2020 12:27:23 +0200 Subject: [PATCH 15/29] Android: make sure old autodected toolchains are marked as autoDetected Some toolchains that were auto detected in previous sessions or version of Creator might re-appear as manual toolchains. Thus, make sure that's fixed. Also, make sure the name of old toolchains is updated with the current name format. Change-Id: I04d2145cb9c5e1e25e2bcbc21c014280bc355195 Reviewed-by: Alessandro Portale --- src/plugins/android/androidtoolchain.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index a9f5aeb2816..42ea48ee97c 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -228,8 +228,16 @@ ToolChainList AndroidToolChainFactory::autodetectToolChainsForNdk(const ToolChai const Abi &abi = targetItr.value(); const QString target = targetItr.key(); ToolChain *tc = findToolChain(compilerCommand, lang, target, alreadyKnown); + + const QString displayName(QString("Android Clang (%1, %2, NDK %3)") + .arg(ToolChainManager::displayNameOfLanguageId(lang), + AndroidConfig::displayName(abi), + config.ndkVersion(qtVersion).toString())); if (tc) { qCDebug(androidTCLog) << "Tool chain already known" << abi.toString() << lang; + // make sure to update the toolchain with current name format + if (tc->displayName() != displayName) + tc->setDisplayName(displayName); } else { qCDebug(androidTCLog) << "New Clang toolchain found" << abi.toString() << lang; auto atc = new AndroidToolChain(); @@ -239,14 +247,11 @@ ToolChainList AndroidToolChainFactory::autodetectToolChainsForNdk(const ToolChai atc->setTargetAbi(ClangTargets[target]); atc->setPlatformCodeGenFlags({"-target", target}); atc->setPlatformLinkerFlags({"-target", target}); - atc->setDetection(ToolChain::AutoDetection); - atc->setDisplayName(QString("Android Clang (%1, %2, NDK %3)") - .arg(ToolChainManager::displayNameOfLanguageId(lang), - AndroidConfig::displayName(abi), - config.ndkVersion(qtVersion).toString())); + atc->setDisplayName(displayName); atc->resetToolChain(compilerCommand); tc = atc; } + tc->setDetection(ToolChain::AutoDetection); result << tc; ++targetItr; } From 3a52269a1d5aad26cd6fb28b89311feec0ef76d0 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 26 Feb 2020 12:41:49 +0100 Subject: [PATCH 16/29] scripts: build.py: Handle Null path in default_python3() Change-Id: Ice6b269502a77f31a7af447429bba4332df026e9 Reviewed-by: Eike Ziller --- scripts/build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build.py b/scripts/build.py index 4724ece02a7..ec50a21b8e6 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -44,7 +44,9 @@ def default_python3(): path_system = os.path.join('/usr', 'bin') if not common.is_windows_platform() else None path = os.environ.get('PYTHON3_PATH') or path_system postfix = '.exe' if common.is_windows_platform() else '' - return existing_path(os.path.join(path, 'python3' + postfix)) or existing_path(os.path.join(path, 'python' + postfix)) + return (path if not path + else (existing_path(os.path.join(path, 'python3' + postfix)) or + existing_path(os.path.join(path, 'python' + postfix)))) def get_arguments(): parser = argparse.ArgumentParser(description='Build Qt Creator for packaging') From be2da106eefe36f4c89ba6259953ff36a3b7d53e Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 26 Feb 2020 13:09:02 +0100 Subject: [PATCH 17/29] Utils: clean up CMake code Re-use an existing variable, which contains the same information. Change-Id: I1daa6428d67f11dd2efccd43ff6bab76420236ae Reviewed-by: Alessandro Portale --- src/libs/utils/CMakeLists.txt | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/libs/utils/CMakeLists.txt b/src/libs/utils/CMakeLists.txt index a0663ebd8f3..ff7bbe62862 100644 --- a/src/libs/utils/CMakeLists.txt +++ b/src/libs/utils/CMakeLists.txt @@ -1,19 +1,8 @@ -if (IDE_LIBEXEC_PATH AND IDE_BIN_PATH) - get_filename_component(bin_path - "${CMAKE_INSTALL_PREFIX}/${IDE_BIN_PATH}" ABSOLUTE "${CMAKE_BINARY_DIR}") - get_filename_component(libexec_path - "${CMAKE_INSTALL_PREFIX}/${IDE_LIBEXEC_PATH}" ABSOLUTE "${CMAKE_BINARY_DIR}") - file(RELATIVE_PATH RELATIVE_TOOLS_PATH "${bin_path}" "${libexec_path}") -else() - message(WARNING "IDE_LIBEXEC_PATH or IDE_BIN_PATH undefined when calculating tools path") - set(RELATIVE_TOOLS_PATH "") -endif() - add_qtc_library(Utils DEPENDS Qt5::Xml PUBLIC_DEPENDS Qt5::Concurrent Qt5::Core Qt5::Network Qt5::Qml Qt5::Gui Qt5::Widgets DEFINES - "QTC_REL_TOOLS_PATH=\"${RELATIVE_TOOLS_PATH}\"" + "QTC_REL_TOOLS_PATH=\"${RELATIVE_LIBEXEC_PATH}\"" SOURCES ../3rdparty/optional/optional.hpp ../3rdparty/variant/variant.hpp From 2cd44a546f5dd15cd286ec33744c1d876f8adcde Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 24 Feb 2020 14:58:36 +0100 Subject: [PATCH 18/29] ProjectExplorer: Inline RunConfiguration::isActive ... into the only internal caller. The use there is dubious to some degree. Change-Id: Icfa7437b3fdaa4dbd73fe9965a88abf4700cd3e0 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/runconfiguration.cpp | 9 +++------ src/plugins/projectexplorer/runconfiguration.h | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 03c908a8596..303f6298a56 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -204,11 +204,6 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id) RunConfiguration::~RunConfiguration() = default; -bool RunConfiguration::isActive() const -{ - return target()->isActive() && target()->activeRunConfiguration() == this; -} - QString RunConfiguration::disabledReason() const { BuildSystem *bs = activeBuildSystem(); @@ -305,7 +300,9 @@ void RunConfiguration::update() emit enabledChanged(); - if (isActive() && project() == SessionManager::startupProject()) + const bool isActive = target()->isActive() && target()->activeRunConfiguration() == this; + + if (isActive && project() == SessionManager::startupProject()) emit ProjectExplorerPlugin::instance()->updateRunActions(); } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 053bd600136..995cc783723 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -127,8 +127,6 @@ class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration public: ~RunConfiguration() override; - bool isActive() const; - virtual QString disabledReason() const; virtual bool isEnabled() const; From 3749979ba89ad9f7294b2d269990a6b4cfea0081 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Wed, 26 Feb 2020 11:30:32 +0100 Subject: [PATCH 19/29] QmlDesigner: Fix compile for Qt5.13 Change-Id: I963997432e643d7e7ca5d4ddc2419534191d3c36 Reviewed-by: Christian Stenger --- .../propertyeditor/gradientpresetdefaultlistmodel.cpp | 2 +- .../components/propertyeditor/gradientpresetitem.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp index 3977eff168a..f379ec53289 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp @@ -57,7 +57,7 @@ void GradientPresetDefaultListModel::addAllPresets() for (int i = 0; i < metaEnum.keyCount(); i++) { auto preset = GradientPresetItem::Preset(metaEnum.value(i)); - if (preset < GradientPresetItem::Preset::NumPresets) + if (preset < GradientPresetItem::numPresets) addItem(GradientPresetItem(preset)); } } diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h index 4cb5a519fbf..cec45bb4af0 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h @@ -42,7 +42,13 @@ public: #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) using Preset = QGradient::Preset; #else - enum Preset { NumPresets = 0 }; + enum Preset {}; +#endif + +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + static const int numPresets = Preset::NumPresets; +#else + static const int numPresets = 181; #endif explicit GradientPresetItem(); From 9684a5f269bdbece727893747dc28d455faf4c0f Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Tue, 25 Feb 2020 11:22:36 +0100 Subject: [PATCH 20/29] QmlDesigner: Integrate upstream commits - Integrate the newest commits from the base repository dec170ed24679fd49f9fb54af91f61146838f852 34cb2ae91790fc65ca5c0f7b81bb928de22a32e5 - Cleanup a few if statements - Cleanup a comment Change-Id: I158bff610f701e7a30680cfb8383f64475199bbe Reviewed-by: Thomas Hartmann --- src/libs/advanceddockingsystem/dockoverlay.h | 14 +-- src/libs/advanceddockingsystem/dockwidget.cpp | 110 +++++++----------- .../floatingdockcontainer.cpp | 6 +- .../floatingdragpreview.cpp | 37 +++--- 4 files changed, 68 insertions(+), 99 deletions(-) diff --git a/src/libs/advanceddockingsystem/dockoverlay.h b/src/libs/advanceddockingsystem/dockoverlay.h index b7243c29a63..04f9d627510 100644 --- a/src/libs/advanceddockingsystem/dockoverlay.h +++ b/src/libs/advanceddockingsystem/dockoverlay.h @@ -138,13 +138,13 @@ struct DockOverlayCrossPrivate; * You can style the cross icon using the property system. * \code * ADS--DockOverlayCross - { - qproperty-iconFrameColor: palette(highlight); - qproperty-iconBackgroundColor: palette(base); - qproperty-iconOverlayColor: palette(highlight); - qproperty-iconArrowColor: rgb(227, 227, 227); - qproperty-iconShadowColor: rgb(0, 0, 0); - } + * { + * qproperty-iconFrameColor: palette(highlight); + * qproperty-iconBackgroundColor: palette(base); + * qproperty-iconOverlayColor: palette(highlight); + * qproperty-iconArrowColor: rgb(227, 227, 227); + * qproperty-iconShadowColor: rgb(0, 0, 0); + * } * \endcode * Or you can use the iconColors property to pass in AARRGGBB values as * hex string like shown in the example below. diff --git a/src/libs/advanceddockingsystem/dockwidget.cpp b/src/libs/advanceddockingsystem/dockwidget.cpp index 08857994b5e..5b4ff87265d 100644 --- a/src/libs/advanceddockingsystem/dockwidget.cpp +++ b/src/libs/advanceddockingsystem/dockwidget.cpp @@ -154,16 +154,18 @@ namespace ADS void DockWidgetPrivate::updateParentDockArea() { - if (!m_dockArea) { + if (!m_dockArea) + return; + + // we don't need to change the current tab if the current DockWidget is not the one being closed + if (m_dockArea->currentDockWidget() != q) return; - } auto nextDockWidget = m_dockArea->nextOpenDockWidget(q); - if (nextDockWidget) { + if (nextDockWidget) m_dockArea->setCurrentDockWidget(nextDockWidget); - } else { + else m_dockArea->hideAreaWithNoVisibleContent(); - } } void DockWidgetPrivate::setupToolBar() @@ -222,9 +224,8 @@ namespace ADS QScrollArea *scrollAreaWidget = qobject_cast(widget); if (scrollAreaWidget || ForceNoScrollArea == insertMode) { d->m_layout->addWidget(widget); - if (scrollAreaWidget && scrollAreaWidget->viewport()) { + if (scrollAreaWidget && scrollAreaWidget->viewport()) scrollAreaWidget->viewport()->setProperty("dockWidgetContent", true); - } } else { d->setupScrollArea(); d->m_scrollArea->setWidget(widget); @@ -283,9 +284,8 @@ namespace ADS bool DockWidget::isFloating() const { - if (!isInFloatingContainer()) { + if (!isInFloatingContainer()) return false; - } return dockContainer()->topLevelDockWidget() == this; } @@ -293,13 +293,11 @@ namespace ADS bool DockWidget::isInFloatingContainer() const { auto container = dockContainer(); - if (!container) { + if (!container) return false; - } - if (!container->isFloating()) { + if (!container->isFloating()) return false; - } return true; } @@ -324,17 +322,16 @@ namespace ADS // If the toggle view action mode is ActionModeShow, then Open is always // true if the sender is the toggle view action QAction *action = qobject_cast(sender()); - if (action == d->m_toggleViewAction && !d->m_toggleViewAction->isCheckable()) { + if (action == d->m_toggleViewAction && !d->m_toggleViewAction->isCheckable()) open = true; - } + // If the dock widget state is different, then we really need to toggle // the state. If we are in the right state, then we simply make this // dock widget the current dock widget - if (d->m_closed != !open) { + if (d->m_closed != !open) toggleViewInternal(open); - } else if (open && d->m_dockArea) { + else if (open && d->m_dockArea) d->m_dockArea->setCurrentDockWidget(this); - } } void DockWidget::toggleViewInternal(bool open) @@ -353,13 +350,11 @@ namespace ADS //d->m_toggleViewAction->blockSignals(true); d->m_toggleViewAction->setChecked(open); //d->m_toggleViewAction->blockSignals(false); - if (d->m_dockArea) { + if (d->m_dockArea) d->m_dockArea->toggleDockWidgetView(this, open); - } - if (open && topLevelDockWidgetBefore) { + if (open && topLevelDockWidgetBefore) DockWidget::emitTopLevelEventForWidget(topLevelDockWidgetBefore, false); - } // Here we need to call the dockContainer() function again, because if // this dock widget was unassigned before the call to showDockWidget() then @@ -370,13 +365,12 @@ namespace ADS : nullptr; DockWidget::emitTopLevelEventForWidget(topLevelDockWidgetAfter, true); FloatingDockContainer *floatingContainer = dockContainerWidget->floatingWidget(); - if (floatingContainer) { + if (floatingContainer) floatingContainer->updateWindowTitle(); - } - if (!open) { + if (!open) emit closed(); - } + emit viewToggled(open); } @@ -440,24 +434,22 @@ namespace ADS #ifndef QT_NO_TOOLTIP void DockWidget::setTabToolTip(const QString &text) { - if (d->m_tabWidget) { + if (d->m_tabWidget) d->m_tabWidget->setToolTip(text); - } - if (d->m_toggleViewAction) { + + if (d->m_toggleViewAction) d->m_toggleViewAction->setToolTip(text); - } - if (d->m_dockArea) { + + if (d->m_dockArea) d->m_dockArea->markTitleBarMenuOutdated(); //update tabs menu - } } #endif void DockWidget::setIcon(const QIcon &icon) { d->m_tabWidget->setIcon(icon); - if (!d->m_toggleViewAction->isCheckable()) { + if (!d->m_toggleViewAction->isCheckable()) d->m_toggleViewAction->setIcon(icon); - } } QIcon DockWidget::icon() const { return d->m_tabWidget->icon(); } @@ -466,18 +458,16 @@ namespace ADS QToolBar *DockWidget::createDefaultToolBar() { - if (!d->m_toolBar) { + if (!d->m_toolBar) d->setupToolBar(); - } return d->m_toolBar; } void DockWidget::setToolBar(QToolBar *toolBar) { - if (d->m_toolBar) { + if (d->m_toolBar) delete d->m_toolBar; - } d->m_toolBar = toolBar; d->m_layout->insertWidget(0, d->m_toolBar); @@ -487,59 +477,52 @@ namespace ADS void DockWidget::setToolBarStyle(Qt::ToolButtonStyle style, eState state) { - if (StateFloating == state) { + if (StateFloating == state) d->m_toolBarStyleFloating = style; - } else { + else d->m_toolBarStyleDocked = style; - } setToolbarFloatingStyle(isFloating()); } Qt::ToolButtonStyle DockWidget::toolBarStyle(eState state) const { - if (StateFloating == state) { + if (StateFloating == state) return d->m_toolBarStyleFloating; - } else { + else return d->m_toolBarStyleDocked; - } } void DockWidget::setToolBarIconSize(const QSize &iconSize, eState state) { - if (StateFloating == state) { + if (StateFloating == state) d->m_toolBarIconSizeFloating = iconSize; - } else { + else d->m_toolBarIconSizeDocked = iconSize; - } setToolbarFloatingStyle(isFloating()); } QSize DockWidget::toolBarIconSize(eState state) const { - if (StateFloating == state) { + if (StateFloating == state) return d->m_toolBarIconSizeFloating; - } else { + else return d->m_toolBarIconSizeDocked; - } } void DockWidget::setToolbarFloatingStyle(bool floating) { - if (!d->m_toolBar) { + if (!d->m_toolBar) return; - } auto iconSize = floating ? d->m_toolBarIconSizeFloating : d->m_toolBarIconSizeDocked; - if (iconSize != d->m_toolBar->iconSize()) { + if (iconSize != d->m_toolBar->iconSize()) d->m_toolBar->setIconSize(iconSize); - } auto buttonStyle = floating ? d->m_toolBarStyleFloating : d->m_toolBarStyleDocked; - if (buttonStyle != d->m_toolBar->toolButtonStyle()) { + if (buttonStyle != d->m_toolBar->toolButtonStyle()) d->m_toolBar->setToolButtonStyle(buttonStyle); - } } void DockWidget::emitTopLevelEventForWidget(DockWidget *topLevelDockWidget, bool floating) @@ -564,9 +547,9 @@ namespace ADS void DockWidget::setFloating() { - if (isClosed()) { + if (isClosed()) return; - } + d->m_tabWidget->detachDockWidget(); } @@ -584,13 +567,11 @@ namespace ADS bool DockWidget::closeDockWidgetInternal(bool forceClose) { - if (!forceClose) { + if (!forceClose) emit closeRequested(); - } - if (!forceClose && features().testFlag(DockWidget::CustomCloseHandling)) { + if (!forceClose && features().testFlag(DockWidget::CustomCloseHandling)) return false; - } if (features().testFlag(DockWidget::DockWidgetDeleteOnClose)) { // If the dock widget is floating, then we check if we also need to @@ -598,11 +579,10 @@ namespace ADS if (isFloating()) { FloatingDockContainer* floatingWidget = internal::findParent< FloatingDockContainer *>(this); - if (floatingWidget->dockWidgets().count() == 1) { + if (floatingWidget->dockWidgets().count() == 1) floatingWidget->deleteLater(); - } else { + else floatingWidget->hide(); - } } deleteDockWidget(); } else { diff --git a/src/libs/advanceddockingsystem/floatingdockcontainer.cpp b/src/libs/advanceddockingsystem/floatingdockcontainer.cpp index 2fbe879f471..6bf2d9efbdc 100644 --- a/src/libs/advanceddockingsystem/floatingdockcontainer.cpp +++ b/src/libs/advanceddockingsystem/floatingdockcontainer.cpp @@ -112,7 +112,7 @@ namespace ADS if (testConfigFlag(DockManager::FloatingContainerHasWidgetTitle)) { setWindowTitle(currentWidget->windowTitle()); } else { - setWindowTitle(qApp->applicationDisplayName()); + setWindowTitle(QApplication::applicationDisplayName()); } // reflect CurrentWidget's icon if configured to do so, otherwise display application icon as window icon @@ -495,7 +495,7 @@ namespace ADS &FloatingDockContainer::onDockAreaCurrentChanged); d->m_singleDockArea = nullptr; } - d->setWindowTitle(qApp->applicationDisplayName()); + d->setWindowTitle(QApplication::applicationDisplayName()); setWindowIcon(QApplication::windowIcon()); } } @@ -507,7 +507,7 @@ namespace ADS DockWidget *currentWidget = topLevelDockArea->currentDockWidget(); d->reflectCurrentWidget(currentWidget); } else { - d->setWindowTitle(qApp->applicationDisplayName()); + d->setWindowTitle(QApplication::applicationDisplayName()); setWindowIcon(QApplication::windowIcon()); } } diff --git a/src/libs/advanceddockingsystem/floatingdragpreview.cpp b/src/libs/advanceddockingsystem/floatingdragpreview.cpp index 41dadfc9790..b54b6bfbf06 100644 --- a/src/libs/advanceddockingsystem/floatingdragpreview.cpp +++ b/src/libs/advanceddockingsystem/floatingdragpreview.cpp @@ -96,22 +96,19 @@ namespace ADS void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &globalPosition) { - if (!q->isVisible() || !m_dockManager) { + if (!q->isVisible() || !m_dockManager) return; - } auto containers = m_dockManager->dockContainers(); DockContainerWidget *topContainer = nullptr; for (auto containerWidget : containers) { - if (!containerWidget->isVisible()) { + if (!containerWidget->isVisible()) continue; - } QPoint mappedPosition = containerWidget->mapFromGlobal(globalPosition); if (containerWidget->rect().contains(mappedPosition)) { - if (!topContainer || containerWidget->isInFrontOf(topContainer)) { + if (!topContainer || containerWidget->isInFrontOf(topContainer)) topContainer = containerWidget; - } } } @@ -124,9 +121,9 @@ namespace ADS if (!topContainer) { containerOverlay->hideOverlay(); dockAreaOverlay->hideOverlay(); - if (DockManager::configFlags().testFlag(DockManager::DragPreviewIsDynamic)) { + if (DockManager::configFlags().testFlag(DockManager::DragPreviewIsDynamic)) setHidden(false); - } + return; } @@ -153,9 +150,8 @@ namespace ADS } } else { dockAreaOverlay->hideOverlay(); - if (dockArea == m_contentSourceArea && InvalidDockWidgetArea == containerDropArea) { + if (dockArea == m_contentSourceArea && InvalidDockWidgetArea == containerDropArea) m_dropContainer = nullptr; - } } if (DockManager::configFlags().testFlag(DockManager::DragPreviewIsDynamic)) { @@ -199,7 +195,10 @@ namespace ADS connect(qApp, &QApplication::applicationStateChanged, this, - &FloatingDragPreview::onApplicationStateChanged); // TODO + &FloatingDragPreview::onApplicationStateChanged); + // The focused object will receive key press events and therefore we install + // the event filter on it to receive escape key press for drag canceling + QApplication::focusObject()->installEventFilter(this); } FloatingDragPreview::FloatingDragPreview(DockWidget *content) @@ -212,9 +211,6 @@ namespace ADS d->m_contenSourceContainer = content->dockContainer(); } setWindowTitle(content->windowTitle()); - // We need to install an event filter for the given content - // widget to receive the escape key press - content->dockAreaWidget()->installEventFilter(this); } FloatingDragPreview::FloatingDragPreview(DockAreaWidget *content) @@ -225,10 +221,6 @@ namespace ADS d->m_contentSourceArea = content; d->m_contenSourceContainer = content->dockContainer(); setWindowTitle(content->currentDockWidget()->windowTitle()); - - // We need to install an event filter for the given Content - // widget to receive the escape key press - content->installEventFilter(this); } FloatingDragPreview::~FloatingDragPreview() { delete d; } @@ -277,9 +269,8 @@ namespace ADS floatingWidget = new FloatingDockContainer(dockWidget); } else { DockAreaWidget *dockArea = qobject_cast(d->m_content); - if (dockArea->features().testFlag(DockWidget::DockWidgetFloatable)) { + if (dockArea->features().testFlag(DockWidget::DockWidgetFloatable)) floatingWidget = new FloatingDockContainer(dockArea); - } } if (floatingWidget) { @@ -303,14 +294,12 @@ namespace ADS void FloatingDragPreview::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - if (d->m_hidden) { + if (d->m_hidden) return; - } QPainter painter(this); - if (DockManager::configFlags().testFlag(DockManager::DragPreviewShowsContentPixmap)) { + if (DockManager::configFlags().testFlag(DockManager::DragPreviewShowsContentPixmap)) painter.drawPixmap(QPoint(0, 0), d->m_contentPreviewPixmap); - } // If we do not have a window frame then we paint a QRubberBand like frameless window if (!DockManager::configFlags().testFlag(DockManager::DragPreviewHasWindowFrame)) { From 8b5934900cb7b88ec5b00a0660b4cf55920c7855 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 26 Feb 2020 10:47:42 +0100 Subject: [PATCH 21/29] Doc: Describe using custom fonts in Qt Quick Applications Developers can use custom fonts in Qt Quick UI projects that they create in Qt Design Studio. Additional steps are needed when converting these projects to Qt Quick Applications. Fixes: QTCREATORBUG-23646 Change-Id: Iebc8e6efd9683450232d1ea878925f9791536663 Reviewed-by: Thomas Hartmann --- .../src/qtquick/qtquick-from-qmlproject-to-pro.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc index 73df38d295b..b02dc93b187 100644 --- a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc @@ -114,6 +114,12 @@ \quotefile progressbar/main.cpp + \section1 Adding Custom Fonts + + To \l{Using Custom Fonts}{use custom fonts} from the Qt Quick UI project, + call the QFontDatabase::addApplicationFont() function from the \e {main.cpp} + file. + \section1 Adding Qt Quick Timeline Module to Qt Installations \note You only need to do this if your Qt version is older than 5.14. From c912ee6862031b807fc82a76cc5ee95a800eb0bb Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 26 Feb 2020 13:04:30 +0100 Subject: [PATCH 22/29] TextEditor: Fix scrolling state after splitting And when restoring editors in other ways (like from a session). When splitting, the new editor was always scrolling to make the text cursor visible, even if it wasn't visible in the original. 1. open editor with long contents 2. scroll away from the text cursor, so the line isn't visible 3. split and wonder or 3. close and re-open Qt Creator, and restore the session Our code already does set the state of the new editor to the old one, but that state was destroyed by QPlainTextEdit::showEvent, which scrolls on first show if text was added to the document. So, wrap the showEvent with save/restoreState on first show. Change-Id: I95e0b4e963ebb33d13ce020affaf7fc7f94c9257 Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 43e125e2fcd..6ff9a526070 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -651,6 +651,7 @@ public: MarginSettings m_marginSettings; // apply when making visible the first time, for the split case bool m_fontSettingsNeedsApply = true; + bool m_wasNotYetShown = true; BehaviorSettings m_behaviorSettings; int extraAreaSelectionAnchorBlockNumber = -1; @@ -7204,10 +7205,20 @@ void TextEditorWidget::encourageApply() void TextEditorWidget::showEvent(QShowEvent* e) { triggerPendingUpdates(); + // QPlainTextEdit::showEvent scrolls to make the cursor visible on first show + // which we don't want, since we restore previous states when + // opening editors, and when splitting/duplicating. + // So restore the previous state after that. + QByteArray state; + if (d->m_wasNotYetShown) + state = saveState(); QPlainTextEdit::showEvent(e); + if (d->m_wasNotYetShown) { + restoreState(state); + d->m_wasNotYetShown = false; + } } - void TextEditorWidgetPrivate::applyFontSettingsDelayed() { m_fontSettingsNeedsApply = true; From 4a9dc144f08434e94b5f2c352aa6f4f88aab458e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 26 Feb 2020 10:13:15 +0100 Subject: [PATCH 23/29] Doc: Remove duplicate file This file has been moved to \doc\qtcreator\src\... Change-Id: Idaf18e7113f8af9e4054682872eaefc419dc63fc Reviewed-by: Eike Ziller --- .../creator-only/creator-projects-nimble.qdoc | 83 ------------------- 1 file changed, 83 deletions(-) delete mode 100644 doc/src/projects/creator-only/creator-projects-nimble.qdoc diff --git a/doc/src/projects/creator-only/creator-projects-nimble.qdoc b/doc/src/projects/creator-only/creator-projects-nimble.qdoc deleted file mode 100644 index a517d633835..00000000000 --- a/doc/src/projects/creator-only/creator-projects-nimble.qdoc +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Creator 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. -** -****************************************************************************/ - -/*! - \contentspage index.html - \previouspage creator-project-generic.html - \page creator-project-nimble.html - \nextpage creator-cli.html - - \title Setting Up Nimble - - \l {https://github.com/nim-lang/nimble#readme}{Nimble} is a package - manager for the Nim programming language. It is delivered with - \l{https://nim-lang.org/}{Nim} and uses the Nim compiler to generate - executables that are supported on Windows, Linux, and \macos. - - To use \QC for Nim development, you need to enable the experimental - Nim plugin. Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Other Languages} > \uicontrol Nim, and then restart \QC. - - In addition, you have to download and install Nim and set up a Nim kit - in \QC. - - You can use wizards to create Nim and Nimble projects. - - \section1 Setting Up the Development Environment - - To configure \QC to build Nim executables: - - \list 1 - \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits - \uicontrol Compilers > \uicontrol Add > \uicontrol Nim to specify - the path to the the Nim compiler. - \li Select \uicontrol Apply to add the compiler. - \li Select \uicontrol Kits > \uicontrol Add to add a kit for building - applications with Nimble: - \image qtcreator-kit-nimble.png "Nimble kit" - \list 1 - \li In the \uicontrol Name field, specify a name for the kit. - \li In the \uicontrol Compiler group, \uicontrol Nim field, - select the Nim compiler you added above. - \li Select \uicontrol Apply to add the kit. - \endlist - \endlist - - \section1 Creating Nimble Applications - - To use a wizard to create boilerplate files for a Nim package that is - managed with Nimble: - - \list 1 - \li Select \uicontrol File > \uicontrol {New File or Project} > - \uicontrol Projects > \uicontrol {Non-Qt Project} > - \uicontrol {Nimble Application}. - \li Specify the name and location of the application. - \li Select \uicontrol Next. - \li Specify information about your application package. - \image qtcreator-project-nimble.png - \li Select \uicontrol Next to create the project. - \endlist -*/ From df7400b68606cfe43a8d268f814feca64b3fcdb9 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 24 Feb 2020 15:55:15 +0100 Subject: [PATCH 24/29] ProjectExplorer: Disentangle ProjectExplorer::updateRunActions This enforces a linear pass through [static] ProjectExplorerPlugin::updateRunActions ProjectExplorerPluginPrivate::doUpdateRunAction [emit] ProjectExplorerPluginPrivate::runActionsUpdated instead of the previous direct emission of the signal from user code and connecting also the internal update to it. This is meant to simplify reasoning about execution order and maybe to help elimimating double executation. Change-Id: Id8cc41a46d9dec06afb5514855f2ae80560f3695 Reviewed-by: Christian Kandeler --- src/plugins/autotest/autotestplugin.cpp | 2 +- src/plugins/autotest/testrunconfiguration.h | 2 +- src/plugins/clangtools/clangtool.cpp | 2 +- src/plugins/cppcheck/cppcheckplugin.cpp | 2 +- src/plugins/debugger/debuggerplugin.cpp | 2 +- src/plugins/perfprofiler/perfprofilertool.cpp | 2 +- src/plugins/projectexplorer/appoutputpane.cpp | 2 +- .../projectexplorer/buildconfiguration.cpp | 2 +- .../projectexplorer/projectexplorer.cpp | 26 ++++++++++++------- src/plugins/projectexplorer/projectexplorer.h | 4 ++- .../projectexplorer/runconfiguration.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 2 +- src/plugins/valgrind/callgrindtool.cpp | 2 +- src/plugins/valgrind/memchecktool.cpp | 2 +- 14 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 3dfaa4fad51..df73f237c6b 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -236,7 +236,7 @@ void AutotestPluginPrivate::initializeMenuEntries() this, &AutotestPlugin::updateMenuItemsEnabledState); connect(BuildManager::instance(), &BuildManager::buildQueueFinished, this, &AutotestPlugin::updateMenuItemsEnabledState); - connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, this, &AutotestPlugin::updateMenuItemsEnabledState); connect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged, this, &AutotestPlugin::updateMenuItemsEnabledState); diff --git a/src/plugins/autotest/testrunconfiguration.h b/src/plugins/autotest/testrunconfiguration.h index 1c86f663591..df43b9dc86f 100644 --- a/src/plugins/autotest/testrunconfiguration.h +++ b/src/plugins/autotest/testrunconfiguration.h @@ -59,7 +59,7 @@ public: if (auto debugAspect = aspect()) { debugAspect->setUseQmlDebugger(enableQuick); - ProjectExplorer::ProjectExplorerPlugin::instance()->updateRunActions(); + ProjectExplorer::ProjectExplorerPlugin::updateRunActions(); } m_testConfig = config; } diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index a64ec2ea986..7536f57ad9a 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -602,7 +602,7 @@ ClangTool::ClangTool() update(); - connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, this, &ClangTool::update); connect(CppModelManager::instance(), &CppModelManager::projectPartsUpdated, this, &ClangTool::update); diff --git a/src/plugins/cppcheck/cppcheckplugin.cpp b/src/plugins/cppcheck/cppcheckplugin.cpp index 97bf20929e6..dcfb45aa4c9 100644 --- a/src/plugins/cppcheck/cppcheckplugin.cpp +++ b/src/plugins/cppcheck/cppcheckplugin.cpp @@ -176,7 +176,7 @@ bool CppcheckPlugin::initialize(const QStringList &arguments, QString *errorStri } using ProjectExplorer::ProjectExplorerPlugin; - connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, d.get(), &CppcheckPluginPrivate::updateManualRunAction); d->updateManualRunAction(); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 5fdf0015e1b..73c8a2ade8b 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1186,7 +1186,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) this, &DebuggerPluginPrivate::writeSettings); // ProjectExplorer - connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, this, &DebuggerPluginPrivate::updatePresetState); // EditorManager diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index 5dc99eeceab..8176432c179 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -159,7 +159,7 @@ PerfProfilerTool::PerfProfilerTool() tracePointsAction->setEnabled(m_startAction->isEnabled()); }); - connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, this, &PerfProfilerTool::updateRunActions); m_recordButton = new QToolButton; diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index c777a61ee89..4f866490a10 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -779,7 +779,7 @@ void AppOutputPane::slotRunControlFinished2(RunControl *sender) if (current && current == sender) enableButtons(current); - emit ProjectExplorerPlugin::instance()->updateRunActions(); + ProjectExplorerPlugin::updateRunActions(); #ifdef Q_OS_WIN const bool isRunning = Utils::anyOf(m_runControlTabs, [](const RunControlTab &rt) { diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index a6262cf69d1..c7269480ce9 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -141,7 +141,7 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id) connect(this, &BuildConfiguration::enabledChanged, this, [this] { if (isActive() && project() == SessionManager::startupProject()) { ProjectExplorerPlugin::updateActions(); - emit ProjectExplorerPlugin::instance()->updateRunActions(); + ProjectExplorerPlugin::updateRunActions(); } }); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 3f35d0b34e2..b99c4384f57 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -453,7 +453,7 @@ public: void activeRunConfigurationChanged(); void activeBuildConfigurationChanged(); - void slotUpdateRunActions(); + void doUpdateRunActions(); void currentModeChanged(Core::Id mode, Core::Id oldMode); @@ -1705,8 +1705,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er connect(dd->m_projectTreeExpandAllAction, &QAction::triggered, ProjectTree::instance(), &ProjectTree::expandAll); - connect(this, &ProjectExplorerPlugin::updateRunActions, - dd, &ProjectExplorerPluginPrivate::slotUpdateRunActions); connect(this, &ProjectExplorerPlugin::settingsChanged, dd, &ProjectExplorerPluginPrivate::updateRunWithoutDeployMenu); @@ -2469,7 +2467,7 @@ void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl) Qt::QueuedConnection); ++m_activeRunControlCount; runControl->initiateStart(); - emit m_instance->updateRunActions(); + doUpdateRunActions(); } void ProjectExplorerPluginPrivate::showOutputPaneForRunControl(RunControl *runControl) @@ -2526,7 +2524,7 @@ void ProjectExplorerPluginPrivate::buildQueueFinished(bool success) m_delayedRunConfiguration = nullptr; m_shouldHaveRunConfiguration = false; m_runMode = Constants::NO_RUN_MODE; - emit m_instance->updateRunActions(); + doUpdateRunActions(); } QList > ProjectExplorerPluginPrivate::recentProjects() const @@ -2889,7 +2887,8 @@ void ProjectExplorerPlugin::runRunConfiguration(RunConfiguration *rc, dd->executeRunConfiguration(rc, runMode); break; } - emit m_instance->updateRunActions(); + + dd->doUpdateRunActions(); } QList> ProjectExplorerPlugin::runningRunControlProcesses() @@ -2987,7 +2986,7 @@ void ProjectExplorerPluginPrivate::activeRunConfigurationChanged() if (rc == previousRunConfiguration) return; updateActions(); - emit m_instance->updateRunActions(); + doUpdateRunActions(); } void ProjectExplorerPluginPrivate::activeBuildConfigurationChanged() @@ -3001,7 +3000,7 @@ void ProjectExplorerPluginPrivate::activeBuildConfigurationChanged() return; updateActions(); - emit m_instance->updateRunActions(); + doUpdateRunActions(); } void ProjectExplorerPluginPrivate::updateDeployActions() @@ -3050,7 +3049,7 @@ void ProjectExplorerPluginPrivate::updateDeployActions() enableDeploySessionAction = false; m_deploySessionAction->setEnabled(enableDeploySessionAction); - emit m_instance->updateRunActions(); + doUpdateRunActions(); } bool ProjectExplorerPlugin::canRunStartupProject(Core::Id runMode, QString *whyNot) @@ -3125,13 +3124,15 @@ bool ProjectExplorerPlugin::canRunStartupProject(Core::Id runMode, QString *whyN return true; } -void ProjectExplorerPluginPrivate::slotUpdateRunActions() +void ProjectExplorerPluginPrivate::doUpdateRunActions() { QString whyNot; const bool state = ProjectExplorerPlugin::canRunStartupProject(Constants::NORMAL_RUN_MODE, &whyNot); m_runAction->setEnabled(state); m_runAction->setToolTip(whyNot); m_runWithoutDeployAction->setEnabled(state); + + emit m_instance->runActionsUpdated(); } void ProjectExplorerPluginPrivate::addToRecentProjects(const QString &fileName, const QString &displayName) @@ -3988,6 +3989,11 @@ void ProjectExplorerPlugin::removeFromRecentProjects(const QString &fileName, dd->removeFromRecentProjects(fileName, displayName); } +void ProjectExplorerPlugin::updateRunActions() +{ + dd->doUpdateRunActions(); +} + QList > ProjectExplorerPlugin::recentProjects() { return dd->recentProjects(); diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 91f14acd5bb..55870aefa1c 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -180,6 +180,8 @@ public: static void clearRecentProjects(); static void removeFromRecentProjects(const QString &fileName, const QString &displayName); + static void updateRunActions(); + signals: void finishedInitialization(); @@ -191,7 +193,7 @@ signals: void settingsChanged(); - void updateRunActions(); + void runActionsUpdated(); private: static bool coreAboutToClose(); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 303f6298a56..1b79a610c58 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -303,7 +303,7 @@ void RunConfiguration::update() const bool isActive = target()->isActive() && target()->activeRunConfiguration() == this; if (isActive && project() == SessionManager::startupProject()) - emit ProjectExplorerPlugin::instance()->updateRunActions(); + ProjectExplorerPlugin::updateRunActions(); } BuildTargetInfo RunConfiguration::buildTargetInfo() const diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index c14d60d3842..274935b8a40 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -243,7 +243,7 @@ QmlProfilerTool::QmlProfilerTool() perspective->addToolBarWidget(d->m_displayFeaturesButton); perspective->addToolBarWidget(d->m_timeLabel); - connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, this, &QmlProfilerTool::updateRunActions); QmlProfilerTextMarkModel *model = d->m_profilerModelManager->textMarkModel(); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index a6e5f078d6b..92ed908ac96 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -530,7 +530,7 @@ CallgrindToolPrivate::CallgrindToolPrivate() m_perspective.addWindow(m_visualization, Perspective::SplitVertical, nullptr, false, Qt::RightDockWidgetArea); - connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, this, &CallgrindToolPrivate::updateRunActions); } diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 64475eba242..fd8025fc8b1 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -571,7 +571,7 @@ MemcheckToolPrivate::MemcheckToolPrivate() m_perspective.addWindow(m_errorView, Perspective::SplitVertical, nullptr); - connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated, this, &MemcheckToolPrivate::maybeActiveRunConfigurationChanged); // From 5b87681366f3972a465634f265c6fcd2861f03e5 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 24 Feb 2020 17:36:49 +0100 Subject: [PATCH 25/29] ProjectExplorer: Remove some unused BuildManager signals Change-Id: Iea832e96b726db9b93c235a57d6285337df7734d Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/buildmanager.cpp | 4 ---- src/plugins/projectexplorer/buildmanager.h | 3 --- src/plugins/projectexplorer/taskwindow.cpp | 1 - src/plugins/projectexplorer/taskwindow.h | 1 - 4 files changed, 9 deletions(-) diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 720b501681d..27c46a54a61 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -265,9 +265,6 @@ BuildManager::BuildManager(QObject *parent, QAction *cancelBuildAction) connect(d->m_taskWindow, &Internal::TaskWindow::tasksChanged, this, &BuildManager::updateTaskCount); - connect(d->m_taskWindow, &Internal::TaskWindow::tasksCleared, - this,&BuildManager::tasksCleared); - connect(&d->m_progressWatcher, &QFutureWatcherBase::canceled, this, &BuildManager::cancel); connect(&d->m_progressWatcher, &QFutureWatcherBase::finished, @@ -457,7 +454,6 @@ void BuildManager::updateTaskCount() { const int errors = getErrorTaskCount(); ProgressManager::setApplicationLabel(errors > 0 ? QString::number(errors) : QString()); - emit m_instance->tasksChanged(); } void BuildManager::finish() diff --git a/src/plugins/projectexplorer/buildmanager.h b/src/plugins/projectexplorer/buildmanager.h index 29351b2eb6c..d62786ed817 100644 --- a/src/plugins/projectexplorer/buildmanager.h +++ b/src/plugins/projectexplorer/buildmanager.h @@ -102,9 +102,6 @@ public slots: signals: void buildStateChanged(ProjectExplorer::Project *pro); void buildQueueFinished(bool success); - void tasksChanged(); - void taskAdded(const ProjectExplorer::Task &task); - void tasksCleared(); private: static void addToTaskWindow(const ProjectExplorer::Task &task, int linkedOutputLines, int skipLines); diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index d7f0c92c84b..9548be05521 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -380,7 +380,6 @@ void TaskWindow::clearTasks(Core::Id categoryId) d->m_model->clearTasks(categoryId); emit tasksChanged(); - emit tasksCleared(); navigateStateChanged(); } diff --git a/src/plugins/projectexplorer/taskwindow.h b/src/plugins/projectexplorer/taskwindow.h index efefb72658f..7f11ca1fb1a 100644 --- a/src/plugins/projectexplorer/taskwindow.h +++ b/src/plugins/projectexplorer/taskwindow.h @@ -79,7 +79,6 @@ public: signals: void tasksChanged(); - void tasksCleared(); private: void updateFilter() override; From 8cd145b32f84b412309e5b1c7796e9f24e4db137 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 26 Feb 2020 13:20:25 +0100 Subject: [PATCH 26/29] ProjectExplorer: Remove RunConfiguration::activeBuildConfiguration Only used once, and the concept is undesirable. Change-Id: I7f28f8a20d6d1f003a6d8b18bbcfba343614625c Reviewed-by: Christian Kandeler --- src/plugins/nim/project/nimrunconfiguration.cpp | 4 ++-- src/plugins/projectexplorer/runconfiguration.cpp | 5 ----- src/plugins/projectexplorer/runconfiguration.h | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/plugins/nim/project/nimrunconfiguration.cpp b/src/plugins/nim/project/nimrunconfiguration.cpp index 808d36e101a..142e4344904 100644 --- a/src/plugins/nim/project/nimrunconfiguration.cpp +++ b/src/plugins/nim/project/nimrunconfiguration.cpp @@ -58,8 +58,8 @@ public: setDisplayName(tr("Current Build Target")); setDefaultDisplayName(tr("Current Build Target")); - setUpdater([this] { - auto buildConfiguration = qobject_cast(activeBuildConfiguration()); + setUpdater([this, target] { + auto buildConfiguration = qobject_cast(target->activeBuildConfiguration()); QTC_ASSERT(buildConfiguration, return); const QFileInfo outFileInfo = buildConfiguration->outFilePath().toFileInfo(); aspect()->setExecutable(FilePath::fromString(outFileInfo.absoluteFilePath())); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 1b79a610c58..36c988434d6 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -248,11 +248,6 @@ QMap RunConfiguration::aspectData() const return data; } -BuildConfiguration *RunConfiguration::activeBuildConfiguration() const -{ - return target()->activeBuildConfiguration(); -} - BuildSystem *RunConfiguration::activeBuildSystem() const { return target()->buildSystem(); diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 995cc783723..017384a833f 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -174,8 +174,7 @@ signals: protected: RunConfiguration(Target *target, Core::Id id); - /// convenience function to get current build configuration. - BuildConfiguration *activeBuildConfiguration() const; + /// convenience function to get current build system. Try to avoid. BuildSystem *activeBuildSystem() const; using Updater = std::function; From 07fae31f3cb17c36c4e2ab2ddfb9a33ca8f993c9 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 26 Feb 2020 12:46:18 +0100 Subject: [PATCH 27/29] ProjectExplorer: Fix BuildSystem::disabledReason Inverted logic. Change-Id: Ie2decba4724dc663cfeb84d4d8be58319c9443ad Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/buildsystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/buildsystem.cpp b/src/plugins/projectexplorer/buildsystem.cpp index f360ea6648b..ea299cd522d 100644 --- a/src/plugins/projectexplorer/buildsystem.cpp +++ b/src/plugins/projectexplorer/buildsystem.cpp @@ -316,7 +316,7 @@ void BuildSystem::emitBuildSystemUpdated() QString BuildSystem::disabledReason(const QString &buildKey) const { - if (hasParsingData()) { + if (!hasParsingData()) { QString msg = isParsing() ? tr("The project is currently being parsed.") : tr("The project could not be fully parsed."); const FilePath projectFilePath = buildTarget(buildKey).projectFilePath; From da5d53b89b85d61808d130f5442fe27c0ef7cb83 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 26 Feb 2020 15:29:17 +0100 Subject: [PATCH 28/29] Doc: Document the Restart Now button that appears when needed Typically, when users enable or disable plugins. Change-Id: I1d9588e662613d6c061756d247bf12f7c1ace4ba Reviewed-by: Eike Ziller --- doc/qtcreator/src/analyze/creator-cppcheck.qdoc | 4 ++-- doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc | 4 ++-- doc/qtcreator/src/editors/creator-clangformat.qdocinc | 6 +++--- .../src/editors/creator-only/creator-beautifier.qdoc | 4 ++-- .../editors/creator-only/creator-clang-codemodel.qdoc | 6 +++--- .../creator-only/creator-compilation-database.qdocinc | 4 ++-- .../src/editors/creator-only/creator-scxml.qdoc | 7 ++++--- doc/qtcreator/src/editors/creator-search.qdoc | 6 +++--- .../src/howto/creator-only/qtcreator-faq.qdoc | 6 +++--- doc/qtcreator/src/howto/creator-ui.qdoc | 7 ++++--- doc/qtcreator/src/mcu/creator-mcu-dev.qdoc | 2 +- .../creator-only/creator-projects-autotools.qdoc | 5 ++--- .../projects/creator-only/creator-projects-nimble.qdoc | 3 ++- doc/qtcreator/src/qtquick/qtquick-timeline.qdoc | 5 +++-- .../src/vcs/creator-only/creator-vcs-perforce.qdoc | 5 +++-- doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc | 10 ++++++---- doc/qtcreator/src/webassembly/creator-webassembly.qdoc | 4 ++-- 17 files changed, 47 insertions(+), 41 deletions(-) diff --git a/doc/qtcreator/src/analyze/creator-cppcheck.qdoc b/doc/qtcreator/src/analyze/creator-cppcheck.qdoc index f973252c9af..b19ce718023 100644 --- a/doc/qtcreator/src/analyze/creator-cppcheck.qdoc +++ b/doc/qtcreator/src/analyze/creator-cppcheck.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -44,7 +44,7 @@ \li Select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {Code Analyzer} > \uicontrol Cppcheck to enable the plugin. - \li Restart \QC to load the plugin. + \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Analyzer > \uicontrol Cppcheck to specify settings for running Cppcheck. \image qtcreator-cppcheck-options.png "Cppcheck options" diff --git a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc index 594ad80ae5d..3982a012048 100644 --- a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc +++ b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -49,7 +49,7 @@ \uicontrol {Device Support} > \uicontrol {Bare Metal} to enable the Bare Metal Device plugin. - \li Restart \QC to be able to use the plugin. + \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Devices > \uicontrol {Bare Metal} > \uicontrol Add > \uicontrol Default, diff --git a/doc/qtcreator/src/editors/creator-clangformat.qdocinc b/doc/qtcreator/src/editors/creator-clangformat.qdocinc index 705f4067bb1..9b7ef41d0ad 100644 --- a/doc/qtcreator/src/editors/creator-clangformat.qdocinc +++ b/doc/qtcreator/src/editors/creator-clangformat.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -33,8 +33,8 @@ library for automatic formatting and indentation. To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {C++} > \uicontrol {ClangFormat}. Then restart \QC to load the - plugin. + \uicontrol {C++} > \uicontrol {ClangFormat}. Then select + \uicontrol {Restart Now} to restart \QC and load the plugin. \note If you enable the plugin, do not use the \l{Beautifying Source Code} {Beautifier}, because combining the two can provide unexpected results. diff --git a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc index 7c2c87879d1..e945cea4243 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -74,7 +74,7 @@ \li Select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {C++} > \uicontrol Beautifier to enable the plugin. - \li Restart \QC to be able to use the plugin. + \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Beautifier to specify settings for beautifying files. diff --git a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc index fe582d342d2..1b7b36baf8b 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -105,8 +105,8 @@ To use the built-in code model instead, select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol C++, and deselect the - \uicontrol ClangCodeModel check box. The changes take effect after - you restart \QC. + \uicontrol ClangCodeModel check box. Select \uicontrol {Restart Now} + to restart \QC and have the changes take effect. You can configure Clang diagnostics either globally or separately for: diff --git a/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc b/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc index b12b59dd706..2034951d434 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc +++ b/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -56,7 +56,7 @@ To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {Build Systems} > \uicontrol {Compilation Database Project Manager}. - Then restart \QC to load the plugin. + Then select \uicontrol {Restart Now} to restart \QC and load the plugin. //! [using compilation databases] */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc b/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc index 8cc65348292..403eeb52787 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -107,8 +107,9 @@ \list 1 \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Modeling > \uicontrol ScxmlEditor and restart \QC to - enable the plugin. + \uicontrol Modeling > \uicontrol ScxmlEditor. + + \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \li Select \uicontrol File > \uicontrol {New File or Project} > \uicontrol {Files and Classes} > \uicontrol Modeling > diff --git a/doc/qtcreator/src/editors/creator-search.qdoc b/doc/qtcreator/src/editors/creator-search.qdoc index 877d3b7492a..a480b79c959 100644 --- a/doc/qtcreator/src/editors/creator-search.qdoc +++ b/doc/qtcreator/src/editors/creator-search.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -245,7 +245,7 @@ \uicontrol {Utilities} > \uicontrol {SilverSearcher} to enable the plugin. - \li Restart \QC to be able to use the plugin. + \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \li When searching, select \uicontrol {Silver Searcher} in the \uicontrol {Search engine} field. @@ -267,7 +267,7 @@ \li Select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol C++ > \uicontrol {ClangRefactoring} to enable the plugin. - \li Restart \QC to be able to use the plugin. + \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \li When searching, select \uicontrol {Clang Query Project} in the \uicontrol {Scope} field. diff --git a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc index 87bd22d00d5..5690fe6201e 100644 --- a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc +++ b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -67,8 +67,8 @@ \QC has been localized into several languages. If the system language is one of the supported languages, it is automatically selected. To change the language, select \uicontrol {Tools > Options > Environment} and - select a language in the \uicontrol Language field. The change takes effect after - you restart \QC. + select a language in the \uicontrol Language field. Select + \uicontrol {Restart Now} to restart \QC and have the change take effect. \b {Has a reported issue been addressed?} diff --git a/doc/qtcreator/src/howto/creator-ui.qdoc b/doc/qtcreator/src/howto/creator-ui.qdoc index 787633e5ecf..d6e814a07d2 100644 --- a/doc/qtcreator/src/howto/creator-ui.qdoc +++ b/doc/qtcreator/src/howto/creator-ui.qdoc @@ -118,7 +118,8 @@ is one of the supported languages, it is automatically selected. To change the language, select \uicontrol Tools > \uicontrol Options > \uicontrol Environment and select a language in the \uicontrol Language - field. The change takes effect after you restart \QC. + field. Select \uicontrol {Restart Now} to restart \QC and have the change + take effect. \section1 Viewing Images @@ -612,8 +613,8 @@ The Todo plugin is disabled by default. To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol Utilities > - \uicontrol Todo and restart - \QC. + \uicontrol Todo. Then select \uicontrol {Restart Now} to restart \QC + and load the plugin. In addition, you can open task list files generated by code scanning and analysis tools in the \uicontrol Issues pane. For more information, see diff --git a/doc/qtcreator/src/mcu/creator-mcu-dev.qdoc b/doc/qtcreator/src/mcu/creator-mcu-dev.qdoc index 33aea4fc410..3290df28efd 100644 --- a/doc/qtcreator/src/mcu/creator-mcu-dev.qdoc +++ b/doc/qtcreator/src/mcu/creator-mcu-dev.qdoc @@ -103,7 +103,7 @@ \uicontrol {Device Support} > \uicontrol {Bare Metal} and \uicontrol {MCU Support} to enable the Bare Metal and MCU plugins. - \li Restart \QC to be able to use the plugins. + \li Select \uicontrol {Restart Now} to restart \QC and load the plugins. \li Create connections for debugging on the MCU board, as described in \l{Connecting Bare Metal Devices}. \endlist diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc index 4594179afcc..9dc854433bb 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-autotools.qdoc @@ -36,9 +36,8 @@ The AutotoolsProjectManager is a plugin for autotools support. It is disabled by default. To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {Build Systems} > - \uicontrol AutotoolsProjectManager. - - To use the plugin, restart \QC. + \uicontrol AutotoolsProjectManager.Then select \uicontrol {Restart Now} + to restart \QC and load the plugin. To work with your Autotools project in \QC: diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc index a517d633835..100edd09376 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-nimble.qdoc @@ -38,7 +38,8 @@ To use \QC for Nim development, you need to enable the experimental Nim plugin. Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Other Languages} > \uicontrol Nim, and then restart \QC. + \uicontrol {Other Languages} > \uicontrol Nim. Then select + \uicontrol {Restart Now} to restart \QC and load the plugin. In addition, you have to download and install Nim and set up a Nim kit in \QC. diff --git a/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc b/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc index 96c5e7c540c..a613dc0f3a2 100644 --- a/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc @@ -60,8 +60,9 @@ The \uicontrol Timeline view is not visible in \QC by default. To enable it, select \uicontrol Tools > \uicontrol Options > \uicontrol {Qt Quick} > - \uicontrol {Qt Quick Designer} > \uicontrol {Enable Timeline editor}. You - need to restart \QC for the \uicontrol Timeline view to appear. + \uicontrol {Qt Quick Designer} > \uicontrol {Enable Timeline editor}. + Select \uicontrol {Restart Now} to restart \QC with the \uicontrol Timeline + view visible. To be able to create timelines, you also need the \l {Qt Quick Timeline} module, which is delivered with Qt 5.14, and later. For more diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc index ea87f8686b8..f84aef760de 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs-perforce.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -42,7 +42,8 @@ Since \QC 4.9, the Perforce plugin is disabled by default. To enable it, select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Version Control} > \uicontrol Perforce, and then restart \QC. + \uicontrol {Version Control} > \uicontrol Perforce. Then select + \uicontrol {Restart Now} to restart \QC and load the plugin. \section1 Configuring Perforce diff --git a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc index 4a148e97c0e..852eebdbf58 100644 --- a/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc +++ b/doc/qtcreator/src/vcs/creator-only/creator-vcs.qdoc @@ -52,8 +52,9 @@ \li \l{http://www-01.ibm.com/software/awdtools/clearcase/} \li Disabled by default. To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Version Control} > \uicontrol ClearCase, and then - restart \QC. + \uicontrol {Version Control} > \uicontrol ClearCase. + Then select \uicontrol {Restart Now} to restart \QC + and load the plugin. \row \li \l{Using CVS}{CVS} \li \l{http://www.nongnu.org/cvs/} @@ -75,8 +76,9 @@ Disabled by default. To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol {Version Control} > \uicontrol Perforce, - and then restart \QC. + \uicontrol {Version Control} > \uicontrol Perforce. + Then select \uicontrol {Restart Now} to restart \QC + and load the plugin. \row \li \l{Using Subversion}{Subversion} \li \l{http://subversion.apache.org/} diff --git a/doc/qtcreator/src/webassembly/creator-webassembly.qdoc b/doc/qtcreator/src/webassembly/creator-webassembly.qdoc index 37ca68ed5e2..083f8b7d40b 100644 --- a/doc/qtcreator/src/webassembly/creator-webassembly.qdoc +++ b/doc/qtcreator/src/webassembly/creator-webassembly.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -80,7 +80,7 @@ \li In \QC, select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {Device Support} > \uicontrol {WebAssembly} to enable the plugin. - \li Restart \QC to be able to use the plugin. + \li Select \uicontrol {Restart Now} to restart \QC and load the plugin. \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits > \uicontrol {Qt Versions} > \uicontrol Add to add Qt for WebAssembly (wasm_32). From 18386c7117e8c0dc7ed40fac2f7b06545f0ebb86 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 25 Feb 2020 17:39:00 +0100 Subject: [PATCH 29/29] CMake Build: Fix yaml-cpp include directory detection On Ubuntu 19.10 the libyaml-cpp-dev CMake config module has a broken value for YAML_CPP_INCLUDE_DIR. Change-Id: I5097ef656b988dda0326a15b521b92cbbdb0a390 Reviewed-by: Cristian Adam --- cmake/Findyaml-cpp.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/Findyaml-cpp.cmake b/cmake/Findyaml-cpp.cmake index bcdcfd104b6..3d5828ebd8b 100644 --- a/cmake/Findyaml-cpp.cmake +++ b/cmake/Findyaml-cpp.cmake @@ -10,6 +10,11 @@ find_package(yaml-cpp 0.5 QUIET NO_MODULE) if (yaml-cpp_FOUND) # target doesn't set include directory for some reason get_filename_component(yaml_cpp_include_dir ${YAML_CPP_INCLUDE_DIR} ABSOLUTE) + if (NOT EXISTS yaml_cpp_include_dir) + unset(yaml_cpp_include_dir) + unset(yaml_cpp_include_dir CACHE) + find_path(yaml_cpp_include_dir yaml-cpp/yaml.h) + endif() target_include_directories(yaml-cpp INTERFACE ${yaml_cpp_include_dir}) else() set(yaml-cpp_FOUND 1)