Merge remote-tracking branch 'origin/4.12'

Change-Id: I4523ea36332772a310fd462df55683c93c61bb18
This commit is contained in:
Eike Ziller
2020-02-27 09:41:05 +01:00
110 changed files with 542 additions and 589 deletions

View File

@@ -41,6 +41,18 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
${exclusion_mask} ${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 # Analyze the binaries and install missing dependencies if they are
# found the CMAKE_PREFIX_PATH e.g. Qt, Clang # found the CMAKE_PREFIX_PATH e.g. Qt, Clang
configure_file(InstallDependentSharedObjects.cmake.in InstallDependentSharedObjects.cmake @ONLY) configure_file(InstallDependentSharedObjects.cmake.in InstallDependentSharedObjects.cmake @ONLY)

View File

@@ -10,6 +10,11 @@ find_package(yaml-cpp 0.5 QUIET NO_MODULE)
if (yaml-cpp_FOUND) if (yaml-cpp_FOUND)
# target doesn't set include directory for some reason # target doesn't set include directory for some reason
get_filename_component(yaml_cpp_include_dir ${YAML_CPP_INCLUDE_DIR} ABSOLUTE) 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}) target_include_directories(yaml-cpp INTERFACE ${yaml_cpp_include_dir})
else() else()
set(yaml-cpp_FOUND 1) set(yaml-cpp_FOUND 1)

View File

@@ -1044,7 +1044,18 @@ function(add_qtc_executable name)
\"Prefix=\${qt_conf_binaries}\n\" \"Prefix=\${qt_conf_binaries}\n\"
) )
endif() 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() endfunction()
if(APPLE) if(APPLE)
create_qt_conf(\"${_EXECUTABLE_PATH}\" \"${IDE_DATA_PATH}/..\") create_qt_conf(\"${_EXECUTABLE_PATH}\" \"${IDE_DATA_PATH}/..\")

View File

@@ -35,15 +35,16 @@ Editing
* Added `Go to Last Edit` * Added `Go to Last Edit`
* Added option for default line terminator style (QTCREATORBUG-3590) * 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 wizards ignored default file encoding
* Fixed that only restricted number of sizes were allowed for font size (QTCREATORBUG-22536) * Fixed that only restricted number of sizes were allowed for font size (QTCREATORBUG-22536)
* Fixed completion after undo (QTCREATORBUG-15038)
### Language Client ### Language Client
* Added support for Markdown in tooltips * Added support for Markdown in tooltips
* Added support for auto-formatting * Added support for auto-formatting
* Added outline dropdown (QTCREATORBUG-21916) * Added outline dropdown (QTCREATORBUG-21916)
* Improved protocol error reporting
* Fixed `Ctrl-click` for `Follow Symbol Under Cursor` (QTCREATORBUG-21848) * Fixed `Ctrl-click` for `Follow Symbol Under Cursor` (QTCREATORBUG-21848)
### QML ### QML
@@ -93,6 +94,7 @@ Projects
* Added automatic registration of CMake documentation, if available (QTCREATORBUG-21338) * Added automatic registration of CMake documentation, if available (QTCREATORBUG-21338)
* Fixed issues with `snap` on Ubuntu Linux (QTCREATORBUG-23376) * Fixed issues with `snap` on Ubuntu Linux (QTCREATORBUG-23376)
* Fixed handling of `Enable QML` in debugger settings (QTCREATORBUG-23541) * Fixed handling of `Enable QML` in debugger settings (QTCREATORBUG-23541)
* Fixed unneeded reparsing of files
### Qbs ### Qbs
@@ -122,6 +124,8 @@ Debugging
--------- ---------
* Added option to hide columns from views (QTCREATORBUG-23342) * 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 Analyzer
-------- --------
@@ -149,6 +153,7 @@ Qt Quick Designer
----------------- -----------------
* Added locking and pinning of animation curves (QDS-550, QDS-551) * 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) * Fixed dragging of keyframes in curve editor (QDS-1405)
Version Control Systems 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 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 option to start interactive rebase from log view (QTCREATORBUG-11200)
* Added information about upstream status to `Git Branches` view * 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 Test Integration
---------------- ----------------
@@ -184,8 +191,15 @@ Platforms
* Added auto-detection of Java JDK (QTCREATORBUG-23407) * Added auto-detection of Java JDK (QTCREATORBUG-23407)
* Added option to automatically download and install required Android tools (QTCREATORBUG-23285) * 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) * Fixed several issues with AVD manager (QTCREATORBUG-23284, QTCREATORBUG-23448)
### iOS
* Improved examples browser to only show items tagged with `ios`
### Remote Linux ### Remote Linux
* Added option to use custom command for install step (QTCREATORBUG-23320) * Added option to use custom command for install step (QTCREATORBUG-23320)

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -44,7 +44,7 @@
\li Select \uicontrol Help > \uicontrol {About Plugins} > \li Select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Code Analyzer} > \uicontrol Cppcheck to enable the \uicontrol {Code Analyzer} > \uicontrol Cppcheck to enable the
plugin. 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 \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Analyzer
> \uicontrol Cppcheck to specify settings for running Cppcheck. > \uicontrol Cppcheck to specify settings for running Cppcheck.
\image qtcreator-cppcheck-options.png "Cppcheck options" \image qtcreator-cppcheck-options.png "Cppcheck options"

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -49,7 +49,7 @@
\uicontrol {Device Support} > \uicontrol {Bare Metal} to enable the \uicontrol {Device Support} > \uicontrol {Bare Metal} to enable the
Bare Metal Device plugin. 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 > \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Devices >
\uicontrol {Bare Metal} > \uicontrol Add > \uicontrol Default, \uicontrol {Bare Metal} > \uicontrol Add > \uicontrol Default,

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -33,8 +33,8 @@
library for automatic formatting and indentation. library for automatic formatting and indentation.
To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {C++} > \uicontrol {ClangFormat}. Then restart \QC to load the \uicontrol {C++} > \uicontrol {ClangFormat}. Then select
plugin. \uicontrol {Restart Now} to restart \QC and load the plugin.
\note If you enable the plugin, do not use the \l{Beautifying Source Code} \note If you enable the plugin, do not use the \l{Beautifying Source Code}
{Beautifier}, because combining the two can provide unexpected results. {Beautifier}, because combining the two can provide unexpected results.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -74,7 +74,7 @@
\li Select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {C++} > \li Select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol {C++} >
\uicontrol Beautifier to enable the plugin. \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 > \li Select \uicontrol Tools > \uicontrol Options >
\uicontrol Beautifier to specify settings for beautifying files. \uicontrol Beautifier to specify settings for beautifying files.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -105,8 +105,8 @@
To use the built-in code model instead, select \uicontrol Help > To use the built-in code model instead, select \uicontrol Help >
\uicontrol {About Plugins} > \uicontrol C++, and deselect the \uicontrol {About Plugins} > \uicontrol C++, and deselect the
\uicontrol ClangCodeModel check box. The changes take effect after \uicontrol ClangCodeModel check box. Select \uicontrol {Restart Now}
you restart \QC. to restart \QC and have the changes take effect.
You can configure Clang diagnostics either globally or separately for: You can configure Clang diagnostics either globally or separately for:

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -56,7 +56,7 @@
To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} > To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Build Systems} > \uicontrol {Compilation Database Project Manager}. \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] //! [using compilation databases]
*/ */

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -107,8 +107,9 @@
\list 1 \list 1
\li Select \uicontrol Help > \uicontrol {About Plugins} > \li Select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol Modeling > \uicontrol ScxmlEditor and restart \QC to \uicontrol Modeling > \uicontrol ScxmlEditor.
enable the plugin.
\li Select \uicontrol {Restart Now} to restart \QC and load the plugin.
\li Select \uicontrol File > \uicontrol {New File or Project} > \li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol {Files and Classes} > \uicontrol Modeling > \uicontrol {Files and Classes} > \uicontrol Modeling >

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -245,7 +245,7 @@
\uicontrol {Utilities} > \uicontrol {SilverSearcher} to enable the \uicontrol {Utilities} > \uicontrol {SilverSearcher} to enable the
plugin. 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 \li When searching, select \uicontrol {Silver Searcher} in the
\uicontrol {Search engine} field. \uicontrol {Search engine} field.
@@ -267,7 +267,7 @@
\li Select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol C++ \li Select \uicontrol Help > \uicontrol {About Plugins} > \uicontrol C++
> \uicontrol {ClangRefactoring} to enable the plugin. > \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 \li When searching, select \uicontrol {Clang Query Project} in the
\uicontrol {Scope} field. \uicontrol {Scope} field.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** 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 \li To display the full help on a Qt class or function, press \key F1 or
select \uicontrol {Context Help} in the context menu. select \uicontrol {Context Help} in the context menu.
The documentation is displayed in a 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. space, in the fullscreen \uicontrol Help mode.
\li To select and configure how the documentation is displayed in the \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 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 Tools > \uicontrol Options > \uicontrol Help > \uicontrol General
> \uicontrol {On help start} field. > \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 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 are not opened, because loading them would slow down opening the \uicontrol Help
mode. mode.
@@ -232,7 +232,7 @@
You can filter the documents displayed in the \uicontrol Help mode to find 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 relevant information faster. Select a filter from a list of filters (1). The
contents of the \uicontrol Index and \uicontrol Contents 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" \image qtcreator-help-filters.png "Help filters"

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -239,14 +239,14 @@
Where the number is the number of the output pane. Where the number is the number of the output pane.
\if defined(qtcreator) \if defined(qtcreator)
\row \row
\li Activate \uicontrol Bookmarks pane \li Activate \uicontrol Bookmarks view
\li Alt+M \li Alt+M
\endif \endif
\row \row
\li Activate \uicontrol{File System} pane \li Activate \uicontrol{File System} view
\li Alt+Y \li Alt+Y
\row \row
\li Activate \uicontrol{Open Documents} pane \li Activate \uicontrol{Open Documents} view
\li Alt+O \li Alt+O
\row \row
\li Maximize output panes \li Maximize output panes
@@ -258,7 +258,7 @@
\li Move to previous item in output panes \li Move to previous item in output panes
\li Shift+F6 \li Shift+F6
\row \row
\li Activate \uicontrol Projects pane \li Activate \uicontrol Projects view
\li Alt+X \li Alt+X
\row \row
\li Full screen \li Full screen

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -67,8 +67,8 @@
\QC has been localized into several languages. If the system \QC has been localized into several languages. If the system
language is one of the supported languages, it is automatically selected. language is one of the supported languages, it is automatically selected.
To change the language, select \uicontrol {Tools > Options > Environment} and To change the language, select \uicontrol {Tools > Options > Environment} and
select a language in the \uicontrol Language field. The change takes effect after select a language in the \uicontrol Language field. Select
you restart \QC. \uicontrol {Restart Now} to restart \QC and have the change take effect.
\b {Has a reported issue been addressed?} \b {Has a reported issue been addressed?}

View File

@@ -118,7 +118,8 @@
is one of the supported languages, it is automatically selected. To is one of the supported languages, it is automatically selected. To
change the language, select \uicontrol Tools > \uicontrol Options > change the language, select \uicontrol Tools > \uicontrol Options >
\uicontrol Environment and select a language in the \uicontrol Language \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 \section1 Viewing Images
@@ -612,8 +613,8 @@
The Todo plugin is disabled by default. To enable the plugin, select The Todo plugin is disabled by default. To enable the plugin, select
\uicontrol Help > \uicontrol {About Plugins} > \uicontrol Utilities > \uicontrol Help > \uicontrol {About Plugins} > \uicontrol Utilities >
\uicontrol Todo and restart \uicontrol Todo. Then select \uicontrol {Restart Now} to restart \QC
\QC. and load the plugin.
In addition, you can open task list files generated by code scanning and In addition, you can open task list files generated by code scanning and
analysis tools in the \uicontrol Issues pane. For more information, see analysis tools in the \uicontrol Issues pane. For more information, see

View File

@@ -103,7 +103,7 @@
\uicontrol {Device Support} > \uicontrol {Bare Metal} and \uicontrol {Device Support} > \uicontrol {Bare Metal} and
\uicontrol {MCU Support} to enable the Bare Metal and MCU \uicontrol {MCU Support} to enable the Bare Metal and MCU
plugins. 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 \li Create connections for debugging on the MCU board, as described in
\l{Connecting Bare Metal Devices}. \l{Connecting Bare Metal Devices}.
\endlist \endlist

View File

@@ -36,9 +36,8 @@
The AutotoolsProjectManager is a plugin for autotools support. It is The AutotoolsProjectManager is a plugin for autotools support. It is
disabled by default. To enable the plugin, select \uicontrol Help > disabled by default. To enable the plugin, select \uicontrol Help >
\uicontrol {About Plugins} > \uicontrol {Build Systems} > \uicontrol {About Plugins} > \uicontrol {Build Systems} >
\uicontrol AutotoolsProjectManager. \uicontrol AutotoolsProjectManager.Then select \uicontrol {Restart Now}
to restart \QC and load the plugin.
To use the plugin, restart \QC.
To work with your Autotools project in \QC: To work with your Autotools project in \QC:

View File

@@ -434,16 +434,16 @@
\image qtcreator-new-opengl-file.png "New OpenGL file wizard" \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 \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 .h, .qrc, and so on). To display other types of files, edit the
project file. Add filenames as values of the \c {DISTFILES} variable. project file. Add filenames as values of the \c {DISTFILES} variable.
You can also use wildcards. You can also use wildcards.
For example, the following code specifies that text files are displayed For example, the following code specifies that text files are displayed
in the \uicontrol Projects pane: in the \uicontrol Projects view:
\code \code
@@ -478,7 +478,7 @@
{SUBDIRS variable}. It also adds all the necessary files for the subproject. {SUBDIRS variable}. It also adds all the necessary files for the subproject.
To create more subprojects, right-click the project name in the 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}. Follow the steps in the
\uicontrol {New Subproject} wizard to create a subproject. \uicontrol {New Subproject} wizard to create a subproject.
@@ -489,7 +489,7 @@
In the file browser dialog, locate your subproject. In the file browser dialog, locate your subproject.
To remove subprojects, right-click the project name in the \uicontrol Projects 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 To specify dependencies, use the \uicontrol{Add Library} wizard. For more
information, see \l{Adding Libraries to Projects}. information, see \l{Adding Libraries to Projects}.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -88,7 +88,7 @@
\list 1 \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 context menu and select
\uicontrol {Add Library}. \uicontrol {Add Library}.
@@ -122,7 +122,7 @@
\uicontrol {Project Management} dialog. In the \uicontrol {Add to project} \uicontrol {Project Management} dialog. In the \uicontrol {Add to project}
list, select a project. For example, \b myapp. 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 context menu and select
\uicontrol {Add Library > Internal Library > Next}. \uicontrol {Add Library > Internal Library > Next}.

View File

@@ -38,7 +38,8 @@
To use \QC for Nim development, you need to enable the experimental To use \QC for Nim development, you need to enable the experimental
Nim plugin. Select \uicontrol Help > \uicontrol {About Plugins} > 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 addition, you have to download and install Nim and set up a Nim kit
in \QC. in \QC.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -109,7 +109,7 @@
\li In \uicontrol Library > \uicontrol Assets, select Bluebubble.svg \li In \uicontrol Library > \uicontrol Assets, select Bluebubble.svg
and drag and drop it to \e mainWindow in the navigator. 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. \e bubble to be able to reference the image from other places.
\li Select the \inlineimage export_unchecked.png \li Select the \inlineimage export_unchecked.png

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -98,7 +98,7 @@
properties. Some properties, such as position, size, and visibility, properties. Some properties, such as position, size, and visibility,
are common to all QML types, whereas others are specific to the QML are common to all QML types, whereas others are specific to the QML
type. You can specify properties for your components in the type. You can specify properties for your components in the
\uicontrol Properties pane. \uicontrol Properties view.
\li \l {Creating Animations} \li \l {Creating Animations}

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** 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 the state machine in the \uicontrol Backends tab in the Design mode, as
described in \l {Managing C++ Backend Objects}. 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, to map QML states to the states of the SCXML state machine. For an example,
see \l {Qt SCXML Traffic Light QML Example (Dynamic)}. see \l {Qt SCXML Traffic Light QML Example (Dynamic)}.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -58,14 +58,14 @@
\li In the \uicontrol Navigator, select \uicontrol Item and set the \li In the \uicontrol Navigator, select \uicontrol Item and set the
width (\uicontrol W) and height (\uicontrol H) of the button in 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 \li Drag and drop a \uicontrol Rectangle from the \uicontrol Library to
the item in the navigator. This creates a nested item where the the item in the navigator. This creates a nested item where the
item is the parent of the rectangle. Items are positioned relative item is the parent of the rectangle. Items are positioned relative
to their parents. 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: rectangle:
\list a \list a
@@ -85,7 +85,7 @@
\li Drag and drop a \uicontrol {Text} type to the item in the navigator. \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. type.
\list a \list a
@@ -167,7 +167,7 @@
\li In the \uicontrol Navigator, select \uicontrol Item and set the \li In the \uicontrol Navigator, select \uicontrol Item and set the
width (\uicontrol W) and height (\uicontrol H) of the button in 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} > \li Select \uicontrol Connections > \uicontrol {Properties} >
\uicontrol Add to add properties for the item: \uicontrol Add to add properties for the item:
@@ -193,7 +193,7 @@
navigator. navigator.
\li In the navigator, select a border image to specify settings for it \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 \list a

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** 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 is generally defined in its own QML file. You can import components to
applications. 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. components, assets, and QML imports.
\image qmldesigner-qml-components.png "QML Components" \image qmldesigner-qml-components.png "QML Components"
@@ -77,13 +77,13 @@
\li Drag and drop components from the \uicontrol Library (2) to the \li Drag and drop components from the \uicontrol Library (2) to the
\uicontrol Navigator (3) or \uicontrol {Form Editor} (1). \uicontrol Navigator (3) or \uicontrol {Form Editor} (1).
\li Select components in the \uicontrol Navigator to edit their \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}. information, see \l {Specifying Item Properties}.
\li Connect components to signals or create bindings between components \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}. \l{Adding Connections}.
\li Add states to apply sets of changes to the properties of one or \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}. information, see \l{Adding States}.
\endlist \endlist
@@ -135,7 +135,7 @@
When you add a \l{GridView}{Grid View}, \l{ListView}{List View}, or When you add a \l{GridView}{Grid View}, \l{ListView}{List View}, or
\l{PathView}{Path View}, the ListModel and the delegate component that \l{PathView}{Path View}, the ListModel and the delegate component that
creates an instance for each item in the model are added automatically. 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 in the \uicontrol {Text Editor}. You can also replace the default model and
delegate with other, more complex models and delegates in the delegate with other, more complex models and delegates in the
\uicontrol {Text Editor}. \l{ItemDelegate}{Item Delegate} and \uicontrol {Text Editor}. \l{ItemDelegate}{Item Delegate} and
@@ -212,7 +212,7 @@
invisible \e anchor lines: top, bottom, left, right, fill, horizontal invisible \e anchor lines: top, bottom, left, right, fill, horizontal
center, vertical center, and baseline. 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 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 top/bottom, left/right, and horizontal/vertical anchors to anchor items in
the corners of the parent item or center them horizontally or vertically 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 \li Drag and drop a QML type from the \uicontrol Library to the
\uicontrol Navigator or \uicontrol {Form Editor}. \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. The available properties depend on the QML type.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -102,13 +102,13 @@
\endlist \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 QML states typically describe user interface configurations, such as
the UI controls, their properties and behavior and the available the UI controls, their properties and behavior and the available
actions. For more information, see \l{Adding States}. actions. For more information, see \l{Adding States}.
\if defined(qtdesignstudio) \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. editor that enables you to animate the properties of UI components.
\endif \endif
@@ -165,9 +165,9 @@
To experiment with different component sizes, enter values in the To experiment with different component sizes, enter values in the
\uicontrol {Override Width} and \uicontrol {Override Height} fields (1) on \uicontrol {Override Width} and \uicontrol {Override Height} fields (1) on
the canvas toolbar. The changes are displayed on the canvas (2) 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 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" \image qmldesigner-preview-size.png "Canvas width and height"

View File

@@ -114,6 +114,12 @@
\quotefile progressbar/main.cpp \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 \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. \note You only need to do this if your Qt version is older than 5.14.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -38,7 +38,7 @@
\image qmldesigner-navigator.png "Navigator" \image qmldesigner-navigator.png "Navigator"
You can select items in the \uicontrol Navigator to edit their properties 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 parent item. To select items on the canvas, right-click an item, and select
another type in the context menu. 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 To show and hide items on the canvas when focusing on specific parts of the
application, click \inlineimage eye_open.png application, click \inlineimage eye_open.png
. To change the visibility of an item in the application code, select the . 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. \uicontrol Edit > \uicontrol Visibility in the context menu.
You can also set the \uicontrol Opacity field to 0 to hide items that you You can also set the \uicontrol Opacity field to 0 to hide items that you

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** 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} To add intermediary points to a curve segment, select \uicontrol {Split Segment}
in the context menu. 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 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 initiates mouse dragging and what is the rate at which a flick will
decelerate. decelerate.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -35,19 +35,19 @@
\title Specifying Item Properties \title Specifying Item Properties
The \uicontrol Properties pane displays all the properties of the selected The \uicontrol Properties view displays all the properties of the selected
item. The properties are grouped by type. The top part of the pane displays 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 properties that are common to all QML types, such as position, size, and
visibility. 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 QML type. For example, the following image displays the properties you can
set for \uicontrol Rectangle (1) and \uicontrol Text (2) items. set for \uicontrol Rectangle (1) and \uicontrol Text (2) items.
\image qmldesigner-element-properties.png \image qmldesigner-element-properties.png
To change the item type, double-click the \uicontrol Type field in the 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 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 for the new type, the type cannot be changed and an error message is
displayed. Select the \inlineimage icons/action-icon.png displayed. Select the \inlineimage icons/action-icon.png
@@ -130,7 +130,7 @@
\section1 Picking Colors \section1 Picking Colors
To specify the color of the selected item in the color picker view (1), 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" \image qtquick-designer-color-picker.png "Color Picker view"
@@ -163,7 +163,7 @@
\section1 Marking Text Items for Translation \section1 Marking Text Items for Translation
To support translators, mark each text item that should be translated. 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" \image qmldesigner-text-property-tr.png "Text properties"
@@ -281,7 +281,7 @@
\section1 Building Transformations on Items \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 transformations, such as rotation, scale, and translation. You
can assign any number of transformations to an item. Each can assign any number of transformations to an item. Each
transformation is applied in order, one at a time. transformation is applied in order, one at a time.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -62,12 +62,12 @@
\li Show a different view. \li Show a different view.
\endlist \endlist
The \uicontrol States pane displays the different \l{State}{states} The \uicontrol States view displays the different \l{State}{states}
of the component in the Design mode. The \uicontrol States pane is of the component in the Design mode. The \uicontrol States view is
collapsed by default to save space. Select \uicontrol Expand in 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 To add states, click the \inlineimage plus.png
button. Then modify the new state in the editor. For example, to change the 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 a button is pressed, you could select a button component and
its pressed property. 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. switch between states on the canvas.
\section1 Using States \section1 Using States
@@ -97,11 +97,11 @@
controls, their properties and behavior and the available actions. For controls, their properties and behavior and the available actions. For
example, you can use states to create two views. 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 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. 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 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 (1). While you work on one view, you can click the
\inlineimage eye_open.png \inlineimage eye_open.png
icon to hide items on the canvas that are not part of a view. 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. 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 \uicontrol Visibility check box or set \uicontrol Opacity to 0
for each item that is not needed in this view. If you specify 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 the setting for the parent item, all child items inherit it and

View File

@@ -60,8 +60,9 @@
The \uicontrol Timeline view is not visible in \QC by default. To enable The \uicontrol Timeline view is not visible in \QC by default. To enable
it, select \uicontrol Tools > \uicontrol Options > \uicontrol {Qt Quick} > it, select \uicontrol Tools > \uicontrol Options > \uicontrol {Qt Quick} >
\uicontrol {Qt Quick Designer} > \uicontrol {Enable Timeline editor}. You \uicontrol {Qt Quick Designer} > \uicontrol {Enable Timeline editor}.
need to restart \QC for the \uicontrol Timeline view to appear. 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} 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 module, which is delivered with Qt 5.14, and later. For more

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** 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 Since \QC 4.9, the Perforce plugin is disabled by default. To enable
it, select \uicontrol Help > \uicontrol {About Plugins} > 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 \section1 Configuring Perforce

View File

@@ -52,8 +52,9 @@
\li \l{http://www-01.ibm.com/software/awdtools/clearcase/} \li \l{http://www-01.ibm.com/software/awdtools/clearcase/}
\li Disabled by default. To enable the plugin, select \li Disabled by default. To enable the plugin, select
\uicontrol Help > \uicontrol {About Plugins} > \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Version Control} > \uicontrol ClearCase, and then \uicontrol {Version Control} > \uicontrol ClearCase.
restart \QC. Then select \uicontrol {Restart Now} to restart \QC
and load the plugin.
\row \row
\li \l{Using CVS}{CVS} \li \l{Using CVS}{CVS}
\li \l{http://www.nongnu.org/cvs/} \li \l{http://www.nongnu.org/cvs/}
@@ -75,8 +76,9 @@
Disabled by default. To enable the plugin, select Disabled by default. To enable the plugin, select
\uicontrol Help > \uicontrol {About Plugins} > \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Version Control} > \uicontrol Perforce, \uicontrol {Version Control} > \uicontrol Perforce.
and then restart \QC. Then select \uicontrol {Restart Now} to restart \QC
and load the plugin.
\row \row
\li \l{Using Subversion}{Subversion} \li \l{Using Subversion}{Subversion}
\li \l{http://subversion.apache.org/} \li \l{http://subversion.apache.org/}

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** 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 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 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 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. in the sidebar.
\section2 Amending Commits \section2 Amending Commits

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -80,7 +80,7 @@
\li In \QC, select \uicontrol Help > \uicontrol {About Plugins} > \li In \QC, select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Device Support} > \uicontrol {WebAssembly} to enable \uicontrol {Device Support} > \uicontrol {WebAssembly} to enable
the plugin. 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 > \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits >
\uicontrol {Qt Versions} > \uicontrol Add to add Qt for WebAssembly \uicontrol {Qt Versions} > \uicontrol Add to add Qt for WebAssembly
(wasm_32). (wasm_32).

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** 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 \li Double-click the \uicontrol{Push Button} widget and enter the text
\b{Find}. \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. \b findButton.
\image qtcreator-textfinder-objectname.png "Changing object names" \image qtcreator-textfinder-objectname.png "Changing object names"
@@ -216,7 +216,7 @@
\list 1 \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. \c{textfinder.h} file to open it for editing.
\li Add a private function to the \c{private} section, after the \li Add a private function to the \c{private} section, after the
@@ -234,7 +234,7 @@
\list 1 \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. textfinder.cpp file to open it for editing.
\li Add code to load a text file using QFile, read it with QTextStream, \li Add code to load a text file using QFile, read it with QTextStream,

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Design Studio documentation. ** 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 \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 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}. more information, see \l {Viewing Project Files}.
\image loginui1-project-files.png \image loginui1-project-files.png

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Design Studio documentation. ** This file is part of the Qt Design Studio documentation.
@@ -117,9 +117,9 @@
components on the canvas: components on the canvas:
\list 1 \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. button.
\image loginui3-login-state.png "States pane" \image loginui3-login-state.png "States view"
\li Enter \e loginState as the state name. \li Enter \e loginState as the state name.
\li Select \e verifyPasswordField in the \uicontrol Navigator, \li Select \e verifyPasswordField in the \uicontrol Navigator,
and deselect the \uicontrol Visibility check box in and deselect the \uicontrol Visibility check box in

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Design Studio documentation. ** This file is part of the Qt Design Studio documentation.
@@ -85,7 +85,7 @@
\list 1 \list 1
\li Open \e {Screen01.ui.qml} in the Design mode for editing. \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 (\uicontrol Close) button in \e loginState and \e registerState
to remove the states. to remove the states.
\li In the \uicontrol {Text Editor}, remove the following line: \li In the \uicontrol {Text Editor}, remove the following line:
@@ -259,11 +259,11 @@
\section1 Binding Animation to States \section1 Binding Animation to States
You will now bring back the \l{Adding States}{states} in the 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: in the \uicontrol Timeline view:
\list 1 \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 button twice to add two states called \e loginState and
\e registerState. You don't need to make any property changes this \e registerState. You don't need to make any property changes this
time, because you'll bind the states to property animations. time, because you'll bind the states to property animations.

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Design Studio documentation. ** This file is part of the Design Studio documentation.
@@ -70,7 +70,7 @@
\note Components are listed in the \uicontrol {QML Components} \note Components are listed in the \uicontrol {QML Components}
section of the \uicontrol Library only if the filename begins section of the \uicontrol Library only if the filename begins
with a capital letter. 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. The available properties depend on the QML type.
\endlist \endlist

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Design Studio documentation. ** This file is part of the Qt Design Studio documentation.
@@ -72,7 +72,7 @@
properties. Some properties, such as position, size, and visibility, properties. Some properties, such as position, size, and visibility,
are common to all QML types, whereas others are specific to the QML are common to all QML types, whereas others are specific to the QML
type. You can specify properties for your components in the type. You can specify properties for your components in the
\uicontrol Properties pane. \uicontrol Properties view.
\li \l {Using Custom Fonts} \li \l {Using Custom Fonts}

View File

@@ -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
*/

View File

@@ -44,7 +44,9 @@ def default_python3():
path_system = os.path.join('/usr', 'bin') if not common.is_windows_platform() else None path_system = os.path.join('/usr', 'bin') if not common.is_windows_platform() else None
path = os.environ.get('PYTHON3_PATH') or path_system path = os.environ.get('PYTHON3_PATH') or path_system
postfix = '.exe' if common.is_windows_platform() else '' 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(): def get_arguments():
parser = argparse.ArgumentParser(description='Build Qt Creator for packaging') parser = argparse.ArgumentParser(description='Build Qt Creator for packaging')

View File

@@ -353,7 +353,7 @@ class Dumper(DumperBase):
def putVTableChildren(self, item, itemCount): def putVTableChildren(self, item, itemCount):
p = item.address() p = item.address()
for i in xrange(itemCount): for i in range(itemCount):
deref = self.extractPointer(p) deref = self.extractPointer(p)
if deref == 0: if deref == 0:
n = i n = i

View File

@@ -48,7 +48,6 @@ except ModuleNotFoundError:
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
xrange = range
toInteger = int toInteger = int
else: else:
toInteger = long toInteger = long
@@ -306,8 +305,8 @@ class DumperBase:
def childRange(self): def childRange(self):
if self.currentMaxNumChild is None: if self.currentMaxNumChild is None:
return xrange(0, self.currentNumChild) return range(0, self.currentNumChild)
return xrange(min(self.currentMaxNumChild, self.currentNumChild)) return range(min(self.currentMaxNumChild, self.currentNumChild))
def enterSubItem(self, item): def enterSubItem(self, item):
if self.useTimeStamps: if self.useTimeStamps:
@@ -820,7 +819,7 @@ class DumperBase:
def putVTableChildren(self, item, itemCount): def putVTableChildren(self, item, itemCount):
p = item.pointer() p = item.pointer()
for i in xrange(itemCount): for i in range(itemCount):
deref = self.extractPointer(p) deref = self.extractPointer(p)
if deref == 0: if deref == 0:
itemCount = i itemCount = i
@@ -901,7 +900,7 @@ class DumperBase:
self.warn('REDUCING READING MAXIMUM TO %s' % maximum) self.warn('REDUCING READING MAXIMUM TO %s' % maximum)
#DumperBase.warn('BASE: 0x%x TSIZE: %s MAX: %s' % (base, tsize, 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] t = struct.unpack_from(code, blob, i)[0]
if t == 0: if t == 0:
return 0, i, self.hexencode(blob[:i]) return 0, i, self.hexencode(blob[:i])
@@ -2090,7 +2089,7 @@ class DumperBase:
base = self.extractPointer(connections) base = self.extractPointer(connections)
data, size, alloc = self.vectorDataHelper(base) data, size, alloc = self.vectorDataHelper(base)
connectionType = self.createType('@QObjectPrivate::Connection') connectionType = self.createType('@QObjectPrivate::Connection')
for i in xrange(size): for i in range(size):
first = self.extractPointer(data + i * 2 * ptrSize) first = self.extractPointer(data + i * 2 * ptrSize)
while first: while first:
self.putSubItem('%s' % pp, self.putSubItem('%s' % pp,
@@ -2193,7 +2192,7 @@ class DumperBase:
if self.currentIName in self.expandedINames: if self.currentIName in self.expandedINames:
p = value p = value
with Children(self, n): with Children(self, n):
for i in xrange(n): for i in range(n):
self.putSubItem(i, p.dereference()) self.putSubItem(i, p.dereference())
p += 1 p += 1
@@ -2340,7 +2339,7 @@ class DumperBase:
self.putField('exp', exp) self.putField('exp', exp)
self.putItemCount(n) self.putItemCount(n)
self.putNoType() self.putNoType()
for i in xrange(n): for i in range(n):
self.handleWatch(exps[i], exps[i], '%s.%d' % (iname, i)) self.handleWatch(exps[i], exps[i], '%s.%d' % (iname, i))
return return

View File

@@ -101,7 +101,7 @@ PPPCommand()
def scanStack(p, n): def scanStack(p, n):
p = int(p) p = int(p)
r = [] r = []
for i in xrange(n): for i in range(n):
f = gdb.parse_and_eval('{void*}%s' % p) f = gdb.parse_and_eval('{void*}%s' % p)
m = gdb.execute('info symbol %s' % f, to_string=True) m = gdb.execute('info symbol %s' % f, to_string=True)
if not m.startswith('No symbol matches'): if not m.startswith('No symbol matches'):

View File

@@ -810,7 +810,7 @@ class Dumper(DumperBase):
needle = self.canonicalTypeName(name) needle = self.canonicalTypeName(name)
#DumperBase.warn('NEEDLE: %s ' % needle) #DumperBase.warn('NEEDLE: %s ' % needle)
self.warn('Searching for type %s across all target modules, this could be very slow' % name) 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) module = self.target.GetModuleAtIndex(i)
# SBModule.GetType is new somewhere after early 300.x # SBModule.GetType is new somewhere after early 300.x
# So this may fail. # So this may fail.
@@ -1000,7 +1000,7 @@ class Dumper(DumperBase):
return None if thread is None else thread.GetSelectedFrame() return None if thread is None else thread.GetSelectedFrame()
def firstStoppedThread(self): def firstStoppedThread(self):
for i in xrange(0, self.process.GetNumThreads()): for i in range(0, self.process.GetNumThreads()):
thread = self.process.GetThreadAtIndex(i) thread = self.process.GetThreadAtIndex(i)
reason = thread.GetStopReason() reason = thread.GetStopReason()
if (reason == lldb.eStopReasonBreakpoint or if (reason == lldb.eStopReasonBreakpoint or
@@ -1013,7 +1013,7 @@ class Dumper(DumperBase):
def fetchThreads(self, args): def fetchThreads(self, args):
result = 'threads=[' result = 'threads=['
for i in xrange(0, self.process.GetNumThreads()): for i in range(0, self.process.GetNumThreads()):
thread = self.process.GetThreadAtIndex(i) thread = self.process.GetThreadAtIndex(i)
if thread.is_stopped: if thread.is_stopped:
state = 'stopped' state = 'stopped'
@@ -1043,7 +1043,7 @@ class Dumper(DumperBase):
self.reportResult(result, args) self.reportResult(result, args)
def firstUsableFrame(self, thread): def firstUsableFrame(self, thread):
for i in xrange(10): for i in range(10):
frame = thread.GetFrameAtIndex(i) frame = thread.GetFrameAtIndex(i)
lineEntry = frame.GetLineEntry() lineEntry = frame.GetLineEntry()
line = lineEntry.GetLine() line = lineEntry.GetLine()
@@ -1067,7 +1067,7 @@ class Dumper(DumperBase):
self.currentCallContext = None self.currentCallContext = None
result = 'stack={current-thread="%s"' % thread.GetThreadID() result = 'stack={current-thread="%s"' % thread.GetThreadID()
result += ',frames=[' result += ',frames=['
for i in xrange(n): for i in range(n):
frame = thread.GetFrameAtIndex(i) frame = thread.GetFrameAtIndex(i)
if not frame.IsValid(): if not frame.IsValid():
isLimited = False isLimited = False
@@ -1183,7 +1183,7 @@ class Dumper(DumperBase):
with Children(self): with Children(self):
statics = frame.GetVariables(False, False, True, False) statics = frame.GetVariables(False, False, True, False)
if len(statics): if len(statics):
for i in xrange(len(statics)): for i in range(len(statics)):
staticVar = statics[i] staticVar = statics[i]
staticVar.SetPreferSyntheticValue(False) staticVar.SetPreferSyntheticValue(False)
typename = staticVar.GetType().GetName() typename = staticVar.GetType().GetName()
@@ -1408,7 +1408,7 @@ class Dumper(DumperBase):
if bp.IsValid() and isinstance(bp, lldb.SBBreakpoint): if bp.IsValid() and isinstance(bp, lldb.SBBreakpoint):
result += ',locations=[' result += ',locations=['
lineEntry = None lineEntry = None
for i in xrange(bp.GetNumLocations()): for i in range(bp.GetNumLocations()):
loc = bp.GetLocationAtIndex(i) loc = bp.GetLocationAtIndex(i)
addr = loc.GetAddress() addr = loc.GetAddress()
lineEntry = addr.GetLineEntry() lineEntry = addr.GetLineEntry()
@@ -1539,7 +1539,7 @@ class Dumper(DumperBase):
def fetchModules(self, args): def fetchModules(self, args):
result = 'modules=[' result = 'modules=['
for i in xrange(self.target.GetNumModules()): for i in range(self.target.GetNumModules()):
module = self.target.GetModuleAtIndex(i) module = self.target.GetModuleAtIndex(i)
result += '{file="%s"' % module.file.fullpath result += '{file="%s"' % module.file.fullpath
result += ',name="%s"' % module.file.basename result += ',name="%s"' % module.file.basename
@@ -1559,7 +1559,7 @@ class Dumper(DumperBase):
moduleName = args['module'] moduleName = args['module']
#file = lldb.SBFileSpec(moduleName) #file = lldb.SBFileSpec(moduleName)
#module = self.target.FindModule(file) #module = self.target.FindModule(file)
for i in xrange(self.target.GetNumModules()): for i in range(self.target.GetNumModules()):
module = self.target.GetModuleAtIndex(i) module = self.target.GetModuleAtIndex(i)
if module.file.fullpath == moduleName: if module.file.fullpath == moduleName:
break break
@@ -1872,7 +1872,7 @@ class Tester(Dumper):
break break
if state == lldb.eStateStopped: # 5 if state == lldb.eStateStopped: # 5
stoppedThread = None stoppedThread = None
for i in xrange(0, self.process.GetNumThreads()): for i in range(0, self.process.GetNumThreads()):
thread = self.process.GetThreadAtIndex(i) thread = self.process.GetThreadAtIndex(i)
reason = thread.GetStopReason() reason = thread.GetStopReason()
#DumperBase.warn('THREAD: %s REASON: %s' % (thread, reason)) #DumperBase.warn('THREAD: %s REASON: %s' % (thread, reason))

View File

@@ -65,7 +65,7 @@ def qdump____m512d(d, value):
def qdump____m128i(d, value): def qdump____m128i(d, value):
data = d.hexencode(value.data(16)) 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(): if d.isExpanded():
with Children(d): with Children(d):
addr = value.address() addr = value.address()
@@ -76,7 +76,7 @@ def qdump____m128i(d, value):
def qdump____m256i(d, value): def qdump____m256i(d, value):
data = d.hexencode(value.data(32)) 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(): if d.isExpanded():
with Children(d): with Children(d):
addr = value.address() addr = value.address()
@@ -87,8 +87,8 @@ def qdump____m256i(d, value):
def qdump____m512i(d, value): def qdump____m512i(d, value):
data = d.hexencode(value.data(64)) data = d.hexencode(value.data(64))
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))
+ ', ' + ':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(64, 128, 4))) + ', ' + ':'.join('%04x' % int(data[i:i+4], 16) for i in range(64, 128, 4)))
if d.isExpanded(): if d.isExpanded():
with Children(d): with Children(d):
d.putArrayItem('uint32x16', value.address(), 16, 'unsigned int') d.putArrayItem('uint32x16', value.address(), 16, 'unsigned int')
@@ -279,14 +279,14 @@ if False:
d.putNoType() d.putNoType()
if d.isExpanded(): if d.isExpanded():
with Children(d): with Children(d):
for i in xrange(count): for i in range(count):
d.putSubItem(Item(entries[i], iname)) d.putSubItem(Item(entries[i], iname))
with SubItem(d, 'data'): with SubItem(d, 'data'):
d.putEmptyValue() d.putEmptyValue()
d.putNoType() d.putNoType()
if d.isExpanded(): if d.isExpanded():
with Children(d): with Children(d):
for i in xrange(count): for i in range(count):
with SubItem(d, i): with SubItem(d, i):
entry = entries[i] entry = entries[i]
mpitype = str(entry['type']) mpitype = str(entry['type'])

View File

@@ -126,8 +126,8 @@ def qdump_X_QAbstractItemModel(d, value):
if d.isExpanded(): if d.isExpanded():
with Children(d, numChild=rowCount * columnCount, childType=ri.type): with Children(d, numChild=rowCount * columnCount, childType=ri.type):
i = 0 i = 0
for row in xrange(rowCount): for row in range(rowCount):
for column in xrange(columnCount): for column in range(columnCount):
with SubItem(d, i): with SubItem(d, i):
d.putName('[%s, %s]' % (row, column)) d.putName('[%s, %s]' % (row, column))
mi = d.parseAndEvaluate('%s.index(%d,%d,%s)' mi = d.parseAndEvaluate('%s.index(%d,%d,%s)'
@@ -182,8 +182,8 @@ def qdump_X_QModelIndex(d, value):
with Children(d): with Children(d):
d.putFields(value, False) d.putFields(value, False)
i = 0 i = 0
for row in xrange(rowCount): for row in range(rowCount):
for column in xrange(columnCount): for column in range(columnCount):
with UnnamedSubItem(d, i): with UnnamedSubItem(d, i):
d.putName('[%s, %s]' % (row, column)) d.putName('[%s, %s]' % (row, column))
mi2 = d.parseAndEvaluate('%s.index(%d,%d,%s)' mi2 = d.parseAndEvaluate('%s.index(%d,%d,%s)'
@@ -912,7 +912,7 @@ def qdump__QHostAddress(d, value):
if protocol == 1: if protocol == 1:
# value.d.d->a6 # value.d.d->a6
data = d.hexencode(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) d.putValue(address)
elif protocol == 0: elif protocol == 0:
# value.d.d->a # value.d.d->a
@@ -938,7 +938,7 @@ def qdump__QHostAddress(d, value):
def qdump__QIPv6Address(d, value): def qdump__QIPv6Address(d, value):
raw = d.split('16s', value)[0] raw = d.split('16s', value)[0]
data = d.hexencode(raw) 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')) d.putArrayData(value.address(), 16, d.lookupType('unsigned char'))
def qform__QList(): def qform__QList():

View File

@@ -1160,7 +1160,7 @@ def qdump____gnu_cxx__hash_set(d, value):
bucketFinish = buckets["_M_finish"] bucketFinish = buckets["_M_finish"]
p = bucketStart p = bucketStart
itemCount = 0 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(): if p.dereference().pointer():
cur = p.dereference() cur = p.dereference()
while cur.pointer(): while cur.pointer():

View File

@@ -138,13 +138,13 @@ struct DockOverlayCrossPrivate;
* You can style the cross icon using the property system. * You can style the cross icon using the property system.
* \code * \code
* ADS--DockOverlayCross * ADS--DockOverlayCross
{ * {
qproperty-iconFrameColor: palette(highlight); * qproperty-iconFrameColor: palette(highlight);
qproperty-iconBackgroundColor: palette(base); * qproperty-iconBackgroundColor: palette(base);
qproperty-iconOverlayColor: palette(highlight); * qproperty-iconOverlayColor: palette(highlight);
qproperty-iconArrowColor: rgb(227, 227, 227); * qproperty-iconArrowColor: rgb(227, 227, 227);
qproperty-iconShadowColor: rgb(0, 0, 0); * qproperty-iconShadowColor: rgb(0, 0, 0);
} * }
* \endcode * \endcode
* Or you can use the iconColors property to pass in AARRGGBB values as * Or you can use the iconColors property to pass in AARRGGBB values as
* hex string like shown in the example below. * hex string like shown in the example below.

View File

@@ -154,16 +154,18 @@ namespace ADS
void DockWidgetPrivate::updateParentDockArea() 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; return;
}
auto nextDockWidget = m_dockArea->nextOpenDockWidget(q); auto nextDockWidget = m_dockArea->nextOpenDockWidget(q);
if (nextDockWidget) { if (nextDockWidget)
m_dockArea->setCurrentDockWidget(nextDockWidget); m_dockArea->setCurrentDockWidget(nextDockWidget);
} else { else
m_dockArea->hideAreaWithNoVisibleContent(); m_dockArea->hideAreaWithNoVisibleContent();
}
} }
void DockWidgetPrivate::setupToolBar() void DockWidgetPrivate::setupToolBar()
@@ -222,9 +224,8 @@ namespace ADS
QScrollArea *scrollAreaWidget = qobject_cast<QScrollArea *>(widget); QScrollArea *scrollAreaWidget = qobject_cast<QScrollArea *>(widget);
if (scrollAreaWidget || ForceNoScrollArea == insertMode) { if (scrollAreaWidget || ForceNoScrollArea == insertMode) {
d->m_layout->addWidget(widget); d->m_layout->addWidget(widget);
if (scrollAreaWidget && scrollAreaWidget->viewport()) { if (scrollAreaWidget && scrollAreaWidget->viewport())
scrollAreaWidget->viewport()->setProperty("dockWidgetContent", true); scrollAreaWidget->viewport()->setProperty("dockWidgetContent", true);
}
} else { } else {
d->setupScrollArea(); d->setupScrollArea();
d->m_scrollArea->setWidget(widget); d->m_scrollArea->setWidget(widget);
@@ -283,9 +284,8 @@ namespace ADS
bool DockWidget::isFloating() const bool DockWidget::isFloating() const
{ {
if (!isInFloatingContainer()) { if (!isInFloatingContainer())
return false; return false;
}
return dockContainer()->topLevelDockWidget() == this; return dockContainer()->topLevelDockWidget() == this;
} }
@@ -293,13 +293,11 @@ namespace ADS
bool DockWidget::isInFloatingContainer() const bool DockWidget::isInFloatingContainer() const
{ {
auto container = dockContainer(); auto container = dockContainer();
if (!container) { if (!container)
return false; return false;
}
if (!container->isFloating()) { if (!container->isFloating())
return false; return false;
}
return true; return true;
} }
@@ -324,17 +322,16 @@ namespace ADS
// If the toggle view action mode is ActionModeShow, then Open is always // If the toggle view action mode is ActionModeShow, then Open is always
// true if the sender is the toggle view action // true if the sender is the toggle view action
QAction *action = qobject_cast<QAction *>(sender()); QAction *action = qobject_cast<QAction *>(sender());
if (action == d->m_toggleViewAction && !d->m_toggleViewAction->isCheckable()) { if (action == d->m_toggleViewAction && !d->m_toggleViewAction->isCheckable())
open = true; open = true;
}
// If the dock widget state is different, then we really need to toggle // 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 // the state. If we are in the right state, then we simply make this
// dock widget the current dock widget // dock widget the current dock widget
if (d->m_closed != !open) { if (d->m_closed != !open)
toggleViewInternal(open); toggleViewInternal(open);
} else if (open && d->m_dockArea) { else if (open && d->m_dockArea)
d->m_dockArea->setCurrentDockWidget(this); d->m_dockArea->setCurrentDockWidget(this);
}
} }
void DockWidget::toggleViewInternal(bool open) void DockWidget::toggleViewInternal(bool open)
@@ -353,13 +350,11 @@ namespace ADS
//d->m_toggleViewAction->blockSignals(true); //d->m_toggleViewAction->blockSignals(true);
d->m_toggleViewAction->setChecked(open); d->m_toggleViewAction->setChecked(open);
//d->m_toggleViewAction->blockSignals(false); //d->m_toggleViewAction->blockSignals(false);
if (d->m_dockArea) { if (d->m_dockArea)
d->m_dockArea->toggleDockWidgetView(this, open); d->m_dockArea->toggleDockWidgetView(this, open);
}
if (open && topLevelDockWidgetBefore) { if (open && topLevelDockWidgetBefore)
DockWidget::emitTopLevelEventForWidget(topLevelDockWidgetBefore, false); DockWidget::emitTopLevelEventForWidget(topLevelDockWidgetBefore, false);
}
// Here we need to call the dockContainer() function again, because if // Here we need to call the dockContainer() function again, because if
// this dock widget was unassigned before the call to showDockWidget() then // this dock widget was unassigned before the call to showDockWidget() then
@@ -370,13 +365,12 @@ namespace ADS
: nullptr; : nullptr;
DockWidget::emitTopLevelEventForWidget(topLevelDockWidgetAfter, true); DockWidget::emitTopLevelEventForWidget(topLevelDockWidgetAfter, true);
FloatingDockContainer *floatingContainer = dockContainerWidget->floatingWidget(); FloatingDockContainer *floatingContainer = dockContainerWidget->floatingWidget();
if (floatingContainer) { if (floatingContainer)
floatingContainer->updateWindowTitle(); floatingContainer->updateWindowTitle();
}
if (!open) { if (!open)
emit closed(); emit closed();
}
emit viewToggled(open); emit viewToggled(open);
} }
@@ -440,24 +434,22 @@ namespace ADS
#ifndef QT_NO_TOOLTIP #ifndef QT_NO_TOOLTIP
void DockWidget::setTabToolTip(const QString &text) void DockWidget::setTabToolTip(const QString &text)
{ {
if (d->m_tabWidget) { if (d->m_tabWidget)
d->m_tabWidget->setToolTip(text); d->m_tabWidget->setToolTip(text);
}
if (d->m_toggleViewAction) { if (d->m_toggleViewAction)
d->m_toggleViewAction->setToolTip(text); d->m_toggleViewAction->setToolTip(text);
}
if (d->m_dockArea) { if (d->m_dockArea)
d->m_dockArea->markTitleBarMenuOutdated(); //update tabs menu d->m_dockArea->markTitleBarMenuOutdated(); //update tabs menu
}
} }
#endif #endif
void DockWidget::setIcon(const QIcon &icon) void DockWidget::setIcon(const QIcon &icon)
{ {
d->m_tabWidget->setIcon(icon); d->m_tabWidget->setIcon(icon);
if (!d->m_toggleViewAction->isCheckable()) { if (!d->m_toggleViewAction->isCheckable())
d->m_toggleViewAction->setIcon(icon); d->m_toggleViewAction->setIcon(icon);
}
} }
QIcon DockWidget::icon() const { return d->m_tabWidget->icon(); } QIcon DockWidget::icon() const { return d->m_tabWidget->icon(); }
@@ -466,18 +458,16 @@ namespace ADS
QToolBar *DockWidget::createDefaultToolBar() QToolBar *DockWidget::createDefaultToolBar()
{ {
if (!d->m_toolBar) { if (!d->m_toolBar)
d->setupToolBar(); d->setupToolBar();
}
return d->m_toolBar; return d->m_toolBar;
} }
void DockWidget::setToolBar(QToolBar *toolBar) void DockWidget::setToolBar(QToolBar *toolBar)
{ {
if (d->m_toolBar) { if (d->m_toolBar)
delete d->m_toolBar; delete d->m_toolBar;
}
d->m_toolBar = toolBar; d->m_toolBar = toolBar;
d->m_layout->insertWidget(0, d->m_toolBar); d->m_layout->insertWidget(0, d->m_toolBar);
@@ -487,59 +477,52 @@ namespace ADS
void DockWidget::setToolBarStyle(Qt::ToolButtonStyle style, eState state) void DockWidget::setToolBarStyle(Qt::ToolButtonStyle style, eState state)
{ {
if (StateFloating == state) { if (StateFloating == state)
d->m_toolBarStyleFloating = style; d->m_toolBarStyleFloating = style;
} else { else
d->m_toolBarStyleDocked = style; d->m_toolBarStyleDocked = style;
}
setToolbarFloatingStyle(isFloating()); setToolbarFloatingStyle(isFloating());
} }
Qt::ToolButtonStyle DockWidget::toolBarStyle(eState state) const Qt::ToolButtonStyle DockWidget::toolBarStyle(eState state) const
{ {
if (StateFloating == state) { if (StateFloating == state)
return d->m_toolBarStyleFloating; return d->m_toolBarStyleFloating;
} else { else
return d->m_toolBarStyleDocked; return d->m_toolBarStyleDocked;
}
} }
void DockWidget::setToolBarIconSize(const QSize &iconSize, eState state) void DockWidget::setToolBarIconSize(const QSize &iconSize, eState state)
{ {
if (StateFloating == state) { if (StateFloating == state)
d->m_toolBarIconSizeFloating = iconSize; d->m_toolBarIconSizeFloating = iconSize;
} else { else
d->m_toolBarIconSizeDocked = iconSize; d->m_toolBarIconSizeDocked = iconSize;
}
setToolbarFloatingStyle(isFloating()); setToolbarFloatingStyle(isFloating());
} }
QSize DockWidget::toolBarIconSize(eState state) const QSize DockWidget::toolBarIconSize(eState state) const
{ {
if (StateFloating == state) { if (StateFloating == state)
return d->m_toolBarIconSizeFloating; return d->m_toolBarIconSizeFloating;
} else { else
return d->m_toolBarIconSizeDocked; return d->m_toolBarIconSizeDocked;
}
} }
void DockWidget::setToolbarFloatingStyle(bool floating) void DockWidget::setToolbarFloatingStyle(bool floating)
{ {
if (!d->m_toolBar) { if (!d->m_toolBar)
return; return;
}
auto iconSize = floating ? d->m_toolBarIconSizeFloating : d->m_toolBarIconSizeDocked; 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); d->m_toolBar->setIconSize(iconSize);
}
auto buttonStyle = floating ? d->m_toolBarStyleFloating : d->m_toolBarStyleDocked; 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); d->m_toolBar->setToolButtonStyle(buttonStyle);
}
} }
void DockWidget::emitTopLevelEventForWidget(DockWidget *topLevelDockWidget, bool floating) void DockWidget::emitTopLevelEventForWidget(DockWidget *topLevelDockWidget, bool floating)
@@ -564,9 +547,9 @@ namespace ADS
void DockWidget::setFloating() void DockWidget::setFloating()
{ {
if (isClosed()) { if (isClosed())
return; return;
}
d->m_tabWidget->detachDockWidget(); d->m_tabWidget->detachDockWidget();
} }
@@ -584,13 +567,11 @@ namespace ADS
bool DockWidget::closeDockWidgetInternal(bool forceClose) bool DockWidget::closeDockWidgetInternal(bool forceClose)
{ {
if (!forceClose) { if (!forceClose)
emit closeRequested(); emit closeRequested();
}
if (!forceClose && features().testFlag(DockWidget::CustomCloseHandling)) { if (!forceClose && features().testFlag(DockWidget::CustomCloseHandling))
return false; return false;
}
if (features().testFlag(DockWidget::DockWidgetDeleteOnClose)) { if (features().testFlag(DockWidget::DockWidgetDeleteOnClose)) {
// If the dock widget is floating, then we check if we also need to // If the dock widget is floating, then we check if we also need to
@@ -598,11 +579,10 @@ namespace ADS
if (isFloating()) { if (isFloating()) {
FloatingDockContainer* floatingWidget = internal::findParent< FloatingDockContainer* floatingWidget = internal::findParent<
FloatingDockContainer *>(this); FloatingDockContainer *>(this);
if (floatingWidget->dockWidgets().count() == 1) { if (floatingWidget->dockWidgets().count() == 1)
floatingWidget->deleteLater(); floatingWidget->deleteLater();
} else { else
floatingWidget->hide(); floatingWidget->hide();
}
} }
deleteDockWidget(); deleteDockWidget();
} else { } else {

View File

@@ -112,7 +112,7 @@ namespace ADS
if (testConfigFlag(DockManager::FloatingContainerHasWidgetTitle)) { if (testConfigFlag(DockManager::FloatingContainerHasWidgetTitle)) {
setWindowTitle(currentWidget->windowTitle()); setWindowTitle(currentWidget->windowTitle());
} else { } else {
setWindowTitle(qApp->applicationDisplayName()); setWindowTitle(QApplication::applicationDisplayName());
} }
// reflect CurrentWidget's icon if configured to do so, otherwise display application icon as window icon // reflect CurrentWidget's icon if configured to do so, otherwise display application icon as window icon
@@ -495,7 +495,7 @@ namespace ADS
&FloatingDockContainer::onDockAreaCurrentChanged); &FloatingDockContainer::onDockAreaCurrentChanged);
d->m_singleDockArea = nullptr; d->m_singleDockArea = nullptr;
} }
d->setWindowTitle(qApp->applicationDisplayName()); d->setWindowTitle(QApplication::applicationDisplayName());
setWindowIcon(QApplication::windowIcon()); setWindowIcon(QApplication::windowIcon());
} }
} }
@@ -507,7 +507,7 @@ namespace ADS
DockWidget *currentWidget = topLevelDockArea->currentDockWidget(); DockWidget *currentWidget = topLevelDockArea->currentDockWidget();
d->reflectCurrentWidget(currentWidget); d->reflectCurrentWidget(currentWidget);
} else { } else {
d->setWindowTitle(qApp->applicationDisplayName()); d->setWindowTitle(QApplication::applicationDisplayName());
setWindowIcon(QApplication::windowIcon()); setWindowIcon(QApplication::windowIcon());
} }
} }

View File

@@ -96,22 +96,19 @@ namespace ADS
void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &globalPosition) void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &globalPosition)
{ {
if (!q->isVisible() || !m_dockManager) { if (!q->isVisible() || !m_dockManager)
return; return;
}
auto containers = m_dockManager->dockContainers(); auto containers = m_dockManager->dockContainers();
DockContainerWidget *topContainer = nullptr; DockContainerWidget *topContainer = nullptr;
for (auto containerWidget : containers) { for (auto containerWidget : containers) {
if (!containerWidget->isVisible()) { if (!containerWidget->isVisible())
continue; continue;
}
QPoint mappedPosition = containerWidget->mapFromGlobal(globalPosition); QPoint mappedPosition = containerWidget->mapFromGlobal(globalPosition);
if (containerWidget->rect().contains(mappedPosition)) { if (containerWidget->rect().contains(mappedPosition)) {
if (!topContainer || containerWidget->isInFrontOf(topContainer)) { if (!topContainer || containerWidget->isInFrontOf(topContainer))
topContainer = containerWidget; topContainer = containerWidget;
}
} }
} }
@@ -124,9 +121,9 @@ namespace ADS
if (!topContainer) { if (!topContainer) {
containerOverlay->hideOverlay(); containerOverlay->hideOverlay();
dockAreaOverlay->hideOverlay(); dockAreaOverlay->hideOverlay();
if (DockManager::configFlags().testFlag(DockManager::DragPreviewIsDynamic)) { if (DockManager::configFlags().testFlag(DockManager::DragPreviewIsDynamic))
setHidden(false); setHidden(false);
}
return; return;
} }
@@ -153,9 +150,8 @@ namespace ADS
} }
} else { } else {
dockAreaOverlay->hideOverlay(); dockAreaOverlay->hideOverlay();
if (dockArea == m_contentSourceArea && InvalidDockWidgetArea == containerDropArea) { if (dockArea == m_contentSourceArea && InvalidDockWidgetArea == containerDropArea)
m_dropContainer = nullptr; m_dropContainer = nullptr;
}
} }
if (DockManager::configFlags().testFlag(DockManager::DragPreviewIsDynamic)) { if (DockManager::configFlags().testFlag(DockManager::DragPreviewIsDynamic)) {
@@ -199,7 +195,10 @@ namespace ADS
connect(qApp, connect(qApp,
&QApplication::applicationStateChanged, &QApplication::applicationStateChanged,
this, 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) FloatingDragPreview::FloatingDragPreview(DockWidget *content)
@@ -212,9 +211,6 @@ namespace ADS
d->m_contenSourceContainer = content->dockContainer(); d->m_contenSourceContainer = content->dockContainer();
} }
setWindowTitle(content->windowTitle()); 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) FloatingDragPreview::FloatingDragPreview(DockAreaWidget *content)
@@ -225,10 +221,6 @@ namespace ADS
d->m_contentSourceArea = content; d->m_contentSourceArea = content;
d->m_contenSourceContainer = content->dockContainer(); d->m_contenSourceContainer = content->dockContainer();
setWindowTitle(content->currentDockWidget()->windowTitle()); 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; } FloatingDragPreview::~FloatingDragPreview() { delete d; }
@@ -277,9 +269,8 @@ namespace ADS
floatingWidget = new FloatingDockContainer(dockWidget); floatingWidget = new FloatingDockContainer(dockWidget);
} else { } else {
DockAreaWidget *dockArea = qobject_cast<DockAreaWidget *>(d->m_content); DockAreaWidget *dockArea = qobject_cast<DockAreaWidget *>(d->m_content);
if (dockArea->features().testFlag(DockWidget::DockWidgetFloatable)) { if (dockArea->features().testFlag(DockWidget::DockWidgetFloatable))
floatingWidget = new FloatingDockContainer(dockArea); floatingWidget = new FloatingDockContainer(dockArea);
}
} }
if (floatingWidget) { if (floatingWidget) {
@@ -303,14 +294,12 @@ namespace ADS
void FloatingDragPreview::paintEvent(QPaintEvent *event) void FloatingDragPreview::paintEvent(QPaintEvent *event)
{ {
Q_UNUSED(event) Q_UNUSED(event)
if (d->m_hidden) { if (d->m_hidden)
return; return;
}
QPainter painter(this); QPainter painter(this);
if (DockManager::configFlags().testFlag(DockManager::DragPreviewShowsContentPixmap)) { if (DockManager::configFlags().testFlag(DockManager::DragPreviewShowsContentPixmap))
painter.drawPixmap(QPoint(0, 0), d->m_contentPreviewPixmap); 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 we do not have a window frame then we paint a QRubberBand like frameless window
if (!DockManager::configFlags().testFlag(DockManager::DragPreviewHasWindowFrame)) { if (!DockManager::configFlags().testFlag(DockManager::DragPreviewHasWindowFrame)) {

View File

@@ -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 add_qtc_library(Utils
DEPENDS Qt5::Xml DEPENDS Qt5::Xml
PUBLIC_DEPENDS Qt5::Concurrent Qt5::Core Qt5::Network Qt5::Qml Qt5::Gui Qt5::Widgets PUBLIC_DEPENDS Qt5::Concurrent Qt5::Core Qt5::Network Qt5::Qml Qt5::Gui Qt5::Widgets
DEFINES DEFINES
"QTC_REL_TOOLS_PATH=\"${RELATIVE_TOOLS_PATH}\"" "QTC_REL_TOOLS_PATH=\"${RELATIVE_LIBEXEC_PATH}\""
SOURCES SOURCES
../3rdparty/optional/optional.hpp ../3rdparty/optional/optional.hpp
../3rdparty/variant/variant.hpp ../3rdparty/variant/variant.hpp

View File

@@ -228,8 +228,16 @@ ToolChainList AndroidToolChainFactory::autodetectToolChainsForNdk(const ToolChai
const Abi &abi = targetItr.value(); const Abi &abi = targetItr.value();
const QString target = targetItr.key(); const QString target = targetItr.key();
ToolChain *tc = findToolChain(compilerCommand, lang, target, alreadyKnown); 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) { if (tc) {
qCDebug(androidTCLog) << "Tool chain already known" << abi.toString() << lang; 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 { } else {
qCDebug(androidTCLog) << "New Clang toolchain found" << abi.toString() << lang; qCDebug(androidTCLog) << "New Clang toolchain found" << abi.toString() << lang;
auto atc = new AndroidToolChain(); auto atc = new AndroidToolChain();
@@ -239,14 +247,11 @@ ToolChainList AndroidToolChainFactory::autodetectToolChainsForNdk(const ToolChai
atc->setTargetAbi(ClangTargets[target]); atc->setTargetAbi(ClangTargets[target]);
atc->setPlatformCodeGenFlags({"-target", target}); atc->setPlatformCodeGenFlags({"-target", target});
atc->setPlatformLinkerFlags({"-target", target}); atc->setPlatformLinkerFlags({"-target", target});
atc->setDetection(ToolChain::AutoDetection); atc->setDisplayName(displayName);
atc->setDisplayName(QString("Android Clang (%1, %2, NDK %3)")
.arg(ToolChainManager::displayNameOfLanguageId(lang),
AndroidConfig::displayName(abi),
config.ndkVersion(qtVersion).toString()));
atc->resetToolChain(compilerCommand); atc->resetToolChain(compilerCommand);
tc = atc; tc = atc;
} }
tc->setDetection(ToolChain::AutoDetection);
result << tc; result << tc;
++targetItr; ++targetItr;
} }

View File

@@ -236,7 +236,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
this, &AutotestPlugin::updateMenuItemsEnabledState); this, &AutotestPlugin::updateMenuItemsEnabledState);
connect(BuildManager::instance(), &BuildManager::buildQueueFinished, connect(BuildManager::instance(), &BuildManager::buildQueueFinished,
this, &AutotestPlugin::updateMenuItemsEnabledState); this, &AutotestPlugin::updateMenuItemsEnabledState);
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated,
this, &AutotestPlugin::updateMenuItemsEnabledState); this, &AutotestPlugin::updateMenuItemsEnabledState);
connect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged, connect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged,
this, &AutotestPlugin::updateMenuItemsEnabledState); this, &AutotestPlugin::updateMenuItemsEnabledState);

View File

@@ -59,7 +59,7 @@ public:
if (auto debugAspect = aspect<Debugger::DebuggerRunConfigurationAspect>()) { if (auto debugAspect = aspect<Debugger::DebuggerRunConfigurationAspect>()) {
debugAspect->setUseQmlDebugger(enableQuick); debugAspect->setUseQmlDebugger(enableQuick);
ProjectExplorer::ProjectExplorerPlugin::instance()->updateRunActions(); ProjectExplorer::ProjectExplorerPlugin::updateRunActions();
} }
m_testConfig = config; m_testConfig = config;
} }

View File

@@ -215,8 +215,11 @@ void ClangCompletionAssistProcessor::handleAvailableCompletions(const CodeComple
return; return;
} }
if (!m_fallbackToNormalCompletion) if (!m_fallbackToNormalCompletion) {
// We must report back to the code assistant under all circumstances
setAsyncProposalAvailable(nullptr);
return; return;
}
// else: Proceed with a normal completion in case: // else: Proceed with a normal completion in case:
// 1) it was not a function call, but e.g. a function declaration like "void f(" // 1) it was not a function call, but e.g. a function declaration like "void f("
// 2) '{' meant not a constructor call. // 2) '{' meant not a constructor call.

View File

@@ -602,7 +602,7 @@ ClangTool::ClangTool()
update(); update();
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated,
this, &ClangTool::update); this, &ClangTool::update);
connect(CppModelManager::instance(), &CppModelManager::projectPartsUpdated, connect(CppModelManager::instance(), &CppModelManager::projectPartsUpdated,
this, &ClangTool::update); this, &ClangTool::update);

View File

@@ -176,7 +176,7 @@ bool CppcheckPlugin::initialize(const QStringList &arguments, QString *errorStri
} }
using ProjectExplorer::ProjectExplorerPlugin; using ProjectExplorer::ProjectExplorerPlugin;
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated,
d.get(), &CppcheckPluginPrivate::updateManualRunAction); d.get(), &CppcheckPluginPrivate::updateManualRunAction);
d->updateManualRunAction(); d->updateManualRunAction();

View File

@@ -1186,7 +1186,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
this, &DebuggerPluginPrivate::writeSettings); this, &DebuggerPluginPrivate::writeSettings);
// ProjectExplorer // ProjectExplorer
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated,
this, &DebuggerPluginPrivate::updatePresetState); this, &DebuggerPluginPrivate::updatePresetState);
// EditorManager // EditorManager

View File

@@ -82,7 +82,7 @@ BranchView::BranchView() :
m_refreshButton(new QToolButton(this)), m_refreshButton(new QToolButton(this)),
m_repositoryLabel(new Utils::ElidingLabel(this)), m_repositoryLabel(new Utils::ElidingLabel(this)),
m_branchView(new Utils::NavigationTreeView(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_filterModel(new BranchFilterModel(this))
{ {
m_addButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon()); m_addButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
@@ -122,7 +122,7 @@ BranchView::BranchView() :
this, &BranchView::setIncludeOldEntries); this, &BranchView::setIncludeOldEntries);
m_includeTagsAction->setCheckable(true); m_includeTagsAction->setCheckable(true);
m_includeTagsAction->setChecked( m_includeTagsAction->setChecked(
GitPlugin::client()->settings().boolValue(GitSettings::showTagsKey)); GitClient::instance()->settings().boolValue(GitSettings::showTagsKey));
connect(m_includeTagsAction, &QAction::toggled, connect(m_includeTagsAction, &QAction::toggled,
this, &BranchView::setIncludeTags); this, &BranchView::setIncludeTags);
@@ -214,12 +214,12 @@ void BranchView::slotCustomContextMenu(const QPoint &point)
const Utils::optional<QString> remote = m_model->remoteName(index); const Utils::optional<QString> remote = m_model->remoteName(index);
if (remote.has_value()) { if (remote.has_value()) {
contextMenu.addAction(tr("&Fetch"), this, [this, &remote]() { contextMenu.addAction(tr("&Fetch"), this, [this, &remote]() {
GitPlugin::client()->fetch(m_repository, *remote); GitClient::instance()->fetch(m_repository, *remote);
}); });
contextMenu.addSeparator(); contextMenu.addSeparator();
if (!remote->isEmpty()) { if (!remote->isEmpty()) {
contextMenu.addAction(tr("Remove &Stale Branches"), this, [this, &remote]() { contextMenu.addAction(tr("Remove &Stale Branches"), this, [this, &remote]() {
GitPlugin::client()->removeStaleRemoteBranches(m_repository, *remote); GitClient::instance()->removeStaleRemoteBranches(m_repository, *remote);
}); });
contextMenu.addSeparator(); contextMenu.addSeparator();
} }
@@ -238,7 +238,7 @@ void BranchView::slotCustomContextMenu(const QPoint &point)
contextMenu.addAction(tr("&Diff"), this, [this] { contextMenu.addAction(tr("&Diff"), this, [this] {
const QString fullName = m_model->fullName(selectedIndex(), true); const QString fullName = m_model->fullName(selectedIndex(), true);
if (!fullName.isEmpty()) 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("&Log"), this, [this] { log(selectedIndex()); });
contextMenu.addAction(tr("Reflo&g"), this, [this] { reflog(selectedIndex()); }); contextMenu.addAction(tr("Reflo&g"), this, [this] { reflog(selectedIndex()); });
@@ -289,7 +289,7 @@ void BranchView::setIncludeOldEntries(bool filter)
void BranchView::setIncludeTags(bool includeTags) void BranchView::setIncludeTags(bool includeTags)
{ {
GitPlugin::client()->settings().setValue(GitSettings::showTagsKey, includeTags); GitClient::instance()->settings().setValue(GitSettings::showTagsKey, includeTags);
refreshCurrentRepository(); refreshCurrentRepository();
} }
@@ -365,7 +365,7 @@ bool BranchView::checkout()
' ' + nextBranch + "-AutoStash "; ' ' + nextBranch + "-AutoStash ";
BranchCheckoutDialog branchCheckoutDialog(this, currentBranch, nextBranch); BranchCheckoutDialog branchCheckoutDialog(this, currentBranch, nextBranch);
GitClient *client = GitPlugin::client(); GitClient *client = GitClient::instance();
if (client->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) != GitClient::StatusChanged) if (client->gitStatus(m_repository, StatusMode(NoUntracked | NoSubmodules)) != GitClient::StatusChanged)
branchCheckoutDialog.foundNoLocalChanges(); 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\"?") if (QMessageBox::question(this, tr("Git Reset"), tr("Reset branch \"%1\" to \"%2\"?")
.arg(currentName).arg(branchName), .arg(currentName).arg(branchName),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { 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 true;
} }
return false; return false;
@@ -512,7 +512,7 @@ bool BranchView::isFastForwardMerge()
QTC_CHECK(selected != m_model->currentBranch()); QTC_CHECK(selected != m_model->currentBranch());
const QString branch = m_model->fullName(selected, true); 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) bool BranchView::merge(bool allowFastForward)
@@ -523,7 +523,7 @@ bool BranchView::merge(bool allowFastForward)
QTC_CHECK(selected != m_model->currentBranch()); QTC_CHECK(selected != m_model->currentBranch());
const QString branch = m_model->fullName(selected, true); const QString branch = m_model->fullName(selected, true);
GitClient *client = GitPlugin::client(); GitClient *client = GitClient::instance();
if (client->beginStashScope(m_repository, "merge", AllowUnstashed)) if (client->beginStashScope(m_repository, "merge", AllowUnstashed))
return client->synchronousMerge(m_repository, branch, allowFastForward); return client->synchronousMerge(m_repository, branch, allowFastForward);
@@ -538,7 +538,7 @@ void BranchView::rebase()
QTC_CHECK(selected != m_model->currentBranch()); QTC_CHECK(selected != m_model->currentBranch());
const QString baseBranch = m_model->fullName(selected, true); const QString baseBranch = m_model->fullName(selected, true);
GitClient *client = GitPlugin::client(); GitClient *client = GitClient::instance();
if (client->beginStashScope(m_repository, "rebase")) if (client->beginStashScope(m_repository, "rebase"))
client->rebase(m_repository, baseBranch); client->rebase(m_repository, baseBranch);
} }
@@ -551,21 +551,21 @@ bool BranchView::cherryPick()
QTC_CHECK(selected != m_model->currentBranch()); QTC_CHECK(selected != m_model->currentBranch());
const QString branch = m_model->fullName(selected, true); 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) void BranchView::log(const QModelIndex &idx)
{ {
const QString branchName = m_model->fullName(idx, true); const QString branchName = m_model->fullName(idx, true);
if (!branchName.isEmpty()) 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) void BranchView::reflog(const QModelIndex &idx)
{ {
const QString branchName = m_model->fullName(idx, true); const QString branchName = m_model->fullName(idx, true);
if (!branchName.isEmpty()) if (!branchName.isEmpty())
GitPlugin::client()->reflog(m_repository, branchName); GitClient::instance()->reflog(m_repository, branchName);
} }
void BranchView::push() void BranchView::push()
@@ -581,7 +581,7 @@ void BranchView::push()
const QString remoteBranch = fullTargetName.mid(pos + 1); const QString remoteBranch = fullTargetName.mid(pos + 1);
const QStringList pushArgs = {remoteName, localBranch + ':' + remoteBranch}; const QStringList pushArgs = {remoteName, localBranch + ':' + remoteBranch};
GitPlugin::client()->push(m_repository, pushArgs); GitClient::instance()->push(m_repository, pushArgs);
} }
BranchViewFactory::BranchViewFactory() BranchViewFactory::BranchViewFactory()

View File

@@ -25,7 +25,6 @@
#include "changeselectiondialog.h" #include "changeselectiondialog.h"
#include "logchangedialog.h" #include "logchangedialog.h"
#include "gitplugin.h"
#include "gitclient.h" #include "gitclient.h"
#include "ui_changeselectiondialog.h" #include "ui_changeselectiondialog.h"
@@ -57,12 +56,12 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
QWidget *parent) : QWidget *parent) :
QDialog(parent), m_ui(new Ui::ChangeSelectionDialog) QDialog(parent), m_ui(new Ui::ChangeSelectionDialog)
{ {
m_gitExecutable = GitPlugin::client()->vcsBinary(); m_gitExecutable = GitClient::instance()->vcsBinary();
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->workingDirectoryChooser->setExpectedKind(PathChooser::ExistingDirectory); m_ui->workingDirectoryChooser->setExpectedKind(PathChooser::ExistingDirectory);
m_ui->workingDirectoryChooser->setPromptDialogTitle(tr("Select Git Directory")); m_ui->workingDirectoryChooser->setPromptDialogTitle(tr("Select Git Directory"));
m_ui->workingDirectoryChooser->setPath(workingDirectory); m_ui->workingDirectoryChooser->setPath(workingDirectory);
m_gitEnvironment = GitPlugin::client()->processEnvironment(); m_gitEnvironment = GitClient::instance()->processEnvironment();
m_ui->changeNumberEdit->setFocus(); m_ui->changeNumberEdit->setFocus();
m_ui->changeNumberEdit->selectAll(); m_ui->changeNumberEdit->selectAll();
@@ -203,7 +202,7 @@ void ChangeSelectionDialog::recalculateCompletion()
if (workingDir.isEmpty()) if (workingDir.isEmpty())
return; return;
GitClient *client = GitPlugin::client(); GitClient *client = GitClient::instance();
VcsBase::VcsCommand *command = client->asyncForEachRefCmd( VcsBase::VcsCommand *command = client->asyncForEachRefCmd(
workingDir, {"--format=%(refname:short)"}); workingDir, {"--format=%(refname:short)"});
connect(this, &QObject::destroyed, command, &VcsBase::VcsCommand::abort); connect(this, &QObject::destroyed, command, &VcsBase::VcsCommand::abort);

View File

@@ -24,7 +24,6 @@
****************************************************************************/ ****************************************************************************/
#include "branchcombobox.h" #include "branchcombobox.h"
#include "../gitplugin.h"
#include "../gitclient.h" #include "../gitclient.h"
using namespace Git::Internal; using namespace Git::Internal;
@@ -36,7 +35,7 @@ BranchComboBox::BranchComboBox(QWidget *parent) : QComboBox(parent)
void BranchComboBox::init(const QString &repository) void BranchComboBox::init(const QString &repository)
{ {
m_repository = repository; m_repository = repository;
QString currentBranch = GitPlugin::client()->synchronousCurrentLocalBranch(repository); QString currentBranch = GitClient::instance()->synchronousCurrentLocalBranch(repository);
if (currentBranch.isEmpty()) { if (currentBranch.isEmpty()) {
m_detached = true; m_detached = true;
currentBranch = "HEAD"; currentBranch = "HEAD";
@@ -44,7 +43,7 @@ void BranchComboBox::init(const QString &repository)
} }
QString output; QString output;
const QString branchPrefix("refs/heads/"); const QString branchPrefix("refs/heads/");
if (!GitPlugin::client()->synchronousForEachRefCmd( if (!GitClient::instance()->synchronousForEachRefCmd(
m_repository, {"--format=%(refname)", branchPrefix}, &output)) { m_repository, {"--format=%(refname)", branchPrefix}, &output)) {
return; return;
} }

View File

@@ -24,7 +24,6 @@
****************************************************************************/ ****************************************************************************/
#include "gerritmodel.h" #include "gerritmodel.h"
#include "../gitplugin.h"
#include "../gitclient.h" #include "../gitclient.h"
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
@@ -295,7 +294,7 @@ QueryContext::QueryContext(const QString &query,
connect(&m_process, &QProcess::errorOccurred, this, &QueryContext::processError); connect(&m_process, &QProcess::errorOccurred, this, &QueryContext::processError);
connect(&m_watcher, &QFutureWatcherBase::canceled, this, &QueryContext::terminate); connect(&m_watcher, &QFutureWatcherBase::canceled, this, &QueryContext::terminate);
m_watcher.setFuture(m_progress.future()); 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_progress.setProgressRange(0, 1);
m_timer.setInterval(timeOutMS); m_timer.setInterval(timeOutMS);

View File

@@ -148,7 +148,7 @@ FetchContext::FetchContext(const QSharedPointer<GerritChange> &change,
connect(&m_watcher, &QFutureWatcher<void>::canceled, this, &FetchContext::terminate); connect(&m_watcher, &QFutureWatcher<void>::canceled, this, &FetchContext::terminate);
m_watcher.setFuture(m_progress.future()); m_watcher.setFuture(m_progress.future());
m_process.setWorkingDirectory(repository); m_process.setWorkingDirectory(repository);
m_process.setProcessEnvironment(GitPlugin::client()->processEnvironment()); m_process.setProcessEnvironment(GitClient::instance()->processEnvironment());
m_process.closeWriteChannel(); m_process.closeWriteChannel();
} }
@@ -240,7 +240,7 @@ void FetchContext::show()
{ {
const QString title = QString::number(m_change->number) + '/' const QString title = QString::number(m_change->number) + '/'
+ QString::number(m_change->currentPatchSet.patchSetNumber); + 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() void FetchContext::cherryPick()
@@ -248,12 +248,12 @@ void FetchContext::cherryPick()
// Point user to errors. // Point user to errors.
VcsBase::VcsOutputWindow::instance()->popup(IOutputPane::ModeSwitch VcsBase::VcsOutputWindow::instance()->popup(IOutputPane::ModeSwitch
| IOutputPane::WithFocus); | IOutputPane::WithFocus);
GitPlugin::client()->synchronousCherryPick(m_repository, "FETCH_HEAD"); GitClient::instance()->synchronousCherryPick(m_repository, "FETCH_HEAD");
} }
void FetchContext::checkout() void FetchContext::checkout()
{ {
GitPlugin::client()->checkout(m_repository, "FETCH_HEAD"); GitClient::instance()->checkout(m_repository, "FETCH_HEAD");
} }
void FetchContext::terminate() void FetchContext::terminate()
@@ -328,7 +328,7 @@ void GerritPlugin::push(const QString &topLevel)
dialog.storeTopic(); dialog.storeTopic();
m_reviewers = dialog.reviewers(); m_reviewers = dialog.reviewers();
GitPlugin::client()->push(topLevel, {dialog.selectedRemoteName(), dialog.pushTarget()}); GitClient::instance()->push(topLevel, {dialog.selectedRemoteName(), dialog.pushTarget()});
} }
static QString currentRepository() static QString currentRepository()
@@ -375,19 +375,19 @@ void GerritPlugin::push()
Utils::FilePath GerritPlugin::gitBinDirectory() Utils::FilePath GerritPlugin::gitBinDirectory()
{ {
return GitPlugin::client()->gitBinDirectory(); return GitClient::instance()->gitBinDirectory();
} }
// Find the branch of a repository. // Find the branch of a repository.
QString GerritPlugin::branch(const QString &repository) QString GerritPlugin::branch(const QString &repository)
{ {
return GitPlugin::client()->synchronousCurrentLocalBranch(repository); return GitClient::instance()->synchronousCurrentLocalBranch(repository);
} }
void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode) void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
{ {
// Locate git. // Locate git.
const Utils::FilePath git = GitPlugin::client()->vcsBinary(); const Utils::FilePath git = GitClient::instance()->vcsBinary();
if (git.isEmpty()) { if (git.isEmpty()) {
VcsBase::VcsOutputWindow::appendError(tr("Git is not available.")); VcsBase::VcsOutputWindow::appendError(tr("Git is not available."));
return; return;
@@ -400,7 +400,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
if (!repository.isEmpty()) { if (!repository.isEmpty()) {
// Check if remote from a working dir is the same as remote from patch // Check if remote from a working dir is the same as remote from patch
QMap<QString, QString> remotesList = GitPlugin::client()->synchronousRemotesList(repository); QMap<QString, QString> remotesList = GitClient::instance()->synchronousRemotesList(repository);
if (!remotesList.isEmpty()) { if (!remotesList.isEmpty()) {
const QStringList remotes = remotesList.values(); const QStringList remotes = remotesList.values();
for (QString remote : remotes) { for (QString remote : remotes) {
@@ -413,7 +413,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
} }
if (!verifiedRepository) { if (!verifiedRepository) {
const SubmoduleDataMap submodules = GitPlugin::client()->submoduleList(repository); const SubmoduleDataMap submodules = GitClient::instance()->submoduleList(repository);
for (const SubmoduleData &submoduleData : submodules) { for (const SubmoduleData &submoduleData : submodules) {
QString remote = submoduleData.url; QString remote = submoduleData.url;
if (remote.endsWith(".git")) if (remote.endsWith(".git"))

View File

@@ -27,7 +27,6 @@
#include "ui_gerritpushdialog.h" #include "ui_gerritpushdialog.h"
#include "branchcombobox.h" #include "branchcombobox.h"
#include "../gitplugin.h"
#include "../gitclient.h" #include "../gitclient.h"
#include "../gitconstants.h" #include "../gitconstants.h"
@@ -70,7 +69,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch)
QString output; QString output;
QString error; QString error;
if (!GitPlugin::client()->synchronousBranchCmd( if (!GitClient::instance()->synchronousBranchCmd(
m_workingDir, {"-r", "--contains", earliestCommit + '^'}, &output, &error)) { m_workingDir, {"-r", "--contains", earliestCommit + '^'}, &output, &error)) {
return QString(); return QString();
} }
@@ -79,7 +78,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch)
QString remoteTrackingBranch; QString remoteTrackingBranch;
if (localBranch != "HEAD") if (localBranch != "HEAD")
remoteTrackingBranch = GitPlugin::client()->synchronousTrackingBranch(m_workingDir, localBranch); remoteTrackingBranch = GitClient::instance()->synchronousTrackingBranch(m_workingDir, localBranch);
QString remoteBranch; QString remoteBranch;
for (const QString &reference : refs) { for (const QString &reference : refs) {
@@ -103,7 +102,7 @@ void GerritPushDialog::initRemoteBranches()
const QString head = "/HEAD"; const QString head = "/HEAD";
QString remotesPrefix("refs/remotes/"); QString remotesPrefix("refs/remotes/");
if (!GitPlugin::client()->synchronousForEachRefCmd( if (!GitClient::instance()->synchronousForEachRefCmd(
m_workingDir, {"--format=%(refname)\t%(committerdate:raw)", remotesPrefix}, &output)) { m_workingDir, {"--format=%(refname)\t%(committerdate:raw)", remotesPrefix}, &output)) {
return; return;
} }
@@ -186,8 +185,8 @@ QString GerritPushDialog::calculateChangeRange(const QString &branch)
QString number; QString number;
QString error; QString error;
GitPlugin::client()->synchronousRevListCmd(m_workingDir, { remote + ".." + branch, "--count" }, GitClient::instance()->synchronousRevListCmd(
&number, &error); m_workingDir, { remote + ".." + branch, "--count" }, &number, &error);
number.chop(1); number.chop(1);
return number; return number;
@@ -303,8 +302,8 @@ QString GerritPushDialog::pushTarget() const
void GerritPushDialog::storeTopic() void GerritPushDialog::storeTopic()
{ {
const QString branch = m_ui->localBranchComboBox->currentText(); const QString branch = m_ui->localBranchComboBox->currentText();
GitPlugin::client()->setConfigValue(m_workingDir, QString("branch.%1.topic").arg(branch), GitClient::instance()->setConfigValue(
selectedTopic()); m_workingDir, QString("branch.%1.topic").arg(branch), selectedTopic());
} }
void GerritPushDialog::setRemoteBranches(bool includeOld) void GerritPushDialog::setRemoteBranches(bool includeOld)
@@ -316,7 +315,7 @@ void GerritPushDialog::setRemoteBranches(bool includeOld)
const QString remoteName = selectedRemoteName(); const QString remoteName = selectedRemoteName();
if (!m_remoteBranches.contains(remoteName)) { if (!m_remoteBranches.contains(remoteName)) {
const QStringList remoteBranches = const QStringList remoteBranches =
GitPlugin::client()->synchronousRepositoryBranches(remoteName, m_workingDir); GitClient::instance()->synchronousRepositoryBranches(remoteName, m_workingDir);
for (const QString &branch : remoteBranches) for (const QString &branch : remoteBranches)
m_remoteBranches.insertMulti(remoteName, qMakePair(branch, QDate())); m_remoteBranches.insertMulti(remoteName, qMakePair(branch, QDate()));
if (remoteBranches.isEmpty()) { if (remoteBranches.isEmpty()) {
@@ -354,7 +353,7 @@ void GerritPushDialog::updateCommits(int index)
{ {
const QString branch = m_ui->localBranchComboBox->itemText(index); const QString branch = m_ui->localBranchComboBox->itemText(index);
m_hasLocalCommits = m_ui->commitView->init(m_workingDir, branch, LogChangeWidget::Silent); 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)); m_workingDir, QString("branch.%1.topic").arg(branch));
if (!topic.isEmpty()) if (!topic.isEmpty())
m_ui->topicLineEdit->setText(topic); m_ui->topicLineEdit->setText(topic);

View File

@@ -27,7 +27,6 @@
#include "gerritparameters.h" #include "gerritparameters.h"
#include "gerritserver.h" #include "gerritserver.h"
#include "../gitclient.h" #include "../gitclient.h"
#include "../gitplugin.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/utilsicons.h> #include <utils/utilsicons.h>
@@ -104,7 +103,7 @@ bool GerritRemoteChooser::updateRemotes(bool forceReload)
m_remotes.clear(); m_remotes.clear();
QString errorMessage; // Mute errors. We'll just fallback to the defaults QString errorMessage; // Mute errors. We'll just fallback to the defaults
const QMap<QString, QString> remotesList = const QMap<QString, QString> 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) { for (auto mapIt = remotesList.cbegin(), end = remotesList.cend(); mapIt != end; ++mapIt) {
GerritServer server; GerritServer server;
if (!server.fillFromRemote(mapIt.value(), *m_parameters, forceReload)) if (!server.fillFromRemote(mapIt.value(), *m_parameters, forceReload))

View File

@@ -241,7 +241,7 @@ QStringList GerritServer::curlArguments() const
int GerritServer::testConnection() int GerritServer::testConnection()
{ {
static GitClient *const client = GitPlugin::client(); static GitClient *const client = GitClient::instance();
const QStringList arguments = curlArguments() << (url(RestUrl) + accountUrlC); const QStringList arguments = curlArguments() << (url(RestUrl) + accountUrlC);
const SynchronousProcessResponse resp = client->vcsFullySynchronousExec( const SynchronousProcessResponse resp = client->vcsFullySynchronousExec(
QString(), {curlBinary, arguments}, QString(), {curlBinary, arguments},
@@ -333,7 +333,7 @@ bool GerritServer::resolveRoot()
void GerritServer::resolveVersion(const GerritParameters &p, bool forceReload) 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(); QSettings *settings = Core::ICore::settings();
const QString fullVersionKey = "Gerrit/" + host + '/' + versionKey; const QString fullVersionKey = "Gerrit/" + host + '/' + versionKey;
version = settings->value(fullVersionKey).toString(); version = settings->value(fullVersionKey).toString();

View File

@@ -106,6 +106,8 @@ using namespace VcsBase;
namespace Git { namespace Git {
namespace Internal { namespace Internal {
static GitClient *m_instance = nullptr;
// Suppress git diff warnings about "LF will be replaced by CRLF..." on Windows. // Suppress git diff warnings about "LF will be replaced by CRLF..." on Windows.
static unsigned diffExecutionFlags() static unsigned diffExecutionFlags()
{ {
@@ -300,7 +302,7 @@ void GitDiffEditorController::updateBranchList()
return; return;
const QString workingDirectory = baseDirectory(); const QString workingDirectory = baseDirectory();
VcsCommand *command = GitPlugin::client()->vcsExec( VcsCommand *command = m_instance->vcsExec(
workingDirectory, {"branch", noColorOption, "-a", "--contains", revision}, nullptr, workingDirectory, {"branch", noColorOption, "-a", "--contains", revision}, nullptr,
false, 0, workingDirectory); false, 0, workingDirectory);
connect(command, &VcsCommand::stdOutText, this, [this](const QString &text) { 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, // 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 // we compare the current state of working tree to the HEAD of current branch
// instead of showing unsupported combined diff format. // 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) if (commandInProgress != GitClient::NoCommand)
return {HEAD}; return {HEAD};
return QStringList(); return QStringList();
@@ -478,7 +480,7 @@ public:
setReloader([this] { setReloader([this] {
m_state = GettingDescription; m_state = GettingDescription;
const QStringList args = {"show", "-s", noColorOption, showFormatC, m_id}; 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())); setStartupFile(VcsBase::source(this->document()));
}); });
} }
@@ -495,7 +497,7 @@ void ShowController::processCommandOutput(const QString &output)
{ {
QTC_ASSERT(m_state != Idle, return); QTC_ASSERT(m_state != Idle, return);
if (m_state == GettingDescription) { if (m_state == GettingDescription) {
setDescription(GitPlugin::client()->extendedShowDescription(workingDirectory(), output)); setDescription(m_instance->extendedShowDescription(workingDirectory(), output));
// stage 2 // stage 2
m_state = GettingDiff; m_state = GettingDiff;
const QStringList args = {"show", "--format=format:", // omit header, already generated 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 // If interactive rebase editor window is closed, plugin is terminated
// but referenced here when the command ends // but referenced here when the command ends
GitClient *client = GitPlugin::client();
if (m_commit.isEmpty() && m_files.isEmpty()) { if (m_commit.isEmpty() && m_files.isEmpty()) {
if (client->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand) if (m_instance->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand)
client->endStashScope(m_workingDirectory); m_instance->endStashScope(m_workingDirectory);
} else { } 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_cachedGitVersion(0),
m_disableEditor(false) m_disableEditor(false)
{ {
m_instance = this;
m_gitQtcEditor = QString::fromLatin1("\"%1\" -client -block -pid %2") m_gitQtcEditor = QString::fromLatin1("\"%1\" -client -block -pid %2")
.arg(QCoreApplication::applicationFilePath()) .arg(QCoreApplication::applicationFilePath())
.arg(QCoreApplication::applicationPid()); .arg(QCoreApplication::applicationPid());
} }
GitClient *GitClient::instance()
{
return m_instance;
}
QString GitClient::findRepositoryForDirectory(const QString &directory) const QString GitClient::findRepositoryForDirectory(const QString &directory) const
{ {
if (directory.isEmpty() || directory.endsWith("/.git") || directory.contains("/.git/")) 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; m_pushAction = pushAction;
QString errorMessage; QString errorMessage;
QString statusOutput; QString statusOutput;
switch (GitPlugin::client()->gitStatus(m_workingDir, StatusMode(NoUntracked | NoSubmodules), switch (m_instance->gitStatus(m_workingDir, StatusMode(NoUntracked | NoSubmodules),
&statusOutput, &errorMessage)) { &statusOutput, &errorMessage)) {
case GitClient::StatusChanged: case GitClient::StatusChanged:
if (m_flags & NoPrompt) if (m_flags & NoPrompt)
executeStash(command, &errorMessage); executeStash(command, &errorMessage);
@@ -3529,14 +3536,14 @@ void GitClient::StashInfo::stashPrompt(const QString &command, const QString &st
msgBox.exec(); msgBox.exec();
if (msgBox.clickedButton() == discardButton) { if (msgBox.clickedButton() == discardButton) {
m_stashResult = GitPlugin::client()->synchronousReset(m_workingDir, QStringList(), errorMessage) ? m_stashResult = m_instance->synchronousReset(m_workingDir, QStringList(), errorMessage) ?
StashUnchanged : StashFailed; StashUnchanged : StashFailed;
} else if (msgBox.clickedButton() == ignoreButton) { // At your own risk, so. } else if (msgBox.clickedButton() == ignoreButton) { // At your own risk, so.
m_stashResult = NotStashed; m_stashResult = NotStashed;
} else if (msgBox.clickedButton() == cancelButton) { } else if (msgBox.clickedButton() == cancelButton) {
m_stashResult = StashCanceled; m_stashResult = StashCanceled;
} else if (msgBox.clickedButton() == stashButton) { } else if (msgBox.clickedButton() == stashButton) {
const bool result = GitPlugin::client()->executeSynchronousStash( const bool result = m_instance->executeSynchronousStash(
m_workingDir, creatorStashMessage(command), false, errorMessage); m_workingDir, creatorStashMessage(command), false, errorMessage);
m_stashResult = result ? StashUnchanged : StashFailed; m_stashResult = result ? StashUnchanged : StashFailed;
} else if (msgBox.clickedButton() == stashAndPopButton) { } 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) void GitClient::StashInfo::executeStash(const QString &command, QString *errorMessage)
{ {
m_message = creatorStashMessage(command); 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; m_stashResult = StashFailed;
else else
m_stashResult = Stashed; m_stashResult = Stashed;
@@ -3570,12 +3577,12 @@ void GitClient::StashInfo::end()
{ {
if (m_stashResult == Stashed) { if (m_stashResult == Stashed) {
QString stashName; QString stashName;
if (GitPlugin::client()->stashNameFromMessage(m_workingDir, m_message, &stashName)) if (m_instance->stashNameFromMessage(m_workingDir, m_message, &stashName))
GitPlugin::client()->stashPop(m_workingDir, stashName); m_instance->stashPop(m_workingDir, stashName);
} }
if (m_pushAction == NormalPush) if (m_pushAction == NormalPush)
GitPlugin::client()->push(m_workingDir); m_instance->push(m_workingDir);
else if (m_pushAction == PushToGerrit) else if (m_pushAction == PushToGerrit)
GitPlugin::gerritPush(m_workingDir); GitPlugin::gerritPush(m_workingDir);
@@ -3589,6 +3596,55 @@ GitRemote::GitRemote(const QString &location) : Core::IVersionControl::RepoUrl(l
isValid = QDir(path).exists() || QDir(path + ".git").exists(); 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 Internal
} // namespace Git } // namespace Git

View File

@@ -139,6 +139,7 @@ public:
}; };
explicit GitClient(GitSettings *settings); explicit GitClient(GitSettings *settings);
static GitClient *instance();
Utils::FilePath vcsBinary() const override; Utils::FilePath vcsBinary() const override;
unsigned gitVersion(QString *errorMessage = nullptr) const; unsigned gitVersion(QString *errorMessage = nullptr) const;
@@ -352,6 +353,9 @@ public:
VcsBase::VcsCommand *asyncUpstreamStatus(const QString &workingDirectory, VcsBase::VcsCommand *asyncUpstreamStatus(const QString &workingDirectory,
const QString &branch, const QString &upstream); const QString &branch, const QString &upstream);
static void addChangeActions(QMenu *menu, const QString &workingDir, const QString &change);
private: private:
void finishSubmoduleUpdate(); void finishSubmoduleUpdate();
void chunkActionsRequested(QMenu *menu, int fileIndex, int chunkIndex, void chunkActionsRequested(QMenu *menu, int fileIndex, int chunkIndex,

View File

@@ -152,7 +152,7 @@ static QString sanitizeBlameOutput(const QString &b)
if (b.isEmpty()) if (b.isEmpty())
return b; return b;
const bool omitDate = GitPlugin::client()->settings().boolValue( const bool omitDate = GitClient::instance()->settings().boolValue(
GitSettings::omitAnnotationDateKey); GitSettings::omitAnnotationDateKey);
const QChar space(' '); const QChar space(' ');
const int parenPos = b.indexOf(')'); const int parenPos = b.indexOf(')');
@@ -216,12 +216,6 @@ void GitEditorWidget::setPlainText(const QString &text)
textDocument()->setPlainText(modText); 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) void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
{ {
Utils::TemporaryFile patchFile("git-apply-chunk"); Utils::TemporaryFile patchFile("git-apply-chunk");
@@ -237,7 +231,7 @@ void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
if (revert) if (revert)
args << "--reverse"; args << "--reverse";
QString errorMessage; QString errorMessage;
if (GitPlugin::client()->synchronousApplyPatch(baseDir, patchFile.fileName(), &errorMessage, args)) { if (GitClient::instance()->synchronousApplyPatch(baseDir, patchFile.fileName(), &errorMessage, args)) {
if (errorMessage.isEmpty()) if (errorMessage.isEmpty())
VcsOutputWindow::append(tr("Chunk successfully staged")); VcsOutputWindow::append(tr("Chunk successfully staged"));
else else
@@ -286,14 +280,14 @@ void GitEditorWidget::aboutToOpen(const QString &fileName, const QString &realFi
const QString gitPath = fi.absolutePath(); const QString gitPath = fi.absolutePath();
setSource(gitPath); setSource(gitPath);
textDocument()->setCodec( textDocument()->setCodec(
GitPlugin::client()->encoding(gitPath, "i18n.commitEncoding")); GitClient::instance()->encoding(gitPath, "i18n.commitEncoding"));
} }
} }
QString GitEditorWidget::decorateVersion(const QString &revision) const QString GitEditorWidget::decorateVersion(const QString &revision) const
{ {
// Format verbose, SHA1 being first token // 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 QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision) const
@@ -301,8 +295,8 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision)
QStringList revisions; QStringList revisions;
QString errorMessage; QString errorMessage;
// Get the SHA1's of the file. // Get the SHA1's of the file.
if (!GitPlugin::client()->synchronousParentRevisions(sourceWorkingDirectory(), if (!GitClient::instance()->synchronousParentRevisions(
revision, &revisions, &errorMessage)) { sourceWorkingDirectory(), revision, &revisions, &errorMessage)) {
VcsOutputWindow::appendSilently(errorMessage); VcsOutputWindow::appendSilently(errorMessage);
return QStringList(); return QStringList();
} }
@@ -311,56 +305,13 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision)
bool GitEditorWidget::isValidRevision(const QString &revision) const 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) void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change)
{ {
m_currentChange = change; if (contentType() != OtherContent)
if (contentType() == OtherContent) GitClient::addChangeActions(menu, change, sourceWorkingDirectory());
return;
menu->addAction(tr("Cherr&y-Pick Change %1").arg(change), this, [this] {
GitPlugin::client()->synchronousCherryPick(sourceWorkingDirectory(), m_currentChange);
});
menu->addAction(tr("Re&vert Change %1").arg(change), this, [this] {
GitPlugin::client()->synchronousRevert(sourceWorkingDirectory(), m_currentChange);
});
menu->addAction(tr("C&heckout Change %1").arg(change), this, [this] {
GitPlugin::client()->checkout(sourceWorkingDirectory(), m_currentChange);
});
connect(menu->addAction(tr("&Interactive Rebase from Change %1...").arg(change)),
&QAction::triggered, this, [this] {
GitPlugin::startRebaseFromCommit(sourceWorkingDirectory(), m_currentChange);
});
menu->addAction(tr("&Log for Change %1").arg(change), this, [this] {
GitPlugin::client()->log(sourceWorkingDirectory(), QString(), false, {m_currentChange});
});
menu->addAction(tr("Add &Tag for Change %1...").arg(change), this, [this] {
QString output;
QString errorMessage;
GitPlugin::client()->synchronousTagCmd(sourceWorkingDirectory(), QStringList(),
&output, &errorMessage);
const QStringList tags = output.split('\n');
BranchAddDialog dialog(tags, BranchAddDialog::Type::AddTag, Core::ICore::dialogParent());
if (dialog.exec() == QDialog::Rejected)
return;
GitPlugin::client()->synchronousTagCmd(sourceWorkingDirectory(),
{dialog.branchName(), m_currentChange},
&output, &errorMessage);
VcsOutputWindow::append(output);
if (!errorMessage.isEmpty())
VcsOutputWindow::append(errorMessage, VcsOutputWindow::MessageStyle::Error);
});
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"); });
menu->addMenu(resetMenu);
} }
QString GitEditorWidget::revisionSubject(const QTextBlock &inBlock) const QString GitEditorWidget::revisionSubject(const QTextBlock &inBlock) const

View File

@@ -58,7 +58,6 @@ private:
void applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert); void applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert);
void init() override; void init() override;
void resetChange(const QByteArray &resetType);
void addDiffActions(QMenu *menu, const VcsBase::DiffChunk &chunk) override; void addDiffActions(QMenu *menu, const VcsBase::DiffChunk &chunk) override;
void aboutToOpen(const QString &fileName, const QString &realFileName) override; void aboutToOpen(const QString &fileName, const QString &realFileName) override;
QString changeUnderCursor(const QTextCursor &) const override; QString changeUnderCursor(const QTextCursor &) const override;
@@ -73,7 +72,6 @@ private:
QString sourceWorkingDirectory() const; QString sourceWorkingDirectory() const;
mutable QRegExp m_changeNumberPattern; mutable QRegExp m_changeNumberPattern;
QString m_currentChange;
GitLogFilterWidget *m_logFilterWidget = nullptr; GitLogFilterWidget *m_logFilterWidget = nullptr;
}; };

View File

@@ -26,7 +26,6 @@
#include "gitgrep.h" #include "gitgrep.h"
#include "gitclient.h" #include "gitclient.h"
#include "gitconstants.h" #include "gitconstants.h"
#include "gitplugin.h"
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
@@ -187,7 +186,7 @@ public:
return QString(":!" + filter); return QString(":!" + filter);
}); });
arguments << "--" << filterArgs << exclusionArgs; arguments << "--" << filterArgs << exclusionArgs;
QScopedPointer<VcsCommand> command(GitPlugin::client()->createCommand(m_directory)); QScopedPointer<VcsCommand> command(GitClient::instance()->createCommand(m_directory));
command->addFlags(VcsCommand::SilentOutput | VcsCommand::SuppressFailMessage); command->addFlags(VcsCommand::SilentOutput | VcsCommand::SuppressFailMessage);
command->setProgressiveOutput(true); command->setProgressiveOutput(true);
QFutureWatcher<FileSearchResultList> watcher; QFutureWatcher<FileSearchResultList> watcher;
@@ -195,7 +194,7 @@ public:
connect(&watcher, &QFutureWatcher<FileSearchResultList>::canceled, connect(&watcher, &QFutureWatcher<FileSearchResultList>::canceled,
command.data(), &VcsCommand::cancel); command.data(), &VcsCommand::cancel);
connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read); 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) { switch (resp.result) {
case SynchronousProcessResponse::TerminatedAbnormally: case SynchronousProcessResponse::TerminatedAbnormally:
case SynchronousProcessResponse::StartFailed: case SynchronousProcessResponse::StartFailed:

View File

@@ -1760,11 +1760,11 @@ void GitPluginPrivate::updateCurrentBranch()
QObject *GitPlugin::remoteCommand(const QStringList &options, const QString &workingDirectory, QObject *GitPlugin::remoteCommand(const QStringList &options, const QString &workingDirectory,
const QStringList &) const QStringList &)
{ {
if (!GitPlugin::client() || options.size() < 2) if (options.size() < 2)
return nullptr; return nullptr;
if (options.first() == "-git-show") if (options.first() == "-git-show")
GitPlugin::client()->show(workingDirectory, options.at(1)); dd->m_gitClient.show(workingDirectory, options.at(1));
return nullptr; return nullptr;
} }

View File

@@ -88,8 +88,8 @@ CommitDataFetchResult CommitDataFetchResult::fetch(CommitType commitType, const
CommitDataFetchResult result; CommitDataFetchResult result;
result.commitData.commitType = commitType; result.commitData.commitType = commitType;
QString commitTemplate; QString commitTemplate;
result.success = GitPlugin::client()->getCommitData(workingDirectory, &commitTemplate, result.success = GitClient::instance()->getCommitData(
result.commitData, &result.errorMessage); workingDirectory, &commitTemplate, result.commitData, &result.errorMessage);
return result; return result;
} }
@@ -202,15 +202,15 @@ void GitSubmitEditor::slotDiffSelected(const QList<int> &rows)
} }
} }
if (!unstagedFiles.empty() || !stagedFiles.empty()) if (!unstagedFiles.empty() || !stagedFiles.empty())
GitPlugin::client()->diffFiles(m_workingDirectory, unstagedFiles, stagedFiles); GitClient::instance()->diffFiles(m_workingDirectory, unstagedFiles, stagedFiles);
if (!unmergedFiles.empty()) if (!unmergedFiles.empty())
GitPlugin::client()->merge(m_workingDirectory, unmergedFiles); GitClient::instance()->merge(m_workingDirectory, unmergedFiles);
} }
void GitSubmitEditor::showCommit(const QString &commit) void GitSubmitEditor::showCommit(const QString &commit)
{ {
if (!m_workingDirectory.isEmpty()) if (!m_workingDirectory.isEmpty())
GitPlugin::client()->show(m_workingDirectory, commit); GitClient::instance()->show(m_workingDirectory, commit);
} }
void GitSubmitEditor::updateFileModel() void GitSubmitEditor::updateFileModel()
@@ -230,7 +230,7 @@ void GitSubmitEditor::updateFileModel()
Core::ProgressManager::addTask(m_fetchWatcher.future(), tr("Refreshing Commit Data"), Core::ProgressManager::addTask(m_fetchWatcher.future(), tr("Refreshing Commit Data"),
TASK_UPDATE_COMMIT); TASK_UPDATE_COMMIT);
GitPlugin::client()->addFuture(m_fetchWatcher.future()); GitClient::instance()->addFuture(m_fetchWatcher.future());
} }
void GitSubmitEditor::forceUpdateFileModel() void GitSubmitEditor::forceUpdateFileModel()

View File

@@ -24,7 +24,6 @@
****************************************************************************/ ****************************************************************************/
#include "logchangedialog.h" #include "logchangedialog.h"
#include "gitplugin.h"
#include "gitclient.h" #include "gitclient.h"
#include <vcsbase/vcsoutputwindow.h> #include <vcsbase/vcsoutputwindow.h>
@@ -79,7 +78,7 @@ bool LogChangeWidget::init(const QString &repository, const QString &commit, Log
return true; return true;
if (!(flags & Silent)) { if (!(flags & Silent)) {
VcsOutputWindow::appendError( VcsOutputWindow::appendError(
GitPlugin::client()->msgNoCommits(flags & IncludeRemotes)); GitClient::instance()->msgNoCommits(flags & IncludeRemotes));
} }
return false; return false;
} }
@@ -159,8 +158,10 @@ bool LogChangeWidget::populateLog(const QString &repository, const QString &comm
arguments << "--not" << "--remotes"; arguments << "--not" << "--remotes";
arguments << "--"; arguments << "--";
QString output; QString output;
if (!GitPlugin::client()->synchronousLog(repository, arguments, &output, nullptr, VcsCommand::NoOutput)) if (!GitClient::instance()->synchronousLog(
repository, arguments, &output, nullptr, VcsCommand::NoOutput)) {
return false; return false;
}
const QStringList lines = output.split('\n'); const QStringList lines = output.split('\n');
for (const QString &line : lines) { for (const QString &line : lines) {
const int colonPos = line.indexOf(':'); 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("Hard"), "--hard");
m_resetTypeComboBox->addItem(tr("Mixed"), "--mixed"); m_resetTypeComboBox->addItem(tr("Mixed"), "--mixed");
m_resetTypeComboBox->addItem(tr("Soft"), "--soft"); m_resetTypeComboBox->addItem(tr("Soft"), "--soft");
m_resetTypeComboBox->setCurrentIndex(GitPlugin::client()->settings().intValue( m_resetTypeComboBox->setCurrentIndex(
GitSettings::lastResetIndexKey)); GitClient::instance()->settings().intValue(GitSettings::lastResetIndexKey));
popUpLayout->addWidget(m_resetTypeComboBox); popUpLayout->addWidget(m_resetTypeComboBox);
popUpLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); 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 (QDialog::exec() == QDialog::Accepted) {
if (m_resetTypeComboBox) { if (m_resetTypeComboBox) {
GitPlugin::client()->settings().setValue(GitSettings::lastResetIndexKey, GitClient::instance()->settings().setValue(
m_resetTypeComboBox->currentIndex()); GitSettings::lastResetIndexKey, m_resetTypeComboBox->currentIndex());
} }
return true; return true;
} }

View File

@@ -60,7 +60,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
m_process->setWorkingDirectory(workingDirectory); m_process->setWorkingDirectory(workingDirectory);
m_process->setProcessEnvironment(env); m_process->setProcessEnvironment(env);
m_process->setProcessChannelMode(QProcess::MergedChannels); m_process->setProcessChannelMode(QProcess::MergedChannels);
const Utils::FilePath binary = GitPlugin::client()->vcsBinary(); const Utils::FilePath binary = GitClient::instance()->vcsBinary();
VcsOutputWindow::appendCommand(workingDirectory, {binary, arguments}); VcsOutputWindow::appendCommand(workingDirectory, {binary, arguments});
m_process->start(binary.toString(), arguments); m_process->start(binary.toString(), arguments);
if (m_process->waitForStarted()) { if (m_process->waitForStarted()) {
@@ -263,7 +263,7 @@ void MergeTool::done()
VcsOutputWindow::appendError(tr("Merge tool process terminated with exit code %1") VcsOutputWindow::appendError(tr("Merge tool process terminated with exit code %1")
.arg(exitCode)); .arg(exitCode));
} }
GitPlugin::client()->continueCommandIfNeeded(workingDirectory, exitCode == 0); GitClient::instance()->continueCommandIfNeeded(workingDirectory, exitCode == 0);
GitPlugin::emitRepositoryChanged(workingDirectory); GitPlugin::emitRepositoryChanged(workingDirectory);
deleteLater(); deleteLater();
} }

View File

@@ -203,7 +203,7 @@ void RemoteDialog::pushToRemote()
const int row = indexList.at(0).row(); const int row = indexList.at(0).row();
const QString remoteName = m_remoteModel->remoteName(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() void RemoteDialog::fetchFromRemote()
@@ -214,7 +214,7 @@ void RemoteDialog::fetchFromRemote()
int row = indexList.at(0).row(); int row = indexList.at(0).row();
const QString remoteName = m_remoteModel->remoteName(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() void RemoteDialog::updateButtonState()

View File

@@ -24,7 +24,6 @@
****************************************************************************/ ****************************************************************************/
#include "remotemodel.h" #include "remotemodel.h"
#include "gitplugin.h"
#include "gitclient.h" #include "gitclient.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
@@ -55,7 +54,7 @@ bool RemoteModel::removeRemote(int row)
{ {
QString output; QString output;
QString error; QString error;
bool success = GitPlugin::client()->synchronousRemoteCmd( bool success = GitClient::instance()->synchronousRemoteCmd(
m_workingDirectory, {"rm", remoteName(row)}, &output, &error); m_workingDirectory, {"rm", remoteName(row)}, &output, &error);
if (success) if (success)
success = refresh(m_workingDirectory, &error); success = refresh(m_workingDirectory, &error);
@@ -69,7 +68,7 @@ bool RemoteModel::addRemote(const QString &name, const QString &url)
if (name.isEmpty() || url.isEmpty()) if (name.isEmpty() || url.isEmpty())
return false; return false;
bool success = GitPlugin::client()->synchronousRemoteCmd( bool success = GitClient::instance()->synchronousRemoteCmd(
m_workingDirectory, {"add", name, url}, &output, &error); m_workingDirectory, {"add", name, url}, &output, &error);
if (success) if (success)
success = refresh(m_workingDirectory, &error); success = refresh(m_workingDirectory, &error);
@@ -80,7 +79,7 @@ bool RemoteModel::renameRemote(const QString &oldName, const QString &newName)
{ {
QString output; QString output;
QString error; QString error;
bool success = GitPlugin::client()->synchronousRemoteCmd( bool success = GitClient::instance()->synchronousRemoteCmd(
m_workingDirectory, {"rename", oldName, newName}, &output, &error); m_workingDirectory, {"rename", oldName, newName}, &output, &error);
if (success) if (success)
success = refresh(m_workingDirectory, &error); success = refresh(m_workingDirectory, &error);
@@ -91,7 +90,7 @@ bool RemoteModel::updateUrl(const QString &name, const QString &newUrl)
{ {
QString output; QString output;
QString error; QString error;
bool success = GitPlugin::client()->synchronousRemoteCmd( bool success = GitClient::instance()->synchronousRemoteCmd(
m_workingDirectory, {"set-url", name, newUrl}, &output, &error); m_workingDirectory, {"set-url", name, newUrl}, &output, &error);
if (success) if (success)
success = refresh(m_workingDirectory, &error); success = refresh(m_workingDirectory, &error);
@@ -186,7 +185,7 @@ bool RemoteModel::refresh(const QString &workingDirectory, QString *errorMessage
// get list of remotes. // get list of remotes.
QMap<QString,QString> remotesList QMap<QString,QString> remotesList
= GitPlugin::client()->synchronousRemotesList(workingDirectory, errorMessage); = GitClient::instance()->synchronousRemotesList(workingDirectory, errorMessage);
beginResetModel(); beginResetModel();
m_remotes.clear(); m_remotes.clear();

View File

@@ -161,7 +161,7 @@ void StashDialog::refresh(const QString &repository, bool force)
m_model->setStashes(QList<Stash>()); m_model->setStashes(QList<Stash>());
} else { } else {
QList<Stash> stashes; QList<Stash> stashes;
GitPlugin::client()->synchronousStashList(m_repository, &stashes); GitClient::instance()->synchronousStashList(m_repository, &stashes);
m_model->setStashes(stashes); m_model->setStashes(stashes);
if (!stashes.isEmpty()) { if (!stashes.isEmpty()) {
for (int c = 0; c < ColumnCount; c++) 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?"))) if (!ask(title, tr("Do you want to delete all stashes?")))
return; return;
QString errorMessage; QString errorMessage;
if (GitPlugin::client()->synchronousStashRemove(m_repository, QString(), &errorMessage)) if (GitClient::instance()->synchronousStashRemove(m_repository, QString(), &errorMessage))
refresh(m_repository, true); refresh(m_repository, true);
else else
warning(title, errorMessage); warning(title, errorMessage);
@@ -194,7 +194,7 @@ void StashDialog::deleteSelection()
QStringList errors; QStringList errors;
// Delete in reverse order as stashes rotate // Delete in reverse order as stashes rotate
for (int r = rows.size() - 1; r >= 0; r--) 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); errors.push_back(errorMessage);
refresh(m_repository, true); refresh(m_repository, true);
if (!errors.isEmpty()) if (!errors.isEmpty())
@@ -205,7 +205,7 @@ void StashDialog::showCurrent()
{ {
const int index = currentRow(); const int index = currentRow();
QTC_ASSERT(index >= 0, return); 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' // Suggest Branch name to restore 'stash@{0}' -> 'stash0-date'
@@ -266,7 +266,8 @@ bool StashDialog::promptForRestore(QString *stash,
{ {
const QString stashIn = *stash; const QString stashIn = *stash;
bool modifiedPromptShown = false; 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: case GitClient::StatusFailed:
return false; return false;
case GitClient::StatusChanged: { case GitClient::StatusChanged: {
@@ -274,13 +275,15 @@ bool StashDialog::promptForRestore(QString *stash,
case ModifiedRepositoryCancel: case ModifiedRepositoryCancel:
return false; return false;
case ModifiedRepositoryStash: case ModifiedRepositoryStash:
if (GitPlugin::client()->synchronousStash(m_repository, QString(), GitClient::StashPromptDescription).isEmpty()) if (GitClient::instance()->synchronousStash(
m_repository, QString(), GitClient::StashPromptDescription).isEmpty()) {
return false; return false;
}
*stash = nextStash(*stash); // Our stash id to be restored changed *stash = nextStash(*stash); // Our stash id to be restored changed
QTC_ASSERT(!stash->isEmpty(), return false); QTC_ASSERT(!stash->isEmpty(), return false);
break; break;
case ModifiedRepositoryDiscard: case ModifiedRepositoryDiscard:
if (!GitPlugin::client()->synchronousReset(m_repository)) if (!GitClient::instance()->synchronousReset(m_repository))
return false; return false;
break; break;
} }
@@ -317,7 +320,7 @@ void StashDialog::restoreCurrent()
// Make sure repository is not modified, restore. The command will // Make sure repository is not modified, restore. The command will
// output to window on success. // output to window on success.
if (promptForRestore(&name, nullptr, &errorMessage) 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. refresh(m_repository, true); // Might have stashed away local changes.
} else if (!errorMessage.isEmpty()) { } else if (!errorMessage.isEmpty()) {
warning(msgRestoreFailedTitle(name), errorMessage); warning(msgRestoreFailedTitle(name), errorMessage);
@@ -332,7 +335,7 @@ void StashDialog::restoreCurrentInBranch()
QString branch; QString branch;
QString name = m_model->at(index).name; QString name = m_model->at(index).name;
if (promptForRestore(&name, &branch, &errorMessage) 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. refresh(m_repository, true); // git deletes the stash, unfortunately.
} else if (!errorMessage.isEmpty()) { } else if (!errorMessage.isEmpty()) {
warning(msgRestoreFailedTitle(name), errorMessage); warning(msgRestoreFailedTitle(name), errorMessage);

View File

@@ -1,5 +1,5 @@
add_qtc_plugin(LanguageClient add_qtc_plugin(LanguageClient
DEPENDS LanguageServerProtocol Qt5::Core PUBLIC_DEPENDS LanguageServerProtocol Qt5::Core
PLUGIN_DEPENDS ProjectExplorer Core TextEditor PLUGIN_DEPENDS ProjectExplorer Core TextEditor
SOURCES SOURCES
client.cpp client.h client.cpp client.h

View File

@@ -35,6 +35,7 @@
#include <texteditor/codeassist/genericproposal.h> #include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/genericproposalmodel.h> #include <texteditor/codeassist/genericproposalmodel.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/executeondestruction.h>
#include <utils/textutils.h> #include <utils/textutils.h>
#include <utils/utilsicons.h> #include <utils/utilsicons.h>
@@ -361,6 +362,9 @@ void LanguageClientCompletionAssistProcessor::cancel()
void LanguageClientCompletionAssistProcessor::handleCompletionResponse( void LanguageClientCompletionAssistProcessor::handleCompletionResponse(
const CompletionRequest::Response &response) 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"; qCDebug(LOGLSPCOMPLETION) << QTime::currentTime() << " : got completions";
m_currentRequest = MessageId(); m_currentRequest = MessageId();
QTC_ASSERT(m_client, return); QTC_ASSERT(m_client, return);
@@ -383,12 +387,11 @@ void LanguageClientCompletionAssistProcessor::handleCompletionResponse(
model->loadContent(Utils::transform(items, [](const CompletionItem &item){ model->loadContent(Utils::transform(items, [](const CompletionItem &item){
return static_cast<AssistProposalItemInterface *>(new LanguageClientCompletionItem(item)); return static_cast<AssistProposalItemInterface *>(new LanguageClientCompletionItem(item));
})); }));
auto proposal = new LanguageClientCompletionProposal(m_pos, model); proposal = new LanguageClientCompletionProposal(m_pos, model);
proposal->m_document = m_document; proposal->m_document = m_document;
proposal->m_pos = m_pos; proposal->m_pos = m_pos;
proposal->setFragile(true); proposal->setFragile(true);
proposal->setSupportsPrefix(false); proposal->setSupportsPrefix(false);
setAsyncProposalAvailable(proposal);
qCDebug(LOGLSPCOMPLETION) << QTime::currentTime() << " : " qCDebug(LOGLSPCOMPLETION) << QTime::currentTime() << " : "
<< items.count() << " completions handled"; << items.count() << " completions handled";
} }

View File

@@ -58,8 +58,8 @@ public:
setDisplayName(tr("Current Build Target")); setDisplayName(tr("Current Build Target"));
setDefaultDisplayName(tr("Current Build Target")); setDefaultDisplayName(tr("Current Build Target"));
setUpdater([this] { setUpdater([this, target] {
auto buildConfiguration = qobject_cast<NimBuildConfiguration *>(activeBuildConfiguration()); auto buildConfiguration = qobject_cast<NimBuildConfiguration *>(target->activeBuildConfiguration());
QTC_ASSERT(buildConfiguration, return); QTC_ASSERT(buildConfiguration, return);
const QFileInfo outFileInfo = buildConfiguration->outFilePath().toFileInfo(); const QFileInfo outFileInfo = buildConfiguration->outFilePath().toFileInfo();
aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(outFileInfo.absoluteFilePath())); aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(outFileInfo.absoluteFilePath()));

View File

@@ -159,7 +159,7 @@ PerfProfilerTool::PerfProfilerTool()
tracePointsAction->setEnabled(m_startAction->isEnabled()); tracePointsAction->setEnabled(m_startAction->isEnabled());
}); });
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::updateRunActions, connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated,
this, &PerfProfilerTool::updateRunActions); this, &PerfProfilerTool::updateRunActions);
m_recordButton = new QToolButton; m_recordButton = new QToolButton;

View File

@@ -779,7 +779,7 @@ void AppOutputPane::slotRunControlFinished2(RunControl *sender)
if (current && current == sender) if (current && current == sender)
enableButtons(current); enableButtons(current);
emit ProjectExplorerPlugin::instance()->updateRunActions(); ProjectExplorerPlugin::updateRunActions();
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
const bool isRunning = Utils::anyOf(m_runControlTabs, [](const RunControlTab &rt) { const bool isRunning = Utils::anyOf(m_runControlTabs, [](const RunControlTab &rt) {

View File

@@ -183,7 +183,7 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id)
connect(this, &BuildConfiguration::enabledChanged, this, [this] { connect(this, &BuildConfiguration::enabledChanged, this, [this] {
if (isActive() && project() == SessionManager::startupProject()) { if (isActive() && project() == SessionManager::startupProject()) {
ProjectExplorerPlugin::updateActions(); ProjectExplorerPlugin::updateActions();
emit ProjectExplorerPlugin::instance()->updateRunActions(); ProjectExplorerPlugin::updateRunActions();
} }
}); });
} }

View File

@@ -265,9 +265,6 @@ BuildManager::BuildManager(QObject *parent, QAction *cancelBuildAction)
connect(d->m_taskWindow, &Internal::TaskWindow::tasksChanged, connect(d->m_taskWindow, &Internal::TaskWindow::tasksChanged,
this, &BuildManager::updateTaskCount); this, &BuildManager::updateTaskCount);
connect(d->m_taskWindow, &Internal::TaskWindow::tasksCleared,
this,&BuildManager::tasksCleared);
connect(&d->m_progressWatcher, &QFutureWatcherBase::canceled, connect(&d->m_progressWatcher, &QFutureWatcherBase::canceled,
this, &BuildManager::cancel); this, &BuildManager::cancel);
connect(&d->m_progressWatcher, &QFutureWatcherBase::finished, connect(&d->m_progressWatcher, &QFutureWatcherBase::finished,
@@ -457,7 +454,6 @@ void BuildManager::updateTaskCount()
{ {
const int errors = getErrorTaskCount(); const int errors = getErrorTaskCount();
ProgressManager::setApplicationLabel(errors > 0 ? QString::number(errors) : QString()); ProgressManager::setApplicationLabel(errors > 0 ? QString::number(errors) : QString());
emit m_instance->tasksChanged();
} }
void BuildManager::finish() void BuildManager::finish()

View File

@@ -102,9 +102,6 @@ public slots:
signals: signals:
void buildStateChanged(ProjectExplorer::Project *pro); void buildStateChanged(ProjectExplorer::Project *pro);
void buildQueueFinished(bool success); void buildQueueFinished(bool success);
void tasksChanged();
void taskAdded(const ProjectExplorer::Task &task);
void tasksCleared();
private: private:
static void addToTaskWindow(const ProjectExplorer::Task &task, int linkedOutputLines, int skipLines); static void addToTaskWindow(const ProjectExplorer::Task &task, int linkedOutputLines, int skipLines);

View File

@@ -316,7 +316,7 @@ void BuildSystem::emitBuildSystemUpdated()
QString BuildSystem::disabledReason(const QString &buildKey) const QString BuildSystem::disabledReason(const QString &buildKey) const
{ {
if (hasParsingData()) { if (!hasParsingData()) {
QString msg = isParsing() ? tr("The project is currently being parsed.") QString msg = isParsing() ? tr("The project is currently being parsed.")
: tr("The project could not be fully parsed."); : tr("The project could not be fully parsed.");
const FilePath projectFilePath = buildTarget(buildKey).projectFilePath; const FilePath projectFilePath = buildTarget(buildKey).projectFilePath;

View File

@@ -2053,6 +2053,7 @@ Utils::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils:
} }
if (Utils::HostOsInfo::isWindowsHost()) if (Utils::HostOsInfo::isWindowsHost())
saver.write("chcp 65001\r\n"); saver.write("chcp 65001\r\n");
saver.write("set VSCMD_SKIP_SENDTELEMETRY=1\r\n");
saver.write(call + "\r\n"); saver.write(call + "\r\n");
saver.write("@echo " + marker.toLocal8Bit() + "\r\n"); saver.write("@echo " + marker.toLocal8Bit() + "\r\n");
saver.write("set\r\n"); saver.write("set\r\n");

View File

@@ -453,7 +453,7 @@ public:
void activeRunConfigurationChanged(); void activeRunConfigurationChanged();
void activeBuildConfigurationChanged(); void activeBuildConfigurationChanged();
void slotUpdateRunActions(); void doUpdateRunActions();
void currentModeChanged(Core::Id mode, Core::Id oldMode); void currentModeChanged(Core::Id mode, Core::Id oldMode);
@@ -1714,8 +1714,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(dd->m_projectTreeExpandAllAction, &QAction::triggered, connect(dd->m_projectTreeExpandAllAction, &QAction::triggered,
ProjectTree::instance(), &ProjectTree::expandAll); ProjectTree::instance(), &ProjectTree::expandAll);
connect(this, &ProjectExplorerPlugin::updateRunActions,
dd, &ProjectExplorerPluginPrivate::slotUpdateRunActions);
connect(this, &ProjectExplorerPlugin::settingsChanged, connect(this, &ProjectExplorerPlugin::settingsChanged,
dd, &ProjectExplorerPluginPrivate::updateRunWithoutDeployMenu); dd, &ProjectExplorerPluginPrivate::updateRunWithoutDeployMenu);
@@ -2483,7 +2481,7 @@ void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl)
Qt::QueuedConnection); Qt::QueuedConnection);
++m_activeRunControlCount; ++m_activeRunControlCount;
runControl->initiateStart(); runControl->initiateStart();
emit m_instance->updateRunActions(); doUpdateRunActions();
} }
void ProjectExplorerPluginPrivate::showOutputPaneForRunControl(RunControl *runControl) void ProjectExplorerPluginPrivate::showOutputPaneForRunControl(RunControl *runControl)
@@ -2540,7 +2538,7 @@ void ProjectExplorerPluginPrivate::buildQueueFinished(bool success)
m_delayedRunConfiguration = nullptr; m_delayedRunConfiguration = nullptr;
m_shouldHaveRunConfiguration = false; m_shouldHaveRunConfiguration = false;
m_runMode = Constants::NO_RUN_MODE; m_runMode = Constants::NO_RUN_MODE;
emit m_instance->updateRunActions(); doUpdateRunActions();
} }
QList<QPair<QString, QString> > ProjectExplorerPluginPrivate::recentProjects() const QList<QPair<QString, QString> > ProjectExplorerPluginPrivate::recentProjects() const
@@ -2903,7 +2901,8 @@ void ProjectExplorerPlugin::runRunConfiguration(RunConfiguration *rc,
dd->executeRunConfiguration(rc, runMode); dd->executeRunConfiguration(rc, runMode);
break; break;
} }
emit m_instance->updateRunActions();
dd->doUpdateRunActions();
} }
QList<QPair<Runnable, Utils::ProcessHandle>> ProjectExplorerPlugin::runningRunControlProcesses() QList<QPair<Runnable, Utils::ProcessHandle>> ProjectExplorerPlugin::runningRunControlProcesses()
@@ -3001,7 +3000,7 @@ void ProjectExplorerPluginPrivate::activeRunConfigurationChanged()
if (rc == previousRunConfiguration) if (rc == previousRunConfiguration)
return; return;
updateActions(); updateActions();
emit m_instance->updateRunActions(); doUpdateRunActions();
} }
void ProjectExplorerPluginPrivate::activeBuildConfigurationChanged() void ProjectExplorerPluginPrivate::activeBuildConfigurationChanged()
@@ -3015,7 +3014,7 @@ void ProjectExplorerPluginPrivate::activeBuildConfigurationChanged()
return; return;
updateActions(); updateActions();
emit m_instance->updateRunActions(); doUpdateRunActions();
} }
void ProjectExplorerPluginPrivate::updateDeployActions() void ProjectExplorerPluginPrivate::updateDeployActions()
@@ -3064,7 +3063,7 @@ void ProjectExplorerPluginPrivate::updateDeployActions()
enableDeploySessionAction = false; enableDeploySessionAction = false;
m_deploySessionAction->setEnabled(enableDeploySessionAction); m_deploySessionAction->setEnabled(enableDeploySessionAction);
emit m_instance->updateRunActions(); doUpdateRunActions();
} }
bool ProjectExplorerPlugin::canRunStartupProject(Core::Id runMode, QString *whyNot) bool ProjectExplorerPlugin::canRunStartupProject(Core::Id runMode, QString *whyNot)
@@ -3139,13 +3138,15 @@ bool ProjectExplorerPlugin::canRunStartupProject(Core::Id runMode, QString *whyN
return true; return true;
} }
void ProjectExplorerPluginPrivate::slotUpdateRunActions() void ProjectExplorerPluginPrivate::doUpdateRunActions()
{ {
QString whyNot; QString whyNot;
const bool state = ProjectExplorerPlugin::canRunStartupProject(Constants::NORMAL_RUN_MODE, &whyNot); const bool state = ProjectExplorerPlugin::canRunStartupProject(Constants::NORMAL_RUN_MODE, &whyNot);
m_runAction->setEnabled(state); m_runAction->setEnabled(state);
m_runAction->setToolTip(whyNot); m_runAction->setToolTip(whyNot);
m_runWithoutDeployAction->setEnabled(state); m_runWithoutDeployAction->setEnabled(state);
emit m_instance->runActionsUpdated();
} }
void ProjectExplorerPluginPrivate::addToRecentProjects(const QString &fileName, const QString &displayName) void ProjectExplorerPluginPrivate::addToRecentProjects(const QString &fileName, const QString &displayName)
@@ -4002,6 +4003,11 @@ void ProjectExplorerPlugin::removeFromRecentProjects(const QString &fileName,
dd->removeFromRecentProjects(fileName, displayName); dd->removeFromRecentProjects(fileName, displayName);
} }
void ProjectExplorerPlugin::updateRunActions()
{
dd->doUpdateRunActions();
}
QList<QPair<QString, QString> > ProjectExplorerPlugin::recentProjects() QList<QPair<QString, QString> > ProjectExplorerPlugin::recentProjects()
{ {
return dd->recentProjects(); return dd->recentProjects();

View File

@@ -182,6 +182,8 @@ public:
static void clearRecentProjects(); static void clearRecentProjects();
static void removeFromRecentProjects(const QString &fileName, const QString &displayName); static void removeFromRecentProjects(const QString &fileName, const QString &displayName);
static void updateRunActions();
signals: signals:
void finishedInitialization(); void finishedInitialization();
@@ -193,7 +195,7 @@ signals:
void settingsChanged(); void settingsChanged();
void updateRunActions(); void runActionsUpdated();
private: private:
static bool coreAboutToClose(); static bool coreAboutToClose();

View File

@@ -203,11 +203,6 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id)
RunConfiguration::~RunConfiguration() = default; RunConfiguration::~RunConfiguration() = default;
bool RunConfiguration::isActive() const
{
return target()->isActive() && target()->activeRunConfiguration() == this;
}
QString RunConfiguration::disabledReason() const QString RunConfiguration::disabledReason() const
{ {
BuildSystem *bs = activeBuildSystem(); BuildSystem *bs = activeBuildSystem();
@@ -252,11 +247,6 @@ QMap<Core::Id, QVariantMap> RunConfiguration::aspectData() const
return data; return data;
} }
BuildConfiguration *RunConfiguration::activeBuildConfiguration() const
{
return target()->activeBuildConfiguration();
}
BuildSystem *RunConfiguration::activeBuildSystem() const BuildSystem *RunConfiguration::activeBuildSystem() const
{ {
return target()->buildSystem(); return target()->buildSystem();
@@ -304,8 +294,10 @@ void RunConfiguration::update()
emit enabledChanged(); emit enabledChanged();
if (isActive() && project() == SessionManager::startupProject()) const bool isActive = target()->isActive() && target()->activeRunConfiguration() == this;
emit ProjectExplorerPlugin::instance()->updateRunActions();
if (isActive && project() == SessionManager::startupProject())
ProjectExplorerPlugin::updateRunActions();
} }
BuildTargetInfo RunConfiguration::buildTargetInfo() const BuildTargetInfo RunConfiguration::buildTargetInfo() const

View File

@@ -128,8 +128,6 @@ class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
public: public:
~RunConfiguration() override; ~RunConfiguration() override;
bool isActive() const;
virtual QString disabledReason() const; virtual QString disabledReason() const;
virtual bool isEnabled() const; virtual bool isEnabled() const;
@@ -179,8 +177,7 @@ signals:
protected: protected:
RunConfiguration(Target *target, Core::Id id); RunConfiguration(Target *target, Core::Id id);
/// convenience function to get current build configuration. /// convenience function to get current build system. Try to avoid.
BuildConfiguration *activeBuildConfiguration() const;
BuildSystem *activeBuildSystem() const; BuildSystem *activeBuildSystem() const;
using Updater = std::function<void()>; using Updater = std::function<void()>;

View File

@@ -380,7 +380,6 @@ void TaskWindow::clearTasks(Core::Id categoryId)
d->m_model->clearTasks(categoryId); d->m_model->clearTasks(categoryId);
emit tasksChanged(); emit tasksChanged();
emit tasksCleared();
navigateStateChanged(); navigateStateChanged();
} }

View File

@@ -79,7 +79,6 @@ public:
signals: signals:
void tasksChanged(); void tasksChanged();
void tasksCleared();
private: private:
void updateFilter() override; void updateFilter() override;

Some files were not shown because too many files have changed in this diff Show More