Merge "Merge remote-tracking branch 'origin/4.10'"

This commit is contained in:
The Qt Project
2019-06-18 12:36:10 +00:00
136 changed files with 1068 additions and 1067 deletions

View File

@@ -16,6 +16,7 @@ you can check out from the public Git repository. For example:
### Language Client ### Language Client
* Removed `Experimental` flag
* Added option for starting server when needed * Added option for starting server when needed
* Added option for starting one server per project * Added option for starting one server per project
* Added support for `workspace/workspaceFolders` server request * Added support for `workspace/workspaceFolders` server request
@@ -34,7 +35,7 @@ you can check out from the public Git repository. For example:
* Added option for hiding kit settings (QTCREATORBUG-9134) * Added option for hiding kit settings (QTCREATORBUG-9134)
* Added support for drag & drop in Projects tree (QTCREATORBUG-6446) * Added support for drag & drop in Projects tree (QTCREATORBUG-6446)
* Added option for closing files of project when closing project (QTCREATORBUG-22198) * Added option for closing files of project when closing project (QTCREATORBUG-22198)
* Added filtering to `Application Output`, `Compile Output`, and `General Messages` * Added filtering to `Issues`, `Application Output`, `Compile Output`, and `General Messages`
(QTCREATORBUG-16356) (QTCREATORBUG-16356)
* Added `Re-detect` and `Remove All` to compiler settings * Added `Re-detect` and `Remove All` to compiler settings
* Added Locator filter for all files in all project directory trees (`a`) (QTCREATORBUG-19122) * Added Locator filter for all files in all project directory trees (`a`) (QTCREATORBUG-19122)
@@ -59,6 +60,7 @@ you can check out from the public Git repository. For example:
* Added completion of paths in project files (QTCREATORBUG-5915) * Added completion of paths in project files (QTCREATORBUG-5915)
* Added forced `qmake` run on rebuild * Added forced `qmake` run on rebuild
* Fixed building sub-project in case of additional custom make steps (QTCREATORBUG-15794) * Fixed building sub-project in case of additional custom make steps (QTCREATORBUG-15794)
* Fixed missing items from `OBJECTIVE_HEADERS` (QTCREATORBUG-17569)
## CMake Projects ## CMake Projects
@@ -102,9 +104,12 @@ you can check out from the public Git repository. For example:
## QML Support ## QML Support
* Fixed various formatting issues
## Debugging ## Debugging
* Added pretty printer for `QMargin` * Added pretty printer for `QMargin`
* Fixed issues with restoring layout (QTCREATORBUG-21669)
### CDB ### CDB
@@ -120,7 +125,10 @@ you can check out from the public Git repository. For example:
* Added support for `ShapeGradient` (QDS-359) * Added support for `ShapeGradient` (QDS-359)
* Added gradient picker that allows loading and saving of presets * Added gradient picker that allows loading and saving of presets
* Added support for changing properties for multiple items at once (QDS-324)
* Added missing properties for `LineEdit` and `ComboBox`
* Updated properties of `Flickable` * Updated properties of `Flickable`
* Improved handling of errors in state editor (QDS-695)
## Version Control Systems ## Version Control Systems
@@ -191,13 +199,16 @@ Denis Shienkov
Denis Vygovskiy Denis Vygovskiy
Eike Ziller Eike Ziller
Friedemann Kleint Friedemann Kleint
Giuseppe D'Angelo
Haxor Leet Haxor Leet
Henning Gruendl
illiteratecoder illiteratecoder
Ivan Donchevskii Ivan Donchevskii
Ivan Komissarov Ivan Komissarov
Joel Smith Joel Smith
Jörg Bornemann Jörg Bornemann
Kavindra Palaraja Kavindra Palaraja
Leena Miettinen
Luca Carlon Luca Carlon
Marco Bubke Marco Bubke
Martin Haase Martin Haase
@@ -213,5 +224,6 @@ Tim Henning
Tim Jenssen Tim Jenssen
Tobias Hunger Tobias Hunger
Tor Arne Vestbø Tor Arne Vestbø
Uladzislau Paulovich
Ulf Hermann Ulf Hermann
Ville Nummela Ville Nummela

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2019 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.
@@ -93,10 +93,10 @@
\li \l{Using Language Servers} \li \l{Using Language Servers}
The experimental language client provides code completion, The language client provides code completion, highlighting of the
highlighting of the symbol under cursor, and jumping to the symbol symbol under cursor, and jumping to the symbol definition for other
definition for other programming languages besides C++. In addition, programming languages besides C++. In addition, it integrates
it integrates diagnostics from the language server. diagnostics from the language server.
\li \l{Editing MIME Types} \li \l{Editing MIME Types}

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2019 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.
@@ -99,7 +99,7 @@
\section1 Using Locator Filters \section1 Using Locator Filters
The locator enables you to browse not only files, but any items defined by The locator enables you to browse not only files, but any items defined by
\b{locator filters}. By default, the locator contains filters for: \b{locator filters}. The filters that are available depend on the file type:
\list \list
@@ -114,11 +114,11 @@
\li Locating bookmarks (\c {b}). \li Locating bookmarks (\c {b}).
For more information, see \l{Using Bookmarks}. For more information, see \l{Using Bookmarks}.
\li Locating class (\c {c}), enum, and function (m) definitions in your \li Locating class (\c {c}), enum, and function (\c {m}) definitions in
project or anywhere referenced from your project (\c {:}) your project or anywhere referenced from your project (\c {:})
\endif \endif
\li Locating QML methods (m) \li Locating QML methods (\c {m})
\li Locating symbols in the current document (\c {.}) \li Locating symbols in the current document (\c {.})

View File

@@ -39,8 +39,9 @@
\list \list
\li \l{Completing Code}{Code completion} \li \l{Completing Code}{Code completion}
\li Highlighting the symbol under cursor \li Highlighting the symbol under cursor
\li \l{Moving to Symbol Definition or Declaration} \li Navigating in the code by using the \l{Searching with the Locator}
{Moving to the symbol definition} {locator} or \l{Moving to Symbol Definition or Declaration}
{moving to the symbol definition}
\li Inspecting code by viewing the document \li Inspecting code by viewing the document
\l{Viewing Defined Types and Symbols}{outline} \l{Viewing Defined Types and Symbols}{outline}
\li \l{Finding Symbols}{Finding references to symbols} \li \l{Finding Symbols}{Finding references to symbols}
@@ -50,8 +51,10 @@
By providing a client for the language server protocol, \QC can support By providing a client for the language server protocol, \QC can support
the above features for several other programming languages besides C++. the above features for several other programming languages besides C++.
However, the experimental client does not support language servers that However, the client does not support language servers that require special
require special handling. handling.
\section1 Adding MIME Types for Language Servers
\QC uses the \l{https://www.iana.org/assignments/media-types/media-types.xhtml} \QC uses the \l{https://www.iana.org/assignments/media-types/media-types.xhtml}
{MIME type} of the file to determine which language server to request {MIME type} of the file to determine which language server to request
@@ -62,21 +65,11 @@
only sent to the languge server if they are known to be handled by it. For only sent to the languge server if they are known to be handled by it. For
more information about how \QC uses MIME types, see \l {Editing MIME Types}. more information about how \QC uses MIME types, see \l {Editing MIME Types}.
The experimental language service client has been mostly tested with Python. \section1 Specifying Settings for Language Clients
If problems arise when you try some other language, please select
\uicontrol Help > \uicontrol {Report Bug} to report them in the Qt Bug
Tracker. The reports should include \QC console output with the environment
variable \c {QT_LOGGING_RULES=qtc.languageclient.*=true} set.
To use a language server: To use a language server:
\list 1 \list 1
\li Enable the language server client by selecting \uicontrol Help >
\uicontrol {About Plugins} > \uicontrol {Other Languages} >
\uicontrol {Language Client} (or \uicontrol {Qt Creator} >
\uicontrol {About Plugins} > \uicontrol {Other Languages} >
\uicontrol {Language Client} on \macos).
\li Restart \QC to load the language client plugin.
\li Select \uicontrol Tools > \uicontrol Options > \li Select \uicontrol Tools > \uicontrol Options >
\uicontrol {Language Client} (or \uicontrol {Qt Creator} > \uicontrol {Language Client} (or \uicontrol {Qt Creator} >
\uicontrol Preferences > \uicontrol {Language Client} > on \uicontrol Preferences > \uicontrol {Language Client} > on
@@ -86,15 +79,48 @@
language server. language server.
\li Select \uicontrol Add to add language servers. \li Select \uicontrol Add to add language servers.
\li In the \uicontrol Name field, enter a name for the language server. \li In the \uicontrol Name field, enter a name for the language server.
Select the \inlineimage replace.png
(\uicontrol {Variables}) button to use a variable for the server
name. For more information, see \l{Using Qt Creator Variables}.
\li In the \uicontrol {Language} field, select \li In the \uicontrol {Language} field, select
\uicontrol {Set MIME Types} to select the MIME types of the files to \uicontrol {Set MIME Types} to select the MIME types of the files to
send to the language server. In the field below, you can enter file send to the language server. In the field below, you can enter file
patterns to extend the MIME types, separated by semicolons. patterns to extend the MIME types, separated by semicolons.
\li In the \uicontrol {Startup behavior} field, select whether the
language server is started when \QC starts or when a project or file
with a matching MIME type is opened. The
\uicontrol {General Messages} \l{Viewing Output}{output pane}
displays information about the connection to the language server.
\li In the \uicontrol Capabilities field, you can see the features
that are supported by the language server. Only some of them are
implemented by \QC.
\li In the \uicontrol Executable field, enter the path to the language \li In the \uicontrol Executable field, enter the path to the language
server executable. server executable.
\li In the \uicontrol Arguments field, enter any required command line \li In the \uicontrol Arguments field, enter any required command line
arguments. Select \uicontrol Variables to use variables as
arguments. arguments.
\endlist \endlist
To remove language servers from the list, select \uicontrol Delete. To remove language servers from the list, select \uicontrol Delete.
\section1 Supported Locator Filters
The locator enables you to browse not only files, but any items defined by
\e {locator filters}. The language client plugin supports the following
locator filters:
\list
\li Locating symbols in the current project (\c {:})
\li Locating symbols in the current document (\c {.})
\li Locating class (\c {c}), enum, and function (\c {m})
definitions in your project
\endlist
\section1 Reporting Issues
The language service client has been mostly tested with Python.
If problems arise when you try it or some other language, please select
\uicontrol Help > \uicontrol {Report Bug} to report them in the Qt Bug
Tracker. The reports should include \QC console output with the environment
variable \c {QT_LOGGING_RULES=qtc.languageclient.*=true} set.
*/ */

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2019 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.
@@ -23,12 +23,6 @@
** **
****************************************************************************/ ****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*! /*!
\contentspage index.html \contentspage index.html
\page creator-help.html \page creator-help.html
@@ -62,7 +56,6 @@
\li To select and configure how the documentation is displayed in the \li To select and configure how the documentation is displayed in the
\uicontrol Help mode, select \uicontrol Tools > \uicontrol Options > \uicontrol Help. \uicontrol Help mode, select \uicontrol Tools > \uicontrol Options > \uicontrol Help.
\endlist \endlist
The following image displays the context sensitive help in the \uicontrol Edit The following image displays the context sensitive help in the \uicontrol Edit
@@ -70,6 +63,19 @@
\image qtcreator-context-sensitive-help.png \image qtcreator-context-sensitive-help.png
If the help HTML file does not use a style sheet, you can change the font
family, style, and size in \uicontrol Tools > \uicontrol Options >
\uicontrol Help > \uicontrol General.
\image qtcreator-help-options.png
By default, you can use the mouse scroll wheel to zoom help pages. To
disable this feature, deselect the \uicontrol {Enable scroll wheel zooming}
check box.
To switch to the editor context when you close the last help page, select
the \uicontrol {Return to editor on closing the last page} check box.
\section1 Viewing Function Tooltips \section1 Viewing Function Tooltips
To hide function tooltips by default, select \uicontrol {Tools > Options > To hide function tooltips by default, select \uicontrol {Tools > Options >
@@ -127,17 +133,19 @@
\endlist \endlist
To import and export bookmarks, select \uicontrol {Tools > Options > Help > To import and export bookmarks, select \uicontrol Tools > \uicontrol Options
General Settings > Import} or \uicontrol Export. > \uicontrol Help > \uicontrol General > \uicontrol {Import Bookmarks} or
\uicontrol {Export Bookmarks}.
\section2 Full-text Search \section2 Full-text Search
In the \uicontrol Search pane, you can use full-text search for finding a In the \uicontrol Search pane, you can use full-text search for finding a
particular word in all the installed documents. In the \uicontrol {Search for} particular word in all the installed documents. Enter the term you are
field, enter the term you are looking for, and select the \uicontrol Search looking for, and select the \uicontrol Search button. All documents that
button. All documents that contain the specified term are listed. The list contain the specified term are listed. The list is sorted by document
is sorted by the number of search hits that the documents contain. Select a version (if you have installed several Qt versions, for example) and
document in the list to open it. the number of search hits that the documents contain. Select a document in
the list to open it.
\image qtcreator-help-search.png "Search pane" \image qtcreator-help-search.png "Search pane"
@@ -159,12 +167,6 @@
\endlist \endlist
For more flexibility, use the \uicontrol {Advanced search}. Specify words to
exclude from the search hits, or search for an exact phrase or for similar
words. For example, searching for \c{QStin}, \c{QSting}, or \c{QStrin} lists
all the documents with titles that are similar, such as \c{QString}.
Combine options to improve the search results.
Full-text search is based on indexing all the installed documents the first Full-text search is based on indexing all the installed documents the first
time when you open the \uicontrol Search pane. If you add or remove documents, time when you open the \uicontrol Search pane. If you add or remove documents,
\QC recreates the index. \QC recreates the index.

View File

@@ -110,6 +110,46 @@
documentation, see \l{Tips and Tricks}. documentation, see \l{Tips and Tricks}.
\endif \endif
\section1 Changing Languages
\QC has been localized into several languages. If the system language
is one of the supported languages, it is automatically selected. To
change the language, select \uicontrol Tools > \uicontrol Options >
\uicontrol Environment and select a language in the \uicontrol Language
field. The change takes effect after you restart \QC.
\section1 Viewing Images
\QC opens image files in the image viewer.
\image qtcreator-image-viewer.png "Image viewer"
Use the toolbar buttons (1) or \l{Keyboard Shortcuts}{keyboard shortcuts}
to:
\list
\li Export SVG images to pixmaps
\li Switch between background and outline modes
\li Zoom in and out
\li Fit images to screen
\li Return to original size
\li Play and pause animated GIF and MNG images
\endlist
\section2 Exporting SVG Images
If you receive a freely scalable icon in the SVG format from an UI designer,
you can export it to several images of different sizes to create a set of
pixmaps. You can then use QIcon::addPixmap() to add the pixmaps to icons in
different modes and states.
\section1 Platform Notes \section1 Platform Notes
This section describes the cases where the behavior of \QC depends on the This section describes the cases where the behavior of \QC depends on the
@@ -296,7 +336,7 @@
\title Viewing Output \title Viewing Output
\image qtcreator-task-pane.png \image qtcreator-general-messages.png "General Messages output pane"
The task pane in \QC can display one of the following panes: The task pane in \QC can display one of the following panes:
@@ -334,6 +374,9 @@
up in the pane. In these panes, you can also use the zoom buttons to increase and up in the pane. In these panes, you can also use the zoom buttons to increase and
decrease the text size of the output. decrease the text size of the output.
To filter the output, enter a string in the \uicontrol Filter field.
Filtering is not supported in all output panes.
To open the \uicontrol{General Messages} and To open the \uicontrol{General Messages} and
\if defined(qtcreator) \if defined(qtcreator)
\l{Using Version Control Systems}{Version Control} \l{Using Version Control Systems}{Version Control}
@@ -404,7 +447,7 @@
\uicontrol {Filter Tree} \uicontrol {Filter Tree}
and then select a filter. and then select a filter.
\image qtcreator-build-issues.png \image qtcreator-issues.png "Issues output pane"
Right-clicking on a line brings up a context menu with actions that you can Right-clicking on a line brings up a context menu with actions that you can
apply to the contents of the line. You can remove a line, copy its contents apply to the contents of the line. You can remove a line, copy its contents
@@ -422,6 +465,11 @@
To jump from one issue to the next or previous one, press \key F6 and To jump from one issue to the next or previous one, press \key F6 and
\key Shift+F6. \key Shift+F6.
By default, the \uicontrol Issues pane is cleared on a new build. To keep
the issues from the previous build rounds, deselect \uicontrol Tools >
\uicontrol Options > \uicontrol {Build & Run} > \uicontrol General >
\uicontrol {Clear issues list on new build}.
\section1 Search Results \section1 Search Results
In the \uicontrol{Search Results} pane, you can search through projects, files on In the \uicontrol{Search Results} pane, you can search through projects, files on
@@ -470,7 +518,7 @@
The \uicontrol{Compile Output} is a more detailed version of information The \uicontrol{Compile Output} is a more detailed version of information
displayed in the \uicontrol{Issues} pane. displayed in the \uicontrol{Issues} pane.
\image qtcreator-compile-pane.png \image qtcreator-compile-output.png "Compile Output pane"
Double-click on a file name in an error message to open the file in the Double-click on a file name in an error message to open the file in the
code editor. code editor.
@@ -563,42 +611,4 @@
\l{Showing Task List Files in Issues Pane}. \l{Showing Task List Files in Issues Pane}.
\endif \endif
\section1 Changing Languages
\QC has been localized into several languages. If the system language is one
of the supported languages, it is automatically selected. To change the
language, select \uicontrol {Tools > Options > Environment} and select a language
in the \uicontrol Language field. The change takes effect after you restart \QC.
\section1 Viewing Images
\QC opens image files in the image viewer.
\image qtcreator-image-viewer.png "Image viewer"
Use the toolbar buttons (1) or \l{Keyboard Shortcuts}{keyboard shortcuts}
to:
\list
\li Export SVG images to pixmaps
\li Switch between background and outline modes
\li Zoom in and out
\li Fit images to screen
\li Return to original size
\li Play and pause animated GIF and MNG images
\endlist
\section1 Exporting SVG Images
If you receive a freely scalable icon in the SVG format from an UI designer,
you can export it to several images of different sizes to create a set of
pixmaps. You can then use QIcon::addPixmap() to add the pixmaps to icons in
different modes and states.
*/ */

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2018 The Qt Company Ltd. ** Copyright (C) 2019 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.
@@ -79,10 +79,9 @@
languages as code, not just as plain text. This enables it to languages as code, not just as plain text. This enables it to
provide you with useful features, such as semantic highlighting, provide you with useful features, such as semantic highlighting,
checking code syntax, code completion, and refactoring actions. checking code syntax, code completion, and refactoring actions.
In addition, the experimental language server plugin provides \QC supports some of these services also for other programming
some of these services for other programming languages, such as languages, such as Python, for which a \e {language server} is
Python, for which a \e {language server} is available that available that provides information about the code to IDEs.
provides information about the code to IDEs.
For more information, see \l{Coding}. For more information, see \l{Coding}.
\row \row
\li \inlineimage creator_buildingrunning.png \li \inlineimage creator_buildingrunning.png

View File

@@ -59,8 +59,8 @@
\uicontrol Options > \uicontrol Kits. \uicontrol Options > \uicontrol Kits.
Qt for Python projects rely on the \l{Using Language Servers} Qt for Python projects rely on the \l{Using Language Servers}
{experimental language server client} for code completion, {language server client} for code completion, highlighting, and
highlighting, and other useful features. other useful features.
If \QC cannot find an existing build for a particular \l{glossary-buildandrun-kit}{kit}, If \QC cannot find an existing build for a particular \l{glossary-buildandrun-kit}{kit},
it starts out it starts out

View File

@@ -33,6 +33,15 @@ add_qtc_library(KSyntaxHighlighting STATIC
) )
install( install(
DIRECTORY data/ DIRECTORY data/syntax
DESTINATION "${IDE_DATA_PATH}/generic-highlighter/" DESTINATION "${IDE_DATA_PATH}/generic-highlighter/"
) )
add_custom_target(copy_generic_highligher_to_builddir ALL VERBATIM)
add_custom_command(TARGET copy_generic_highligher_to_builddir POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory data/syntax
"${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}/generic-highlighter/syntax"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT Copy files into build directory
VERBATIM
)

View File

@@ -70,7 +70,7 @@ add_qtc_library(ClangSupport
ipcclientinterface.h ipcclientinterface.h
ipcclientprovider.h ipcclientprovider.h
ipcinterface.h ipcinterface.h
ipcserverinterface.cpp ipcserverinterface.h ipcserverinterface.h
lineprefixer.cpp lineprefixer.h lineprefixer.cpp lineprefixer.h
messageenvelop.cpp messageenvelop.h messageenvelop.cpp messageenvelop.h
modifiedtimechecker.h modifiedtimechecker.h
@@ -93,7 +93,6 @@ add_qtc_library(ClangSupport
projectpartcontainer.cpp projectpartcontainer.h projectpartcontainer.cpp projectpartcontainer.h
projectpartid.h projectpartid.h
projectpartpch.cpp projectpartpch.h projectpartpch.cpp projectpartpch.h
projectpartpchproviderinterface.h
projectpartsstorage.h projectpartsstorage.h
projectpartsstorageinterface.h projectpartsstorageinterface.h
readmessageblock.cpp readmessageblock.h readmessageblock.cpp readmessageblock.h

View File

@@ -204,7 +204,6 @@ HEADERS += \
$$PWD/nativefilepath.h \ $$PWD/nativefilepath.h \
$$PWD/filepathview.h \ $$PWD/filepathview.h \
$$PWD/compilermacro.h \ $$PWD/compilermacro.h \
$$PWD/projectpartpchproviderinterface.h \
$$PWD/updategeneratedfilesmessage.h \ $$PWD/updategeneratedfilesmessage.h \
$$PWD/removegeneratedfilesmessage.h \ $$PWD/removegeneratedfilesmessage.h \
$$PWD/generatedfiles.h \ $$PWD/generatedfiles.h \

View File

@@ -1,31 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** 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 General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "ipcserverinterface.h"
namespace ClangBackEnd {
} // namespace ClangBackEnd

View File

@@ -25,7 +25,10 @@
#pragma once #pragma once
#include "projectpartpch.h" #include "clangsupport_global.h"
#include "projectpartid.h"
#include <utils/smallstringio.h>
namespace ClangBackEnd { namespace ClangBackEnd {
@@ -33,29 +36,26 @@ class PrecompiledHeadersUpdatedMessage
{ {
public: public:
PrecompiledHeadersUpdatedMessage() = default; PrecompiledHeadersUpdatedMessage() = default;
PrecompiledHeadersUpdatedMessage(ProjectPartPch projectPartPch) PrecompiledHeadersUpdatedMessage(ProjectPartId projectPartId)
{ {
projectPartPchs.push_back(projectPartPch); projectPartIds.push_back(projectPartId);
} }
PrecompiledHeadersUpdatedMessage(ProjectPartPchs &&projectPartPchs) PrecompiledHeadersUpdatedMessage(ProjectPartIds &&projectPartIds)
: projectPartPchs(std::move(projectPartPchs)) : projectPartIds(std::move(projectPartIds))
{} {}
ProjectPartPchs takeProjectPartPchs() const ProjectPartIds takeProjectPartIds() const { return std::move(projectPartIds); }
{
return std::move(projectPartPchs);
}
friend QDataStream &operator<<(QDataStream &out, const PrecompiledHeadersUpdatedMessage &message) friend QDataStream &operator<<(QDataStream &out, const PrecompiledHeadersUpdatedMessage &message)
{ {
out << message.projectPartPchs; out << message.projectPartIds;
return out; return out;
} }
friend QDataStream &operator>>(QDataStream &in, PrecompiledHeadersUpdatedMessage &message) friend QDataStream &operator>>(QDataStream &in, PrecompiledHeadersUpdatedMessage &message)
{ {
in >> message.projectPartPchs; in >> message.projectPartIds;
return in; return in;
} }
@@ -63,16 +63,13 @@ public:
friend bool operator==(const PrecompiledHeadersUpdatedMessage &first, friend bool operator==(const PrecompiledHeadersUpdatedMessage &first,
const PrecompiledHeadersUpdatedMessage &second) const PrecompiledHeadersUpdatedMessage &second)
{ {
return first.projectPartPchs == second.projectPartPchs; return first.projectPartIds == second.projectPartIds;
} }
PrecompiledHeadersUpdatedMessage clone() const PrecompiledHeadersUpdatedMessage clone() const { return *this; }
{
return PrecompiledHeadersUpdatedMessage(Utils::clone(projectPartPchs));
}
public: public:
ProjectPartPchs projectPartPchs; ProjectPartIds projectPartIds;
}; };
CLANGSUPPORT_EXPORT QDebug operator<<(QDebug debug, const PrecompiledHeadersUpdatedMessage &message); CLANGSUPPORT_EXPORT QDebug operator<<(QDebug debug, const PrecompiledHeadersUpdatedMessage &message);

View File

@@ -54,7 +54,7 @@ public:
return first.projectPathId < second.projectPathId; return first.projectPathId < second.projectPathId;
} }
friend QDataStream &operator<<(QDataStream &out, const ProjectPartId &projectPathId) friend QDataStream &operator<<(QDataStream &out, ProjectPartId projectPathId)
{ {
out << projectPathId.projectPathId; out << projectPathId.projectPathId;

View File

@@ -29,8 +29,7 @@ namespace ClangBackEnd {
QDebug operator<<(QDebug debug, const ProjectPartPch &projectPartPch) QDebug operator<<(QDebug debug, const ProjectPartPch &projectPartPch)
{ {
debug.nospace() << "FileContainer(" << projectPartPch.projectPartId.projectPathId << ", " debug.nospace() << "FileContainer(" << projectPartPch.projectPartId.projectPathId << ")";
<< projectPartPch.pchPath << ")";
return debug; return debug;
} }

View File

@@ -74,8 +74,7 @@ public:
friend bool operator==(const ProjectPartPch &first, friend bool operator==(const ProjectPartPch &first,
const ProjectPartPch &second) const ProjectPartPch &second)
{ {
return first.projectPartId == second.projectPartId return first.projectPartId == second.projectPartId && first.pchPath == second.pchPath;
&& first.pchPath == second.pchPath;
} }
ProjectPartPch clone() const ProjectPartPch clone() const

View File

@@ -9,7 +9,7 @@ add_qtc_library(Sqlite
../3rdparty/sqlite/sqlite3.c ../3rdparty/sqlite/sqlite3.c
createtablesqlstatementbuilder.cpp createtablesqlstatementbuilder.h createtablesqlstatementbuilder.cpp createtablesqlstatementbuilder.h
sqlitebasestatement.cpp sqlitebasestatement.h sqlitebasestatement.cpp sqlitebasestatement.h
sqlitecolumn.cpp sqlitecolumn.h sqlitecolumn.h
sqlitedatabase.cpp sqlitedatabase.h sqlitedatabase.cpp sqlitedatabase.h
sqlitedatabasebackend.cpp sqlitedatabasebackend.h sqlitedatabasebackend.cpp sqlitedatabasebackend.h
sqliteexception.cpp sqliteexception.h sqliteexception.cpp sqliteexception.h
@@ -17,11 +17,11 @@ add_qtc_library(Sqlite
sqliteindex.h sqliteindex.h
sqlitereadstatement.cpp sqlitereadstatement.h sqlitereadstatement.cpp sqlitereadstatement.h
sqlitereadwritestatement.cpp sqlitereadwritestatement.h sqlitereadwritestatement.cpp sqlitereadwritestatement.h
sqlitetable.cpp sqlitetable.h sqlitetable.h
sqlitetransaction.h sqlitetransaction.h
sqlitewritestatement.cpp sqlitewritestatement.h sqlitewritestatement.cpp sqlitewritestatement.h
sqlstatementbuilder.cpp sqlstatementbuilder.h sqlstatementbuilder.cpp sqlstatementbuilder.h
sqlstatementbuilderexception.cpp sqlstatementbuilderexception.h sqlstatementbuilderexception.h
utf8string.cpp utf8string.h utf8string.cpp utf8string.h
utf8stringvector.cpp utf8stringvector.h utf8stringvector.cpp utf8stringvector.h
) )

View File

@@ -19,16 +19,14 @@ SOURCES += \
$$PWD/sqlitereadwritestatement.cpp \ $$PWD/sqlitereadwritestatement.cpp \
$$PWD/sqlitewritestatement.cpp \ $$PWD/sqlitewritestatement.cpp \
$$PWD/sqlstatementbuilder.cpp \ $$PWD/sqlstatementbuilder.cpp \
$$PWD/sqlstatementbuilderexception.cpp \
$$PWD/utf8string.cpp \ $$PWD/utf8string.cpp \
$$PWD/utf8stringvector.cpp \ $$PWD/utf8stringvector.cpp \
$$PWD/sqlitedatabase.cpp \ $$PWD/sqlitedatabase.cpp \
$$PWD/sqlitetable.cpp \
$$PWD/sqlitecolumn.cpp \
$$PWD/sqlitebasestatement.cpp $$PWD/sqlitebasestatement.cpp
HEADERS += \ HEADERS += \
$$PWD/createtablesqlstatementbuilder.h \ $$PWD/createtablesqlstatementbuilder.h \
$$PWD/sqlitedatabasebackend.h \ $$PWD/sqlitedatabasebackend.h \
$$PWD/sqlitedatabaseinterface.h \
$$PWD/sqliteexception.h \ $$PWD/sqliteexception.h \
$$PWD/sqliteglobal.h \ $$PWD/sqliteglobal.h \
$$PWD/sqlitereadstatement.h \ $$PWD/sqlitereadstatement.h \

View File

@@ -17,12 +17,9 @@ SOURCES += \
sqliteworkerthread.cpp \ sqliteworkerthread.cpp \
sqlitewritestatement.cpp \ sqlitewritestatement.cpp \
sqlstatementbuilder.cpp \ sqlstatementbuilder.cpp \
sqlstatementbuilderexception.cpp \
utf8string.cpp \ utf8string.cpp \
utf8stringvector.cpp \ utf8stringvector.cpp \
sqlitedatabase.cpp \ sqlitedatabase.cpp \
sqlitetable.cpp \
sqlitecolumn.cpp \
tablewriteworker.cpp \ tablewriteworker.cpp \
tablewriteworkerproxy.cpp tablewriteworkerproxy.cpp
HEADERS += \ HEADERS += \

View File

@@ -1,31 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** 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 General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "sqlitecolumn.h"
namespace Sqlite {
} // namespace Sqlite

View File

@@ -26,6 +26,7 @@
#pragma once #pragma once
#include "sqlitedatabasebackend.h" #include "sqlitedatabasebackend.h"
#include "sqlitedatabaseinterface.h"
#include "sqliteglobal.h" #include "sqliteglobal.h"
#include "sqlitetable.h" #include "sqlitetable.h"
#include "sqlitetransaction.h" #include "sqlitetransaction.h"
@@ -43,7 +44,7 @@ using namespace std::chrono_literals;
class ReadStatement; class ReadStatement;
class WriteStatement; class WriteStatement;
class SQLITE_EXPORT Database final : public TransactionInterface class SQLITE_EXPORT Database final : public TransactionInterface, public DatabaseInterface
{ {
template <typename Database> template <typename Database>
friend class Statement; friend class Statement;
@@ -105,19 +106,18 @@ public:
return m_databaseBackend.changesCount(); return m_databaseBackend.changesCount();
} }
int totalChangesCount() int totalChangesCount() { return m_databaseBackend.totalChangesCount(); }
{
return m_databaseBackend.totalChangesCount(); void walCheckpointFull() override { m_databaseBackend.walCheckpointFull(); }
}
private: private:
void deferredBegin(); void deferredBegin() override;
void immediateBegin(); void immediateBegin() override;
void exclusiveBegin(); void exclusiveBegin() override;
void commit(); void commit() override;
void rollback(); void rollback() override;
void lock(); void lock() override;
void unlock(); void unlock() override;
void initializeTables(); void initializeTables();
void registerTransactionStatements(); void registerTransactionStatements();

View File

@@ -406,6 +406,27 @@ void DatabaseBackend::setBusyTimeout(std::chrono::milliseconds timeout)
sqlite3_busy_timeout(m_databaseHandle, int(timeout.count())); sqlite3_busy_timeout(m_databaseHandle, int(timeout.count()));
} }
void DatabaseBackend::walCheckpointFull()
{
int resultCode = sqlite3_wal_checkpoint_v2(m_databaseHandle,
nullptr,
SQLITE_CHECKPOINT_TRUNCATE,
nullptr,
nullptr);
switch (resultCode) {
case SQLITE_OK:
break;
case SQLITE_BUSY:
throw DatabaseIsBusy("DatabaseBackend::walCheckpointFull: Operation could not concluded "
"because database is busy!");
case SQLITE_ERROR:
throwException("DatabaseBackend::walCheckpointFull: Error occurred!");
case SQLITE_MISUSE:
throwExceptionStatic("DatabaseBackend::walCheckpointFull: Misuse of database!");
}
}
void DatabaseBackend::throwExceptionStatic(const char *whatHasHappens) void DatabaseBackend::throwExceptionStatic(const char *whatHasHappens)
{ {
throw Exception(whatHasHappens); throw Exception(whatHasHappens);

View File

@@ -85,6 +85,8 @@ public:
void setBusyTimeout(std::chrono::milliseconds timeout); void setBusyTimeout(std::chrono::milliseconds timeout);
void walCheckpointFull();
protected: protected:
bool databaseIsOpen() const; bool databaseIsOpen() const;

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of Qt Creator. ** This file is part of Qt Creator.
@@ -23,12 +23,15 @@
** **
****************************************************************************/ ****************************************************************************/
#include "sqlstatementbuilderexception.h" #pragma once
namespace Sqlite { namespace Sqlite {
class DatabaseInterface
{
public:
virtual void walCheckpointFull() = 0;
protected:
~DatabaseInterface() = default;
};
} // namespace Sqlite } // namespace Sqlite

View File

@@ -1,32 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** 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 General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "sqlitetable.h"
namespace Sqlite {
} // namespace Sqlite

View File

@@ -80,8 +80,12 @@ bool ConsoleProcess::start()
QtcProcess::SplitError perr; QtcProcess::SplitError perr;
QtcProcess::Arguments pargs = QtcProcess::prepareArgs(d->m_commandLine.arguments(), QtcProcess::Arguments pargs = QtcProcess::prepareArgs(d->m_commandLine.arguments(),
&perr, HostOsInfo::hostOs(), &perr,
&d->m_environment, &d->m_workingDir); HostOsInfo::hostOs(),
&d->m_environment,
&d->m_workingDir,
d->m_commandLine.metaCharMode()
== CommandLine::MetaCharMode::Abort);
QString pcmd; QString pcmd;
if (perr == QtcProcess::SplitOk) { if (perr == QtcProcess::SplitOk) {
pcmd = d->m_commandLine.executable().toString(); pcmd = d->m_commandLine.executable().toString();

View File

@@ -78,8 +78,9 @@ CommandLine::CommandLine(const FilePath &executable)
: m_executable(executable) : m_executable(executable)
{} {}
CommandLine::CommandLine(const FilePath &exe, const QStringList &args) CommandLine::CommandLine(const FilePath &exe, const QStringList &args, MetaCharMode metaCharMode)
: m_executable(exe) : m_executable(exe)
, m_metaCharMode(metaCharMode)
{ {
addArgs(args); addArgs(args);
} }

View File

@@ -132,10 +132,13 @@ class QTCREATOR_UTILS_EXPORT CommandLine
{ {
public: public:
enum RawType { Raw }; enum RawType { Raw };
enum class MetaCharMode { Abort, Ignore };
CommandLine() {} CommandLine() {}
explicit CommandLine(const FilePath &executable); explicit CommandLine(const FilePath &executable);
CommandLine(const FilePath &exe, const QStringList &args); CommandLine(const FilePath &exe,
const QStringList &args,
MetaCharMode metaCharMode = MetaCharMode::Ignore);
CommandLine(const FilePath &exe, const QString &unparsedArgs, RawType); CommandLine(const FilePath &exe, const QString &unparsedArgs, RawType);
void addArg(const QString &arg, OsType osType = HostOsInfo::hostOs()); void addArg(const QString &arg, OsType osType = HostOsInfo::hostOs());
@@ -147,11 +150,13 @@ public:
FilePath executable() const { return m_executable; } FilePath executable() const { return m_executable; }
QString arguments() const { return m_arguments; } QString arguments() const { return m_arguments; }
MetaCharMode metaCharMode() const { return m_metaCharMode; }
QStringList splitArguments(OsType osType = HostOsInfo::hostOs()) const; QStringList splitArguments(OsType osType = HostOsInfo::hostOs()) const;
private: private:
FilePath m_executable; FilePath m_executable;
QString m_arguments; QString m_arguments;
MetaCharMode m_metaCharMode;
}; };
class QTCREATOR_UTILS_EXPORT FileUtils { class QTCREATOR_UTILS_EXPORT FileUtils {

View File

@@ -595,12 +595,12 @@ static QString quoteArgWin(const QString &arg)
} }
QtcProcess::Arguments QtcProcess::prepareArgs(const QString &cmd, SplitError *err, OsType osType, QtcProcess::Arguments QtcProcess::prepareArgs(const QString &cmd, SplitError *err, OsType osType,
const Environment *env, const QString *pwd) const Environment *env, const QString *pwd, bool abortOnMeta)
{ {
if (osType == OsTypeWindows) if (osType == OsTypeWindows)
return prepareArgsWin(cmd, err, env, pwd); return prepareArgsWin(cmd, err, env, pwd);
else else
return Arguments::createUnixArgs(splitArgs(cmd, osType, true, err, env, pwd)); return Arguments::createUnixArgs(splitArgs(cmd, osType, abortOnMeta, err, env, pwd));
} }

View File

@@ -79,7 +79,8 @@ public:
//! Prepare argument of a shell command for feeding into QProcess //! Prepare argument of a shell command for feeding into QProcess
static Arguments prepareArgs(const QString &cmd, SplitError *err, static Arguments prepareArgs(const QString &cmd, SplitError *err,
OsType osType = HostOsInfo::hostOs(), OsType osType = HostOsInfo::hostOs(),
const Environment *env = nullptr, const QString *pwd = nullptr); const Environment *env = nullptr, const QString *pwd = nullptr,
bool abortOnMeta = true);
//! Prepare a shell command for feeding into QProcess //! Prepare a shell command for feeding into QProcess
static bool prepareCommand(const QString &command, const QString &arguments, static bool prepareCommand(const QString &command, const QString &arguments,
QString *outCmd, Arguments *outArgs, OsType osType = HostOsInfo::hostOs(), QString *outCmd, Arguments *outArgs, OsType osType = HostOsInfo::hostOs(),

View File

@@ -234,15 +234,15 @@ bool AndroidDeployQtStep::init()
if (m_useAndroiddeployqt) { if (m_useAndroiddeployqt) {
const ProjectNode *node = target()->project()->findNodeForBuildKey(rc->buildKey()); const ProjectNode *node = target()->project()->findNodeForBuildKey(rc->buildKey());
if (!node)
return false;
m_apkPath = Utils::FilePath::fromString(node->data(Constants::AndroidApk).toString()); m_apkPath = Utils::FilePath::fromString(node->data(Constants::AndroidApk).toString());
if (!m_apkPath.isEmpty()) { if (!m_apkPath.isEmpty()) {
m_manifestName = Utils::FilePath::fromString(node->data(Constants::AndroidManifest).toString()); m_manifestName = Utils::FilePath::fromString(node->data(Constants::AndroidManifest).toString());
m_command = AndroidConfigurations::currentConfig().adbToolPath(); m_command = AndroidConfigurations::currentConfig().adbToolPath();
AndroidManager::setManifestPath(target(), m_manifestName); AndroidManager::setManifestPath(target(), m_manifestName);
} else { } else {
QString jsonFile; QString jsonFile = node->data(Constants::AndroidDeploySettingsFile).toString();
if (node)
jsonFile = node->data(Constants::AndroidDeploySettingsFile).toString();
if (jsonFile.isEmpty()) { if (jsonFile.isEmpty()) {
emit addOutput(tr("Cannot find the androiddeploy Json file."), OutputFormat::Stderr); emit addOutput(tr("Cannot find the androiddeploy Json file."), OutputFormat::Stderr);
return false; return false;

View File

@@ -43,11 +43,8 @@ void PchManagerClient::alive()
void PchManagerClient::precompiledHeadersUpdated(ClangBackEnd::PrecompiledHeadersUpdatedMessage &&message) void PchManagerClient::precompiledHeadersUpdated(ClangBackEnd::PrecompiledHeadersUpdatedMessage &&message)
{ {
for (ClangBackEnd::ProjectPartPch &projectPartPch : message.takeProjectPartPchs()) { for (ClangBackEnd::ProjectPartId &projectPartId : message.takeProjectPartIds())
const QString pchPath{projectPartPch.pchPath}; precompiledHeaderUpdated(projectPartId);
addProjectPartPch(std::move(projectPartPch));
precompiledHeaderUpdated(projectPartPch.projectPartId, pchPath, projectPartPch.lastModified);
}
} }
void PchManagerClient::progress(ClangBackEnd::ProgressMessage &&message) void PchManagerClient::progress(ClangBackEnd::ProgressMessage &&message)
@@ -66,10 +63,8 @@ void PchManagerClient::progress(ClangBackEnd::ProgressMessage &&message)
void PchManagerClient::precompiledHeaderRemoved(ClangBackEnd::ProjectPartId projectPartId) void PchManagerClient::precompiledHeaderRemoved(ClangBackEnd::ProjectPartId projectPartId)
{ {
for (auto notifier : m_notifiers) { for (auto notifier : m_notifiers)
removeProjectPartPch(projectPartId);
notifier->precompiledHeaderRemoved(projectPartId); notifier->precompiledHeaderRemoved(projectPartId);
}
} }
void PchManagerClient::setConnectionClient(PchManagerConnectionClient *connectionClient) void PchManagerClient::setConnectionClient(PchManagerConnectionClient *connectionClient)
@@ -77,22 +72,6 @@ void PchManagerClient::setConnectionClient(PchManagerConnectionClient *connectio
m_connectionClient = connectionClient; m_connectionClient = connectionClient;
} }
Utils::optional<ClangBackEnd::ProjectPartPch> PchManagerClient::projectPartPch(
ClangBackEnd::ProjectPartId projectPartId) const
{
auto found = std::lower_bound(m_projectPartPchs.cbegin(),
m_projectPartPchs.cend(),
projectPartId,
[] (const auto &projectPartPch, auto projectPartId) {
return projectPartId < projectPartPch.projectPartId;
});
if (found != m_projectPartPchs.end() && found->projectPartId == projectPartId)
return *found;
return Utils::nullopt;
}
void PchManagerClient::attach(PchManagerNotifierInterface *notifier) void PchManagerClient::attach(PchManagerNotifierInterface *notifier)
{ {
m_notifiers.push_back(notifier); m_notifiers.push_back(notifier);
@@ -109,47 +88,15 @@ void PchManagerClient::detach(PchManagerNotifierInterface *notifierToBeDeleted)
m_notifiers.erase(newEnd, m_notifiers.end()); m_notifiers.erase(newEnd, m_notifiers.end());
} }
void PchManagerClient::removeProjectPartPch(ClangBackEnd::ProjectPartId projectPartId)
{
auto found = std::lower_bound(m_projectPartPchs.begin(),
m_projectPartPchs.end(),
projectPartId,
[] (const auto &projectPartPch, auto projectPartId) {
return projectPartId < projectPartPch.projectPartId;
});
if (found != m_projectPartPchs.end() && found->projectPartId == projectPartId) {
*found = std::move(m_projectPartPchs.back());
m_projectPartPchs.pop_back();
}
}
void PchManagerClient::addProjectPartPch(ClangBackEnd::ProjectPartPch &&projectPartPch)
{
auto found = std::lower_bound(m_projectPartPchs.begin(),
m_projectPartPchs.end(),
projectPartPch.projectPartId,
[] (const auto &projectPartPch, auto projectPartId) {
return projectPartId < projectPartPch.projectPartId;
});
if (found != m_projectPartPchs.end() && found->projectPartId == projectPartPch.projectPartId)
*found = std::move(projectPartPch);
else
m_projectPartPchs.insert(found, std::move(projectPartPch));
}
const std::vector<PchManagerNotifierInterface *> &PchManagerClient::notifiers() const const std::vector<PchManagerNotifierInterface *> &PchManagerClient::notifiers() const
{ {
return m_notifiers; return m_notifiers;
} }
void PchManagerClient::precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId, void PchManagerClient::precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId)
const QString &pchFilePath,
long long lastModified)
{ {
for (auto notifier : m_notifiers) for (auto notifier : m_notifiers)
notifier->precompiledHeaderUpdated(projectPartId, pchFilePath, lastModified); notifier->precompiledHeaderUpdated(projectPartId);
} }
} // namespace ClangPchManager } // namespace ClangPchManager

View File

@@ -28,7 +28,7 @@
#include "clangpchmanager_global.h" #include "clangpchmanager_global.h"
#include <pchmanagerclientinterface.h> #include <pchmanagerclientinterface.h>
#include <projectpartpchproviderinterface.h> #include <projectpartid.h>
#include <vector> #include <vector>
@@ -37,8 +37,7 @@ class PchManagerConnectionClient;
class ProgressManagerInterface; class ProgressManagerInterface;
class PchManagerNotifierInterface; class PchManagerNotifierInterface;
class CLANGPCHMANAGER_EXPORT PchManagerClient final : public ClangBackEnd::PchManagerClientInterface, class CLANGPCHMANAGER_EXPORT PchManagerClient final : public ClangBackEnd::PchManagerClientInterface
public ClangBackEnd::ProjectPartPchProviderInterface
{ {
friend class PchManagerNotifierInterface; friend class PchManagerNotifierInterface;
public: public:
@@ -56,27 +55,13 @@ public:
void setConnectionClient(PchManagerConnectionClient *connectionClient); void setConnectionClient(PchManagerConnectionClient *connectionClient);
Utils::optional<ClangBackEnd::ProjectPartPch> projectPartPch(
ClangBackEnd::ProjectPartId projectPartId) const override;
const ClangBackEnd::ProjectPartPchs &projectPartPchs() const override
{
return m_projectPartPchs;
}
unittest_public : const std::vector<PchManagerNotifierInterface *> &notifiers() const; unittest_public : const std::vector<PchManagerNotifierInterface *> &notifiers() const;
void precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId, void precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId);
const QString &pchFilePath,
long long lastModified);
void attach(PchManagerNotifierInterface *notifier); void attach(PchManagerNotifierInterface *notifier);
void detach(PchManagerNotifierInterface *notifier); void detach(PchManagerNotifierInterface *notifier);
void addProjectPartPch(ClangBackEnd::ProjectPartPch &&projectPartPch);
void removeProjectPartPch(ClangBackEnd::ProjectPartId projectPartId);
private: private:
ClangBackEnd::ProjectPartPchs m_projectPartPchs;
std::vector<PchManagerNotifierInterface*> m_notifiers; std::vector<PchManagerNotifierInterface*> m_notifiers;
PchManagerConnectionClient *m_connectionClient=nullptr; PchManagerConnectionClient *m_connectionClient=nullptr;
ProgressManagerInterface &m_pchCreationProgressManager; ProgressManagerInterface &m_pchCreationProgressManager;

View File

@@ -42,10 +42,7 @@ public:
PchManagerNotifierInterface(const PchManagerNotifierInterface &) = delete; PchManagerNotifierInterface(const PchManagerNotifierInterface &) = delete;
PchManagerNotifierInterface &operator=(const PchManagerNotifierInterface &) = delete; PchManagerNotifierInterface &operator=(const PchManagerNotifierInterface &) = delete;
virtual void precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId, virtual void precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId) = 0;
const QString &pchFilePath,
long long lastModified)
= 0;
virtual void precompiledHeaderRemoved(ClangBackEnd::ProjectPartId projectPartId) = 0; virtual void precompiledHeaderRemoved(ClangBackEnd::ProjectPartId projectPartId) = 0;
PchManagerClient &m_pchManagerClient; PchManagerClient &m_pchManagerClient;

View File

@@ -30,9 +30,7 @@
namespace ClangRefactoring { namespace ClangRefactoring {
void RefactoringProjectUpdater::precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId, void RefactoringProjectUpdater::precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId)
const QString &,
long long)
{ {
const QString projectPartName = fetchProjectPartName(projectPartId); const QString projectPartName = fetchProjectPartName(projectPartId);

View File

@@ -48,9 +48,7 @@ public:
{ {
} }
void precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId, void precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId) override;
const QString &pchFilePath,
long long lastModified) override;
void precompiledHeaderRemoved(ClangBackEnd::ProjectPartId projectPartId) override; void precompiledHeaderRemoved(ClangBackEnd::ProjectPartId projectPartId) override;
private: private:

View File

@@ -552,7 +552,7 @@ bool ShortcutSettingsWidget::markCollisions(ShortcutItem *item)
} }
item->m_item->setForeground(2, hasCollision item->m_item->setForeground(2, hasCollision
? Utils::creatorTheme()->color(Utils::Theme::TextColorError) ? Utils::creatorTheme()->color(Utils::Theme::TextColorError)
: commandList()->palette().window()); : commandList()->palette().windowText());
return hasCollision; return hasCollision;
} }

View File

@@ -295,8 +295,10 @@ void EditorToolBar::setToolbarCreationFlags(ToolbarCreationFlags flags)
{ {
d->m_isStandalone = flags & FlagsStandalone; d->m_isStandalone = flags & FlagsStandalone;
if (d->m_isStandalone) { if (d->m_isStandalone) {
connect(EditorManager::instance(), &EditorManager::currentEditorChanged, connect(EditorManager::instance(),
this, &EditorToolBar::updateEditorListSelection); &EditorManager::currentEditorChanged,
this,
&EditorToolBar::setCurrentEditor);
disconnect(d->m_editorList, QOverload<int>::of(&QComboBox::activated), disconnect(d->m_editorList, QOverload<int>::of(&QComboBox::activated),
this, &EditorToolBar::listSelectionActivated); this, &EditorToolBar::listSelectionActivated);
@@ -327,15 +329,6 @@ void EditorToolBar::setCurrentEditor(IEditor *editor)
updateDocumentStatus(document); updateDocumentStatus(document);
} }
void EditorToolBar::updateEditorListSelection(IEditor *newSelection)
{
if (newSelection) {
const Utils::optional<int> index = DocumentModel::rowOfDocument(newSelection->document());
if (QTC_GUARD(index))
d->m_editorList->setCurrentIndex(index.value());
}
}
void EditorToolBar::changeActiveEditor(int row) void EditorToolBar::changeActiveEditor(int row)
{ {
EditorManager::activateEditorForEntry(DocumentModel::entryAtRow(row)); EditorManager::activateEditorForEntry(DocumentModel::entryAtRow(row));

View File

@@ -105,7 +105,6 @@ private:
void updateActionShortcuts(); void updateActionShortcuts();
void updateDocumentStatus(IDocument *document); void updateDocumentStatus(IDocument *document);
void updateEditorListSelection(IEditor *newSelection);
void fillListContextMenu(QMenu *menu); void fillListContextMenu(QMenu *menu);
void updateToolBar(QWidget *toolBar); void updateToolBar(QWidget *toolBar);

View File

@@ -169,6 +169,7 @@ static bool keyWordReplacement(const QString &keyWord,
const QChar ypsilon = QLatin1Char('y'); const QChar ypsilon = QLatin1Char('y');
if (format.count(ypsilon) == 2) if (format.count(ypsilon) == 2)
format.insert(format.indexOf(ypsilon), QString(2, ypsilon)); format.insert(format.indexOf(ypsilon), QString(2, ypsilon));
format.replace('/', "\\/");
} }
*value = QString::fromLatin1("%{CurrentDate:") + format + QLatin1Char('}'); *value = QString::fromLatin1("%{CurrentDate:") + format + QLatin1Char('}');
return true; return true;
@@ -193,7 +194,6 @@ static void parseLicenseTemplatePlaceholders(QString *t)
{ {
int pos = 0; int pos = 0;
const QChar placeHolder = QLatin1Char('%'); const QChar placeHolder = QLatin1Char('%');
bool isCompatibilityStyle = false;
do { do {
const int placeHolderPos = t->indexOf(placeHolder, pos); const int placeHolderPos = t->indexOf(placeHolder, pos);
if (placeHolderPos == -1) if (placeHolderPos == -1)
@@ -208,7 +208,6 @@ static void parseLicenseTemplatePlaceholders(QString *t)
const QString keyWord = t->mid(placeHolderPos, endPlaceHolderPos + 1 - placeHolderPos); const QString keyWord = t->mid(placeHolderPos, endPlaceHolderPos + 1 - placeHolderPos);
QString replacement; QString replacement;
if (keyWordReplacement(keyWord, &replacement)) { if (keyWordReplacement(keyWord, &replacement)) {
isCompatibilityStyle = true;
t->replace(placeHolderPos, keyWord.size(), replacement); t->replace(placeHolderPos, keyWord.size(), replacement);
pos = placeHolderPos + replacement.size(); pos = placeHolderPos + replacement.size();
} else { } else {
@@ -218,8 +217,6 @@ static void parseLicenseTemplatePlaceholders(QString *t)
} }
} while (pos < t->size()); } while (pos < t->size());
if (isCompatibilityStyle)
t->replace(QLatin1Char('\\'), QLatin1String("\\\\"));
} }
// Convenience that returns the formatted license template. // Convenience that returns the formatted license template.

View File

@@ -293,7 +293,7 @@ HelpPluginPrivate::HelpPluginPrivate()
cmd = ActionManager::registerAction(action, "Help.ReportBug"); cmd = ActionManager::registerAction(action, "Help.ReportBug");
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT); ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT);
connect(action, &QAction::triggered, this, [] { connect(action, &QAction::triggered, this, [] {
QDesktopServices::openUrl(QUrl("https://bugreports.qt.io")); QDesktopServices::openUrl(QUrl("https://bugreports.qt.io/secure/CreateIssue.jspa?pid=10512"));
}); });
action = new QAction(HelpPlugin::tr("System Information..."), this); action = new QAction(HelpPlugin::tr("System Information..."), this);

View File

@@ -140,9 +140,10 @@ void PerfResourceCounterTest::testUnitSized()
QList<int> ids; QList<int> ids;
for (int i = 0; i < 10000; ++i) { for (int i = 0; i < 10000; ++i) {
counter.request(1); counter.request(1);
int id = qrand(); const int id = qrand();
counter.obtain(id); counter.obtain(id);
ids.append(id); if (id != 0) // Otherwise it's the invalid ID and that means the allocation "failed".
ids.append(id);
QCOMPARE(counter.currentTotal(), ids.length()); QCOMPARE(counter.currentTotal(), ids.length());
} }
QCOMPARE(sum(container), counter.currentTotal()); QCOMPARE(sum(container), counter.currentTotal());

View File

@@ -30,6 +30,8 @@
#include "desktopdeviceconfigurationwidget.h" #include "desktopdeviceconfigurationwidget.h"
#include "desktopprocesssignaloperation.h" #include "desktopprocesssignaloperation.h"
#include <coreplugin/fileutils.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runcontrol.h> #include <projectexplorer/runcontrol.h>
@@ -58,6 +60,9 @@ DesktopDevice::DesktopDevice()
const QString portRange = const QString portRange =
QString::fromLatin1("%1-%2").arg(DESKTOP_PORT_START).arg(DESKTOP_PORT_END); QString::fromLatin1("%1-%2").arg(DESKTOP_PORT_START).arg(DESKTOP_PORT_END);
setFreePorts(Utils::PortList::fromString(portRange)); setFreePorts(Utils::PortList::fromString(portRange));
setOpenTerminal([](const Utils::Environment &env, const QString &workingDir) {
Core::FileUtils::openTerminal(workingDir, env);
});
} }
IDevice::DeviceInfo DesktopDevice::deviceInformation() const IDevice::DeviceInfo DesktopDevice::deviceInformation() const

View File

@@ -153,6 +153,7 @@ public:
QList<Utils::Icon> deviceIcons; QList<Utils::Icon> deviceIcons;
QList<IDevice::DeviceAction> deviceActions; QList<IDevice::DeviceAction> deviceActions;
QVariantMap extraData; QVariantMap extraData;
IDevice::OpenTerminal openTerminal;
}; };
} // namespace Internal } // namespace Internal
@@ -162,6 +163,11 @@ IDevice::IDevice() : d(new Internal::IDevicePrivate)
{ {
} }
void IDevice::setOpenTerminal(const IDevice::OpenTerminal &openTerminal)
{
d->openTerminal = openTerminal;
}
void IDevice::setupId(Origin origin, Core::Id id) void IDevice::setupId(Origin origin, Core::Id id)
{ {
d->origin = origin; d->origin = origin;
@@ -169,6 +175,17 @@ void IDevice::setupId(Origin origin, Core::Id id)
d->id = id.isValid() ? id : newId(); d->id = id.isValid() ? id : newId();
} }
bool IDevice::canOpenTerminal() const
{
return bool(d->openTerminal);
}
void IDevice::openTerminal(const Utils::Environment &env, const QString &workingDir) const
{
QTC_ASSERT(canOpenTerminal(), return);
d->openTerminal(env, workingDir);
}
IDevice::~IDevice() = default; IDevice::~IDevice() = default;
/*! /*!

View File

@@ -120,6 +120,7 @@ public:
// See cpp file for documentation. // See cpp file for documentation.
class PROJECTEXPLORER_EXPORT IDevice : public QEnableSharedFromThis<IDevice> class PROJECTEXPLORER_EXPORT IDevice : public QEnableSharedFromThis<IDevice>
{ {
friend class Internal::IDevicePrivate;
public: public:
using Ptr = QSharedPointer<IDevice>; using Ptr = QSharedPointer<IDevice>;
using ConstPtr = QSharedPointer<const IDevice>; using ConstPtr = QSharedPointer<const IDevice>;
@@ -218,9 +219,15 @@ public:
void setupId(Origin origin, Core::Id id = Core::Id()); void setupId(Origin origin, Core::Id id = Core::Id());
bool canOpenTerminal() const;
void openTerminal(const Utils::Environment &env, const QString &workingDir) const;
protected: protected:
IDevice(); IDevice();
using OpenTerminal = std::function<void(const Utils::Environment &, const QString &)>;
void setOpenTerminal(const OpenTerminal &openTerminal);
private: private:
IDevice(const IDevice &) = delete; IDevice(const IDevice &) = delete;
IDevice &operator=(const IDevice &) = delete; IDevice &operator=(const IDevice &) = delete;

View File

@@ -201,7 +201,9 @@ void SshDeviceProcess::handleConnected()
this, &SshDeviceProcess::handleProcessStarted); this, &SshDeviceProcess::handleProcessStarted);
connect(&d->consoleProcess, &ConsoleProcess::stubStopped, connect(&d->consoleProcess, &ConsoleProcess::stubStopped,
this, [this] { handleProcessFinished(d->consoleProcess.errorString()); }); this, [this] { handleProcessFinished(d->consoleProcess.errorString()); });
d->consoleProcess.setCommand({FilePath::fromString(cmdLine.first()), cmdLine.mid(1)}); d->consoleProcess.setCommand({FilePath::fromString(cmdLine.first()),
cmdLine.mid(1),
CommandLine::MetaCharMode::Ignore});
d->consoleProcess.start(); d->consoleProcess.start();
} else { } else {
connect(d->process.get(), &QSsh::SshRemoteProcess::started, connect(d->process.get(), &QSsh::SshRemoteProcess::started,

View File

@@ -268,11 +268,20 @@ static Utils::optional<Utils::Environment> buildEnv(const Project *project)
return project->activeTarget()->activeBuildConfiguration()->environment(); return project->activeTarget()->activeBuildConfiguration()->environment();
} }
static Utils::optional<Utils::Environment> runEnv(const Project *project) static bool canOpenTerminalWithRunEnv(const Project *project)
{ {
if (!project || !project->activeTarget() || !project->activeTarget()->activeRunConfiguration()) if (!project)
return {}; return false;
return project->activeTarget()->activeRunConfiguration()->runnable().environment; const Target * const target = project->activeTarget();
if (!target)
return false;
const RunConfiguration * const runConfig = target->activeRunConfiguration();
if (!runConfig)
return false;
IDevice::ConstPtr device = runConfig->runnable().device;
if (!device)
device = DeviceKitAspect::device(target->kit());
return device && device->canOpenTerminal();
} }
static Target *activeTarget() static Target *activeTarget()
@@ -382,6 +391,7 @@ public:
void updateUnloadProjectMenu(); void updateUnloadProjectMenu();
using EnvironmentGetter = std::function<Utils::optional<Utils::Environment>(const Project *project)>; using EnvironmentGetter = std::function<Utils::optional<Utils::Environment>(const Project *project)>;
void openTerminalHere(const EnvironmentGetter &env); void openTerminalHere(const EnvironmentGetter &env);
void openTerminalHereWithRunEnv();
void invalidateProject(ProjectExplorer::Project *project); void invalidateProject(ProjectExplorer::Project *project);
@@ -1501,7 +1511,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(dd->m_openTerminalHere, &QAction::triggered, dd, []() { dd->openTerminalHere(sysEnv); }); connect(dd->m_openTerminalHere, &QAction::triggered, dd, []() { dd->openTerminalHere(sysEnv); });
connect(dd->m_openTerminalHereBuildEnv, &QAction::triggered, dd, []() { dd->openTerminalHere(buildEnv); }); connect(dd->m_openTerminalHereBuildEnv, &QAction::triggered, dd, []() { dd->openTerminalHere(buildEnv); });
connect(dd->m_openTerminalHereRunEnv, &QAction::triggered, dd, []() { dd->openTerminalHere(runEnv); }); connect(dd->m_openTerminalHereRunEnv, &QAction::triggered, dd, []() { dd->openTerminalHereWithRunEnv(); });
connect(dd->m_filePropertiesAction, &QAction::triggered, this, []() { connect(dd->m_filePropertiesAction, &QAction::triggered, this, []() {
const Node *currentNode = ProjectTree::currentNode(); const Node *currentNode = ProjectTree::currentNode();
@@ -3244,7 +3254,7 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
Project *project = ProjectTree::currentProject(); Project *project = ProjectTree::currentProject();
m_openTerminalHereBuildEnv->setVisible(bool(buildEnv(project))); m_openTerminalHereBuildEnv->setVisible(bool(buildEnv(project)));
m_openTerminalHereRunEnv->setVisible(bool(runEnv(project))); m_openTerminalHereRunEnv->setVisible(canOpenTerminalWithRunEnv(project));
if (pn && project) { if (pn && project) {
if (pn == project->rootProjectNode()) { if (pn == project->rootProjectNode()) {
@@ -3583,6 +3593,28 @@ void ProjectExplorerPluginPrivate::openTerminalHere(const EnvironmentGetter &env
FileUtils::openTerminal(directoryFor(currentNode), environment.value()); FileUtils::openTerminal(directoryFor(currentNode), environment.value());
} }
void ProjectExplorerPluginPrivate::openTerminalHereWithRunEnv()
{
const Node *currentNode = ProjectTree::currentNode();
QTC_ASSERT(currentNode, return);
const Project * const project = ProjectTree::projectForNode(currentNode);
QTC_ASSERT(project, return);
const Target * const target = project->activeTarget();
QTC_ASSERT(target, return);
const RunConfiguration * const runConfig = target->activeRunConfiguration();
QTC_ASSERT(runConfig, return);
const Runnable runnable = runConfig->runnable();
IDevice::ConstPtr device = runnable.device;
if (!device)
device = DeviceKitAspect::device(target->kit());
QTC_ASSERT(device && device->canOpenTerminal(), return);
const QString workingDir = device->type() == Constants::DESKTOP_DEVICE_TYPE
? directoryFor(currentNode) : runnable.workingDirectory;
device->openTerminal(runnable.environment, workingDir);
}
void ProjectExplorerPluginPrivate::removeFile() void ProjectExplorerPluginPrivate::removeFile()
{ {
const Node *currentNode = ProjectTree::currentNode(); const Node *currentNode = ProjectTree::currentNode();

View File

@@ -389,9 +389,15 @@ void ProjectTree::applyTreeManager(FolderNode *folder)
bool ProjectTree::hasNode(const Node *node) bool ProjectTree::hasNode(const Node *node)
{ {
return Utils::contains(SessionManager::projects(), [node](const Project *p) { return Utils::contains(SessionManager::projects(), [node](const Project *p) {
return p && p->rootProjectNode() && ( if (!p)
p->containerNode() == node return false;
|| p->rootProjectNode()->findNode([node](const Node *n) { return n == node; })); if (p->containerNode() == node)
return true;
// When parsing fails we have a living container node but no rootProjectNode.
ProjectNode *pn = p->rootProjectNode();
if (!pn)
return false;
return pn->findNode([node](const Node *n) { return n == node; }) != nullptr;
}); });
} }

View File

@@ -410,9 +410,6 @@ QString QbsProductNode::buildKey() const
QVariant QbsProductNode::data(Core::Id role) const QVariant QbsProductNode::data(Core::Id role) const
{ {
// if (role == Android::Constants::AndroidExtraLibs)
// return value("ANDROID_EXTRA_LIBS");
if (role == Android::Constants::AndroidDeploySettingsFile) { if (role == Android::Constants::AndroidDeploySettingsFile) {
for (const auto &artifact : m_qbsProductData.generatedArtifacts()) { for (const auto &artifact : m_qbsProductData.generatedArtifacts()) {
if (artifact.fileTags().contains("qt_androiddeployqt_input")) if (artifact.fileTags().contains("qt_androiddeployqt_input"))
@@ -426,11 +423,9 @@ QVariant QbsProductNode::data(Core::Id role) const
for (const auto &artifact : m_qbsProductData.generatedArtifacts()) { for (const auto &artifact : m_qbsProductData.generatedArtifacts()) {
if (artifact.fileTags().contains("dynamiclibrary")) { if (artifact.fileTags().contains("dynamiclibrary")) {
ret << QFileInfo(artifact.filePath()).path(); ret << QFileInfo(artifact.filePath()).path();
qDebug() << artifact.properties().toString();
} }
} }
ret.removeDuplicates(); ret.removeDuplicates();
qDebug() << ret;
return ret; return ret;
} }
@@ -442,16 +437,8 @@ QVariant QbsProductNode::data(Core::Id role) const
return {}; return {};
} }
if (role == Android::Constants::AndroidApk) { if (role == Android::Constants::AndroidApk)
// qDebug() << m_qbsProductData.name() << m_qbsProductData.targetExecutable() << m_qbsProductData.properties();
// for (const auto &artifact : m_qbsProductData.installableArtifacts()) {
// qDebug() << artifact.fileTags() << artifact.filePath();
// }
// for (const auto &artifact : m_qbsProductData.generatedArtifacts()) {
// qDebug() << artifact.fileTags() << artifact.filePath();
// }
return m_qbsProductData.targetExecutable(); return m_qbsProductData.targetExecutable();
}
return {}; return {};
} }

View File

@@ -878,8 +878,7 @@ QStringList QmakePriFile::varNames(FileType type, QtSupport::ProFileReader *read
QStringList vars; QStringList vars;
switch (type) { switch (type) {
case FileType::Header: case FileType::Header:
vars << QLatin1String("HEADERS"); vars << "HEADERS" << "OBJECTIVE_HEADERS" << "PRECOMPILED_HEADER";
vars << QLatin1String("PRECOMPILED_HEADER");
break; break;
case FileType::Source: { case FileType::Source: {
vars << QLatin1String("SOURCES"); vars << QLatin1String("SOURCES");
@@ -888,12 +887,15 @@ QStringList QmakePriFile::varNames(FileType type, QtSupport::ProFileReader *read
QStringList inputs = readerExact->values(var + QLatin1String(".input")); QStringList inputs = readerExact->values(var + QLatin1String(".input"));
foreach (const QString &input, inputs) foreach (const QString &input, inputs)
// FORMS, RESOURCES, and STATECHARTS are handled below, HEADERS and SOURCES above // FORMS, RESOURCES, and STATECHARTS are handled below, HEADERS and SOURCES above
if (input != QLatin1String("FORMS") if (input != "FORMS"
&& input != QLatin1String("STATECHARTS") && input != "STATECHARTS"
&& input != QLatin1String("RESOURCES") && input != "RESOURCES"
&& input != QLatin1String("SOURCES") && input != "SOURCES"
&& input != QLatin1String("HEADERS")) && input != "HEADERS"
&& input != "OBJECTIVE_HEADERS"
&& input != "PRECOMPILED_HEADER") {
vars << input; vars << input;
}
} }
break; break;
} }

View File

@@ -524,6 +524,21 @@ void QmakeProject::asyncUpdate()
m_asyncUpdateFutureInterface->reportStarted(); m_asyncUpdateFutureInterface->reportStarted();
const Kit * const kit = activeTarget() ? activeTarget()->kit() : nullptr;
QtSupport::BaseQtVersion * const qtVersion = QtSupport::QtKitAspect::qtVersion(kit);
if (!qtVersion || !qtVersion->isValid()) {
const QString errorMessage = kit
? tr("Cannot parse project \"%1\": The currently selected kit \"%2\" does not "
"have a valid Qt.").arg(displayName(), kit->displayName())
: tr("Cannot parse project \"%1\": No kit selected.").arg(displayName());
proFileParseError(errorMessage);
m_asyncUpdateFutureInterface->reportCanceled();
m_asyncUpdateFutureInterface->reportFinished();
delete m_asyncUpdateFutureInterface;
m_asyncUpdateFutureInterface = nullptr;
return;
}
if (m_asyncUpdateState == AsyncFullUpdatePending) { if (m_asyncUpdateState == AsyncFullUpdatePending) {
rootProFile()->asyncUpdate(); rootProFile()->asyncUpdate();
} else { } else {

View File

@@ -185,6 +185,7 @@ void StatesEditorModel::renameState(int internalNodeId, const QString &newName)
newName.isEmpty() ? newName.isEmpty() ?
tr("The empty string as a name is reserved for the base state.") : tr("The empty string as a name is reserved for the base state.") :
tr("Name already used in another state")); tr("Name already used in another state"));
reset();
} else { } else {
m_statesEditorView->renameState(internalNodeId, newName); m_statesEditorView->renameState(internalNodeId, newName);
} }

View File

@@ -64,9 +64,11 @@ public:
bool isStackedContainer() const; bool isStackedContainer() const;
bool canBeReparentedTo(const ModelNode &potenialParent); bool canBeReparentedTo(const ModelNode &potenialParent);
QString indexPropertyForStackedContainer() const; QString indexPropertyForStackedContainer() const;
QStringList visibleNonDefaultProperties() const;
bool takesOverRenderingOfChildren() const; bool takesOverRenderingOfChildren() const;
bool visibleInNavigator() const; bool visibleInNavigator() const;
bool visibleInLibrary() const; bool visibleInLibrary() const;
QString forceNonDefaultProperty() const;
QHash<QString, QString> hints() const; QHash<QString, QString> hints() const;
static NodeHints fromModelNode(const ModelNode &modelNode); static NodeHints fromModelNode(const ModelNode &modelNode);

View File

@@ -192,6 +192,19 @@ QString NodeHints::indexPropertyForStackedContainer() const
return Internal::evaluateExpression(expression, modelNode(), ModelNode()).toString(); return Internal::evaluateExpression(expression, modelNode(), ModelNode()).toString();
} }
QStringList NodeHints::visibleNonDefaultProperties() const
{
if (!isValid())
return {};
const QString expression = m_hints.value("visibleNonDefaultProperties");
if (expression.isEmpty())
return {};
return Internal::evaluateExpression(expression, modelNode(), ModelNode()).toString().split(",");
}
bool NodeHints::takesOverRenderingOfChildren() const bool NodeHints::takesOverRenderingOfChildren() const
{ {
if (!isValid()) if (!isValid())
@@ -213,6 +226,16 @@ bool NodeHints::visibleInLibrary() const
return evaluateBooleanExpression("visibleInLibrary", true); return evaluateBooleanExpression("visibleInLibrary", true);
} }
QString NodeHints::forceNonDefaultProperty() const
{
const QString expression = m_hints.value("forceNonDefaultProperty");
if (expression.isEmpty())
return {};
return Internal::evaluateExpression(expression, modelNode(), ModelNode()).toString();
}
QHash<QString, QString> NodeHints::hints() const QHash<QString, QString> NodeHints::hints() const
{ {
return m_hints; return m_hints;

View File

@@ -263,7 +263,7 @@ QString QmlObjectNode::stripedTranslatableText(const PropertyName &name) const
return regularExpressionPatter.cap(2); return regularExpressionPatter.cap(2);
return instanceValue(name).toString(); return instanceValue(name).toString();
} }
return modelNode().variantProperty(name).value().toString(); return instanceValue(name).toString();
} }
QString QmlObjectNode::expression(const PropertyName &name) const QString QmlObjectNode::expression(const PropertyName &name) const

View File

@@ -52,7 +52,7 @@ static Abis detectTargetAbis(const FilePath &sdpPath)
if (!sdpPath.fileName().isEmpty()) { if (!sdpPath.fileName().isEmpty()) {
Utils::EnvironmentItems environment = QnxUtils::qnxEnvironment(sdpPath.toString()); Utils::EnvironmentItems environment = QnxUtils::qnxEnvironment(sdpPath.toString());
foreach (const Utils::EnvironmentItem &item, environment) { foreach (const Utils::EnvironmentItem &item, environment) {
if (item.name == QLatin1Literal("QNX_TARGET")) if (item.name == QLatin1String("QNX_TARGET"))
qnxTarget = FilePath::fromString(item.value); qnxTarget = FilePath::fromString(item.value);
} }
} }

View File

@@ -196,9 +196,38 @@ LinuxDevice::LinuxDevice()
} }
}}); }});
setOpenTerminal([this](const Utils::Environment &env, const QString &workingDir) {
DeviceProcess * const proc = createProcess(nullptr);
QObject::connect(proc, &DeviceProcess::finished, [proc] {
if (!proc->errorString().isEmpty()) {
Core::MessageManager::write(tr("Error running remote shell: %1")
.arg(proc->errorString()),
Core::MessageManager::ModeSwitch);
}
proc->deleteLater();
});
QObject::connect(proc, &DeviceProcess::error, [proc] {
Core::MessageManager::write(tr("Error starting remote shell."),
Core::MessageManager::ModeSwitch);
proc->deleteLater();
});
Runnable runnable;
runnable.device = sharedFromThis();
runnable.environment = env;
runnable.workingDirectory = workingDir;
// It seems we cannot pass an environment to OpenSSH dynamically
// without specifying an executable.
if (env.size() > 0)
runnable.executable = "/bin/sh";
proc->setRunInTerminal(true);
proc->start(runnable);
});
if (Utils::HostOsInfo::isAnyUnixHost()) { if (Utils::HostOsInfo::isAnyUnixHost()) {
addDeviceAction({tr("Open Remote Shell"), [](const IDevice::Ptr &device, QWidget *) { addDeviceAction({tr("Open Remote Shell"), [](const IDevice::Ptr &device, QWidget *) {
device.staticCast<LinuxDevice>()->startRemoteShell(Utils::Environment()); device->openTerminal(Utils::Environment(), QString());
}}); }});
} }
} }
@@ -268,36 +297,6 @@ bool LinuxDevice::supportsRSync() const
return extraData("RemoteLinux.SupportsRSync").toBool(); return extraData("RemoteLinux.SupportsRSync").toBool();
} }
void LinuxDevice::startRemoteShell(const Utils::Environment &env) const
{
DeviceProcess * const proc = createProcess(nullptr);
QObject::connect(proc, &DeviceProcess::finished, [proc] {
if (!proc->errorString().isEmpty()) {
Core::MessageManager::write(tr("Error running remote shell: %1")
.arg(proc->errorString()),
Core::MessageManager::ModeSwitch);
}
proc->deleteLater();
});
QObject::connect(proc, &DeviceProcess::error, [proc] {
Core::MessageManager::write(tr("Error starting remote shell."),
Core::MessageManager::ModeSwitch);
proc->deleteLater();
});
Runnable runnable;
runnable.device = sharedFromThis();
runnable.environment = env;
// It seems we cannot pass an environment to OpenSSH dynamically
// without specifying an executable.
if (env.size() > 0)
runnable.executable = "/bin/sh";
proc->setRunInTerminal(true);
proc->start(runnable);
}
namespace Internal { namespace Internal {
// Factory // Factory

View File

@@ -32,8 +32,6 @@
#include <QCoreApplication> #include <QCoreApplication>
namespace Utils { class Environment; }
namespace RemoteLinux { namespace RemoteLinux {
class REMOTELINUX_EXPORT LinuxDevice : public ProjectExplorer::IDevice class REMOTELINUX_EXPORT LinuxDevice : public ProjectExplorer::IDevice
@@ -64,8 +62,6 @@ public:
void setSupportsRsync(bool supportsRsync); void setSupportsRsync(bool supportsRsync);
bool supportsRSync() const; bool supportsRSync() const;
void startRemoteShell(const Utils::Environment &env) const;
protected: protected:
LinuxDevice(); LinuxDevice();
}; };

View File

@@ -78,7 +78,7 @@ RemoteLinuxEnvironmentAspectWidget::RemoteLinuxEnvironmentAspectWidget
} }
const auto linuxDevice = device.dynamicCast<const LinuxDevice>(); const auto linuxDevice = device.dynamicCast<const LinuxDevice>();
QTC_ASSERT(linuxDevice, return); QTC_ASSERT(linuxDevice, return);
linuxDevice->startRemoteShell(env); linuxDevice->openTerminal(env, QString());
}; };
envWidget()->setOpenTerminalFunc(openTerminalFunc); envWidget()->setOpenTerminalFunc(openTerminalFunc);
} }

View File

@@ -226,9 +226,9 @@ void StudioWelcomePlugin::extensionsInitialized()
s_view->setWindowModality(Qt::ApplicationModal); s_view->setWindowModality(Qt::ApplicationModal);
s_view->engine()->addImportPath("qrc:/studiofonts"); s_view->engine()->addImportPath("qrc:/studiofonts");
#ifdef QT_DEBUG #ifdef QT_DEBUG
s_view->engine()->addImportPath(QLatin1Literal(STUDIO_QML_PATH) s_view->engine()->addImportPath(QLatin1String(STUDIO_QML_PATH)
+ "splashscreen/imports"); + "splashscreen/imports");
s_view->setSource(QUrl::fromLocalFile(QLatin1Literal(STUDIO_QML_PATH) s_view->setSource(QUrl::fromLocalFile(QLatin1String(STUDIO_QML_PATH)
+ "splashscreen/main.qml")); + "splashscreen/main.qml"));
#else #else
s_view->engine()->addImportPath("qrc:/qml/splashscreen/imports"); s_view->engine()->addImportPath("qrc:/qml/splashscreen/imports");
@@ -287,9 +287,9 @@ WelcomeMode::WelcomeMode()
m_modeWidget->setResizeMode(QQuickWidget::SizeRootObjectToView); m_modeWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
m_modeWidget->engine()->addImportPath("qrc:/studiofonts"); m_modeWidget->engine()->addImportPath("qrc:/studiofonts");
#ifdef QT_DEBUG #ifdef QT_DEBUG
m_modeWidget->engine()->addImportPath(QLatin1Literal(STUDIO_QML_PATH) m_modeWidget->engine()->addImportPath(QLatin1String(STUDIO_QML_PATH)
+ "welcomepage/imports"); + "welcomepage/imports");
m_modeWidget->setSource(QUrl::fromLocalFile(QLatin1Literal(STUDIO_QML_PATH) m_modeWidget->setSource(QUrl::fromLocalFile(QLatin1String(STUDIO_QML_PATH)
+ "welcomepage/main.qml")); + "welcomepage/main.qml"));
#else #else
m_modeWidget->engine()->addImportPath("qrc:/qml/welcomepage/imports"); m_modeWidget->engine()->addImportPath("qrc:/qml/welcomepage/imports");

View File

@@ -45,6 +45,7 @@
#include <QTimer> #include <QTimer>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils;
namespace Todo { namespace Todo {
namespace Internal { namespace Internal {
@@ -90,7 +91,7 @@ void TodoItemsProvider::updateList()
// Show only items of the current file if any // Show only items of the current file if any
if (m_settings.scanningScope == ScanningScopeCurrentFile) { if (m_settings.scanningScope == ScanningScopeCurrentFile) {
if (m_currentEditor) if (m_currentEditor)
m_itemsList = m_itemsHash.value(m_currentEditor->document()->filePath().toString()); m_itemsList = m_itemsHash.value(m_currentEditor->document()->filePath());
// Show only items of the current sub-project // Show only items of the current sub-project
} else if (m_settings.scanningScope == ScanningScopeSubProject) { } else if (m_settings.scanningScope == ScanningScopeSubProject) {
if (m_startupProject) if (m_startupProject)
@@ -121,21 +122,19 @@ void TodoItemsProvider::createScanners()
void TodoItemsProvider::setItemsListWithinStartupProject() void TodoItemsProvider::setItemsListWithinStartupProject()
{ {
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash); QHashIterator<FilePath, QList<TodoItem> > it(m_itemsHash);
const QSet<QString> fileNames const auto filePaths = QSet<FilePath>::fromList(m_startupProject->files(Project::SourceFiles));
= QSet<QString>::fromList(Utils::transform(m_startupProject->files(Project::SourceFiles),
&Utils::FilePath::toString));
QVariantMap settings = m_startupProject->namedSettings(Constants::SETTINGS_NAME_KEY).toMap(); QVariantMap settings = m_startupProject->namedSettings(Constants::SETTINGS_NAME_KEY).toMap();
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
QString fileName = it.key(); const FilePath filePath = it.key();
if (fileNames.contains(fileName)) { if (filePaths.contains(filePath)) {
bool skip = false; bool skip = false;
for (const QVariant &pattern : settings[Constants::EXCLUDES_LIST_KEY].toList()) { for (const QVariant &pattern : settings[Constants::EXCLUDES_LIST_KEY].toList()) {
QRegExp re(pattern.toString()); QRegExp re(pattern.toString());
if (re.indexIn(fileName) != -1) { if (re.indexIn(filePath.toString()) != -1) {
skip = true; skip = true;
break; break;
} }
@@ -154,22 +153,19 @@ void TodoItemsProvider::setItemsListWithinSubproject()
ProjectNode *projectNode = node->parentProjectNode(); ProjectNode *projectNode = node->parentProjectNode();
if (projectNode) { if (projectNode) {
// FIXME: The name doesn't match the implementation that lists all files. // FIXME: The name doesn't match the implementation that lists all files.
QSet<Utils::FilePath> subprojectFileNames; QSet<FilePath> subprojectFileNames;
projectNode->forEachGenericNode([&](Node *node) { projectNode->forEachGenericNode([&](Node *node) {
subprojectFileNames.insert(node->filePath()); subprojectFileNames.insert(node->filePath());
}); });
// files must be both in the current subproject and the startup-project. // files must be both in the current subproject and the startup-project.
const QSet<QString> fileNames const auto fileNames
= QSet<QString>::fromList(Utils::transform(m_startupProject->files(Project::SourceFiles), = QSet<FilePath>::fromList(m_startupProject->files(Project::SourceFiles));
&Utils::FilePath::toString)); QHashIterator<FilePath, QList<TodoItem> > it(m_itemsHash);
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
if (subprojectFileNames.contains(Utils::FilePath::fromString(it.key())) if (subprojectFileNames.contains(it.key()) && fileNames.contains(it.key()))
&& fileNames.contains(it.key())) {
m_itemsList << it.value(); m_itemsList << it.value();
}
} }
} }
} }
@@ -178,7 +174,7 @@ void TodoItemsProvider::setItemsListWithinSubproject()
void TodoItemsProvider::itemsFetched(const QString &fileName, const QList<TodoItem> &items) void TodoItemsProvider::itemsFetched(const QString &fileName, const QList<TodoItem> &items)
{ {
// Replace old items with new ones // Replace old items with new ones
m_itemsHash.insert(fileName, items); m_itemsHash.insert(FilePath::fromString(fileName), items);
m_shouldUpdateList = true; m_shouldUpdateList = true;
} }

View File

@@ -60,7 +60,7 @@ private:
TodoItemsModel *m_itemsModel; TodoItemsModel *m_itemsModel;
// All to-do items are stored here regardless current scanning scope // All to-do items are stored here regardless current scanning scope
QHash<QString, QList<TodoItem> > m_itemsHash; QHash<Utils::FilePath, QList<TodoItem> > m_itemsHash;
// This list contains only those to-do items that are within current scanning scope // This list contains only those to-do items that are within current scanning scope
QList<TodoItem> m_itemsList; QList<TodoItem> m_itemsList;

View File

@@ -2,3 +2,12 @@ install(
DIRECTORY fonts DIRECTORY fonts
DESTINATION "${IDE_DATA_PATH}" DESTINATION "${IDE_DATA_PATH}"
) )
add_custom_target(copy_fonts_to_builddir ALL VERBATIM)
add_custom_command(TARGET copy_fonts_to_builddir POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory fonts
"${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}/fonts"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT Copy files into build directory
VERBATIM
)

View File

@@ -1,6 +1,6 @@
add_qtc_library(clangbackend_lib STATIC add_qtc_library(clangbackend_lib STATIC
DEPENDS libclang Sqlite ClangSupport DEPENDS libclang Sqlite ClangSupport
DEFINES CLANGSUPPORT_BUILD_LIB PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
PUBLIC_INCLUDES PUBLIC_INCLUDES
${CLANG_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}
SOURCES SOURCES

View File

@@ -1,7 +1,7 @@
add_qtc_library(clangpchmanagerbackend_lib STATIC add_qtc_library(clangpchmanagerbackend_lib STATIC
DEPENDS clangrefactoringbackend_lib ClangSupport DEPENDS clangrefactoringbackend_lib ClangSupport
PUBLIC_DEPENDS libclang PUBLIC_DEPENDS libclang
DEFINES CLANGSUPPORT_BUILD_LIB PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
PUBLIC_INCLUDES PUBLIC_INCLUDES
${CLANG_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}
SOURCES SOURCES

View File

@@ -66,6 +66,12 @@ public:
} }
} }
FilePathIds fetchSources(ProjectPartId projectPartId) const override
{
return fetchProjectPartsFilesStatement.template values<FilePathId>(1024,
projectPartId.projectPathId);
}
void insertOrUpdateFileStatuses(const FileStatuses &fileStatuses) override void insertOrUpdateFileStatuses(const FileStatuses &fileStatuses) override
{ {
WriteStatement &statement = insertOrUpdateFileStatusesStatement; WriteStatement &statement = insertOrUpdateFileStatusesStatement;
@@ -246,6 +252,8 @@ public:
"CONFLICT(sourceId, projectPartId) DO UPDATE SET sourceType = ?003, " "CONFLICT(sourceId, projectPartId) DO UPDATE SET sourceType = ?003, "
"hasMissingIncludes = ?004", "hasMissingIncludes = ?004",
database}; database};
mutable ReadStatement fetchProjectPartsFilesStatement{
"SELECT sourceId FROM projectPartsFiles WHERE projectPartId = ? ORDER BY sourceId", database};
mutable ReadStatement fetchSourceDependenciesStatement{ mutable ReadStatement fetchSourceDependenciesStatement{
"WITH RECURSIVE collectedDependencies(sourceId) AS (VALUES(?) UNION " "WITH RECURSIVE collectedDependencies(sourceId) AS (VALUES(?) UNION "
"SELECT dependencySourceId FROM sourceDependencies, " "SELECT dependencySourceId FROM sourceDependencies, "

View File

@@ -56,6 +56,7 @@ public:
virtual UsedMacros fetchUsedMacros(FilePathId sourceId) const = 0; virtual UsedMacros fetchUsedMacros(FilePathId sourceId) const = 0;
virtual ProjectPartId fetchProjectPartId(Utils::SmallStringView projectPartName) = 0; virtual ProjectPartId fetchProjectPartId(Utils::SmallStringView projectPartName) = 0;
virtual void updatePchCreationTimeStamp(long long pchCreationTimeStamp, ProjectPartId projectPartId) = 0; virtual void updatePchCreationTimeStamp(long long pchCreationTimeStamp, ProjectPartId projectPartId) = 0;
virtual FilePathIds fetchSources(ProjectPartId projectPartId) const = 0;
protected: protected:
~BuildDependenciesStorageInterface() = default; ~BuildDependenciesStorageInterface() = default;

View File

@@ -129,8 +129,7 @@ void BuildDependencyCollector::collect()
auto action = std::make_unique<CollectBuildDependencyToolAction>(m_buildDependency, auto action = std::make_unique<CollectBuildDependencyToolAction>(m_buildDependency,
m_filePathCache, m_filePathCache,
m_excludedFilePaths, m_excludedFilePaths);
m_sourcesManager);
tool.run(action.get()); tool.run(action.get());
} }

View File

@@ -95,7 +95,6 @@ private:
BuildDependency m_buildDependency; BuildDependency m_buildDependency;
ClangBackEnd::FilePaths m_excludedFilePaths; ClangBackEnd::FilePaths m_excludedFilePaths;
Utils::SmallStringVector m_directories; Utils::SmallStringVector m_directories;
SourcesManager m_sourcesManager;
const FilePathCachingInterface &m_filePathCache; const FilePathCachingInterface &m_filePathCache;
const GeneratedFilesInterface &m_generatedFiles; const GeneratedFilesInterface &m_generatedFiles;
const Environment &m_environment; const Environment &m_environment;

View File

@@ -40,15 +40,13 @@ class CollectBuildDependencyAction final : public clang::PreprocessOnlyAction
{ {
public: public:
CollectBuildDependencyAction(BuildDependency &buildDependency, CollectBuildDependencyAction(BuildDependency &buildDependency,
const FilePathCachingInterface &filePathCache, const FilePathCachingInterface &filePathCache,
std::vector<uint> &excludedIncludeUID, std::vector<uint> &excludedIncludeUID,
std::vector<uint> &alreadyIncludedFileUIDs, std::vector<uint> &alreadyIncludedFileUIDs)
SourcesManager &sourcesManager) : m_buildDependency(buildDependency)
: m_buildDependency(buildDependency), , m_filePathCache(filePathCache)
m_filePathCache(filePathCache), , m_excludedIncludeUID(excludedIncludeUID)
m_excludedIncludeUID(excludedIncludeUID), , m_alreadyIncludedFileUIDs(alreadyIncludedFileUIDs)
m_alreadyIncludedFileUIDs(alreadyIncludedFileUIDs),
m_sourcesManager(sourcesManager)
{ {
} }
@@ -66,7 +64,6 @@ public:
m_excludedIncludeUID, m_excludedIncludeUID,
m_alreadyIncludedFileUIDs, m_alreadyIncludedFileUIDs,
compilerInstance.getSourceManager(), compilerInstance.getSourceManager(),
m_sourcesManager,
compilerInstance.getPreprocessorPtr()); compilerInstance.getPreprocessorPtr());
preprocessor.addPPCallbacks( preprocessor.addPPCallbacks(
@@ -88,7 +85,6 @@ private:
const FilePathCachingInterface &m_filePathCache; const FilePathCachingInterface &m_filePathCache;
std::vector<uint> &m_excludedIncludeUID; std::vector<uint> &m_excludedIncludeUID;
std::vector<uint> &m_alreadyIncludedFileUIDs; std::vector<uint> &m_alreadyIncludedFileUIDs;
SourcesManager &m_sourcesManager;
}; };
} // namespace ClangBackEnd } // namespace ClangBackEnd

View File

@@ -54,12 +54,10 @@ public:
const std::vector<uint> &excludedIncludeUID, const std::vector<uint> &excludedIncludeUID,
std::vector<uint> &alreadyIncludedFileUIDs, std::vector<uint> &alreadyIncludedFileUIDs,
clang::SourceManager &sourceManager, clang::SourceManager &sourceManager,
SourcesManager &sourcesManager,
std::shared_ptr<clang::Preprocessor> preprocessor) std::shared_ptr<clang::Preprocessor> preprocessor)
: CollectUsedMacrosAndSourcesPreprocessorCallbacksBase(buildDependency.usedMacros, : CollectUsedMacrosAndSourcesPreprocessorCallbacksBase(buildDependency.usedMacros,
filePathCache, filePathCache,
sourceManager, sourceManager,
sourcesManager,
preprocessor, preprocessor,
buildDependency.sourceDependencies, buildDependency.sourceDependencies,
buildDependency.sourceFiles, buildDependency.sourceFiles,
@@ -189,7 +187,6 @@ public:
{ {
filterOutHeaderGuards(); filterOutHeaderGuards();
mergeUsedMacros(); mergeUsedMacros();
m_sourcesManager.updateModifiedTimeStamps();
filterOutIncludesWithMissingIncludes(); filterOutIncludesWithMissingIncludes();
} }

View File

@@ -38,13 +38,11 @@ class CollectBuildDependencyToolAction final : public clang::tooling::FrontendAc
{ {
public: public:
CollectBuildDependencyToolAction(BuildDependency &buildDependency, CollectBuildDependencyToolAction(BuildDependency &buildDependency,
const FilePathCachingInterface &filePathCache, const FilePathCachingInterface &filePathCache,
const ClangBackEnd::FilePaths &excludedIncludes, const ClangBackEnd::FilePaths &excludedIncludes)
SourcesManager &sourcesManager) : m_buildDependency(buildDependency)
: m_buildDependency(buildDependency), , m_filePathCache(filePathCache)
m_filePathCache(filePathCache), , m_excludedFilePaths(excludedIncludes)
m_excludedFilePaths(excludedIncludes),
m_sourcesManager(sourcesManager)
{} {}
@@ -67,8 +65,7 @@ public:
return new CollectBuildDependencyAction(m_buildDependency, return new CollectBuildDependencyAction(m_buildDependency,
m_filePathCache, m_filePathCache,
m_excludedIncludeUIDs, m_excludedIncludeUIDs,
m_alreadyIncludedFileUIDs, m_alreadyIncludedFileUIDs);
m_sourcesManager);
} }
std::vector<uint> generateExcludedIncludeFileUIDs(clang::FileManager &fileManager) const std::vector<uint> generateExcludedIncludeFileUIDs(clang::FileManager &fileManager) const
@@ -95,7 +92,6 @@ private:
BuildDependency &m_buildDependency; BuildDependency &m_buildDependency;
const FilePathCachingInterface &m_filePathCache; const FilePathCachingInterface &m_filePathCache;
const ClangBackEnd::FilePaths &m_excludedFilePaths; const ClangBackEnd::FilePaths &m_excludedFilePaths;
SourcesManager &m_sourcesManager;
}; };
} // namespace ClangBackEnd } // namespace ClangBackEnd

View File

@@ -39,13 +39,11 @@ class CollectUsedMacrosToolActionFactory final : public clang::tooling::Frontend
public: public:
CollectUsedMacrosToolActionFactory(UsedMacros &usedMacros, CollectUsedMacrosToolActionFactory(UsedMacros &usedMacros,
FilePathCachingInterface &filePathCache, FilePathCachingInterface &filePathCache,
SourcesManager &sourcesManager,
SourceDependencies &sourceDependencies, SourceDependencies &sourceDependencies,
FilePathIds &sourceFiles, FilePathIds &sourceFiles,
FileStatuses &fileStatuses) FileStatuses &fileStatuses)
: m_usedMacros(usedMacros), : m_usedMacros(usedMacros),
m_filePathCache(filePathCache), m_filePathCache(filePathCache),
m_sourcesManager(sourcesManager),
m_sourceDependencies(sourceDependencies), m_sourceDependencies(sourceDependencies),
m_sourceFiles(sourceFiles), m_sourceFiles(sourceFiles),
m_fileStatuses(fileStatuses) m_fileStatuses(fileStatuses)
@@ -67,7 +65,6 @@ public:
{ {
return new CollectUsedMacrosAction(m_usedMacros, return new CollectUsedMacrosAction(m_usedMacros,
m_filePathCache, m_filePathCache,
m_sourcesManager,
m_sourceDependencies, m_sourceDependencies,
m_sourceFiles, m_sourceFiles,
m_fileStatuses); m_fileStatuses);
@@ -76,7 +73,6 @@ public:
private: private:
UsedMacros &m_usedMacros; UsedMacros &m_usedMacros;
FilePathCachingInterface &m_filePathCache; FilePathCachingInterface &m_filePathCache;
SourcesManager &m_sourcesManager;
SourceDependencies &m_sourceDependencies; SourceDependencies &m_sourceDependencies;
FilePathIds &m_sourceFiles; FilePathIds &m_sourceFiles;
FileStatuses &m_fileStatuses; FileStatuses &m_fileStatuses;

View File

@@ -41,13 +41,11 @@ class CollectUsedMacrosAction final : public clang::PreprocessOnlyAction
public: public:
CollectUsedMacrosAction(UsedMacros &usedMacros, CollectUsedMacrosAction(UsedMacros &usedMacros,
FilePathCachingInterface &filePathCache, FilePathCachingInterface &filePathCache,
SourcesManager &sourcesManager,
SourceDependencies &sourceDependencies, SourceDependencies &sourceDependencies,
FilePathIds &sourceFiles, FilePathIds &sourceFiles,
FileStatuses &fileStatuses) FileStatuses &fileStatuses)
: m_usedMacros(usedMacros), : m_usedMacros(usedMacros),
m_filePathCache(filePathCache), m_filePathCache(filePathCache),
m_sourcesManager(sourcesManager),
m_sourceDependencies(sourceDependencies), m_sourceDependencies(sourceDependencies),
m_sourceFiles(sourceFiles), m_sourceFiles(sourceFiles),
m_fileStatuses(fileStatuses) m_fileStatuses(fileStatuses)
@@ -65,7 +63,6 @@ public:
m_usedMacros, m_usedMacros,
m_filePathCache, m_filePathCache,
compilerInstance.getSourceManager(), compilerInstance.getSourceManager(),
m_sourcesManager,
compilerInstance.getPreprocessorPtr(), compilerInstance.getPreprocessorPtr(),
m_sourceDependencies, m_sourceDependencies,
m_sourceFiles, m_sourceFiles,
@@ -87,7 +84,6 @@ public:
private: private:
UsedMacros &m_usedMacros; UsedMacros &m_usedMacros;
FilePathCachingInterface &m_filePathCache; FilePathCachingInterface &m_filePathCache;
SourcesManager &m_sourcesManager;
SourceDependencies &m_sourceDependencies; SourceDependencies &m_sourceDependencies;
FilePathIds &m_sourceFiles; FilePathIds &m_sourceFiles;
FileStatuses &m_fileStatuses; FileStatuses &m_fileStatuses;

View File

@@ -54,17 +54,16 @@ public:
CollectUsedMacrosAndSourcesPreprocessorCallbacksBase(UsedMacros &usedMacros, CollectUsedMacrosAndSourcesPreprocessorCallbacksBase(UsedMacros &usedMacros,
const FilePathCachingInterface &filePathCache, const FilePathCachingInterface &filePathCache,
const clang::SourceManager &sourceManager, const clang::SourceManager &sourceManager,
SourcesManager &sourcesManager,
std::shared_ptr<clang::Preprocessor> preprocessor, std::shared_ptr<clang::Preprocessor> preprocessor,
SourceDependencies &sourceDependencies, SourceDependencies &sourceDependencies,
FilePathIds &sourceFiles, FilePathIds &sourceFiles,
FileStatuses &fileStatuses) FileStatuses &fileStatuses)
: SymbolsVisitorBase(filePathCache, &sourceManager, sourcesManager), : SymbolsVisitorBase(filePathCache, &sourceManager, m_filePathIndices)
m_usedMacros(usedMacros), , m_usedMacros(usedMacros)
m_preprocessor(preprocessor), , m_preprocessor(preprocessor)
m_sourceDependencies(sourceDependencies), , m_sourceDependencies(sourceDependencies)
m_sourceFiles(sourceFiles), , m_sourceFiles(sourceFiles)
m_fileStatuses(fileStatuses) , m_fileStatuses(fileStatuses)
{} {}
void addSourceFile(const clang::FileEntry *fileEntry) void addSourceFile(const clang::FileEntry *fileEntry)
@@ -166,6 +165,7 @@ public:
private: private:
UsedMacros m_maybeUsedMacros; UsedMacros m_maybeUsedMacros;
FilePathIds m_filePathIndices;
UsedMacros &m_usedMacros; UsedMacros &m_usedMacros;
std::shared_ptr<clang::Preprocessor> m_preprocessor; std::shared_ptr<clang::Preprocessor> m_preprocessor;
SourceDependencies &m_sourceDependencies; SourceDependencies &m_sourceDependencies;
@@ -248,7 +248,6 @@ public:
{ {
filterOutHeaderGuards(); filterOutHeaderGuards();
mergeUsedMacros(); mergeUsedMacros();
m_sourcesManager.updateModifiedTimeStamps();
} }
private: private:

View File

@@ -113,8 +113,11 @@ Utils::SmallStringVector PchCreator::generateClangCompilerArguments(const PchTas
void PchCreator::generatePch(PchTask &&pchTask) void PchCreator::generatePch(PchTask &&pchTask)
{ {
m_projectPartPch.projectPartId = pchTask.projectPartId(); m_projectPartPch.projectPartId = pchTask.projectPartId();
m_projectPartPch.lastModified = QDateTime::currentSecsSinceEpoch(); m_projectPartPch.lastModified = QDateTime::currentSecsSinceEpoch();
if (pchTask.includes.empty())
return;
auto content = generatePchIncludeFileContent(pchTask.includes); auto content = generatePchIncludeFileContent(pchTask.includes);
auto pchOutputPath = generatePchFilePath(); auto pchOutputPath = generatePchFilePath();
@@ -180,7 +183,7 @@ void PchCreator::doInMainThreadAfterFinished()
m_buildDependenciesStorage.updatePchCreationTimeStamp(m_projectPartPch.lastModified, m_buildDependenciesStorage.updatePchCreationTimeStamp(m_projectPartPch.lastModified,
m_projectPartPch.projectPartId); m_projectPartPch.projectPartId);
m_clangPathwatcher.updateIdPaths({{m_projectPartPch.projectPartId, existingSources}}); m_clangPathwatcher.updateIdPaths({{m_projectPartPch.projectPartId, existingSources}});
m_pchManagerClient.precompiledHeadersUpdated({m_projectPartPch}); m_pchManagerClient.precompiledHeadersUpdated({m_projectPartPch.projectPartId});
} }
} }

View File

@@ -34,6 +34,7 @@
#include <updategeneratedfilesmessage.h> #include <updategeneratedfilesmessage.h>
#include <updateprojectpartsmessage.h> #include <updateprojectpartsmessage.h>
#include <utils/algorithm.h>
#include <utils/smallstring.h> #include <utils/smallstring.h>
#include <QApplication> #include <QApplication>
@@ -57,18 +58,29 @@ void PchManagerServer::end()
QCoreApplication::exit(); QCoreApplication::exit();
} }
namespace {
ProjectPartIds toProjectPartIds(const ProjectPartContainers &projectParts)
{
return Utils::transform<ProjectPartIds>(projectParts, [](const auto &projectPart) {
return projectPart.projectPartId;
});
}
} // namespace
void PchManagerServer::updateProjectParts(UpdateProjectPartsMessage &&message) void PchManagerServer::updateProjectParts(UpdateProjectPartsMessage &&message)
{ {
m_toolChainsArgumentsCache.update(message.projectsParts, message.toolChainArguments); m_toolChainsArgumentsCache.update(message.projectsParts, message.toolChainArguments);
ProjectPartContainers newProjectParts = m_projectPartsManager.update(message.takeProjectsParts()); auto upToDateProjectParts = m_projectPartsManager.update(message.takeProjectsParts());
if (m_generatedFiles.isValid()) { if (m_generatedFiles.isValid()) {
m_pchTaskGenerator.addProjectParts(std::move(newProjectParts), m_pchTaskGenerator.addProjectParts(std::move(upToDateProjectParts.notUpToDate),
std::move(message.toolChainArguments)); std::move(message.toolChainArguments));
} else { } else {
m_projectPartsManager.updateDeferred(newProjectParts); m_projectPartsManager.updateDeferred(upToDateProjectParts.notUpToDate);
} }
client()->precompiledHeadersUpdated(toProjectPartIds(upToDateProjectParts.upToDate));
} }
void PchManagerServer::removeProjectParts(RemoveProjectPartsMessage &&message) void PchManagerServer::removeProjectParts(RemoveProjectPartsMessage &&message)

View File

@@ -33,6 +33,8 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <iostream>
namespace ClangBackEnd { namespace ClangBackEnd {
void PchTaskQueue::addPchTasks(PchTasks &&newPchTasks, PchTasks &destination) void PchTaskQueue::addPchTasks(PchTasks &&newPchTasks, PchTasks &destination)
@@ -145,7 +147,6 @@ std::vector<PchTaskQueue::Task> PchTaskQueue::createProjectTasks(PchTasks &&pchT
auto convert = [this](auto &&pchTask) { auto convert = [this](auto &&pchTask) {
return [pchTask = std::move(pchTask), this](PchCreatorInterface &pchCreator) mutable { return [pchTask = std::move(pchTask), this](PchCreatorInterface &pchCreator) mutable {
const auto projectPartId = pchTask.projectPartId(); const auto projectPartId = pchTask.projectPartId();
if (pchTask.includes.size()) {
pchTask.systemPchPath = m_precompiledHeaderStorage.fetchSystemPrecompiledHeaderPath( pchTask.systemPchPath = m_precompiledHeaderStorage.fetchSystemPrecompiledHeaderPath(
projectPartId); projectPartId);
pchTask.preIncludeSearchPath = m_environment.preIncludeSearchPath(); pchTask.preIncludeSearchPath = m_environment.preIncludeSearchPath();
@@ -157,9 +158,6 @@ std::vector<PchTaskQueue::Task> PchTaskQueue::createProjectTasks(PchTasks &&pchT
m_precompiledHeaderStorage.insertProjectPrecompiledHeader( m_precompiledHeaderStorage.insertProjectPrecompiledHeader(
projectPartId, projectPartPch.pchPath, projectPartPch.lastModified); projectPartId, projectPartPch.pchPath, projectPartPch.lastModified);
} }
} else {
m_precompiledHeaderStorage.deleteProjectPrecompiledHeader(projectPartId);
}
}; };
}; };
@@ -179,7 +177,6 @@ std::vector<PchTaskQueue::Task> PchTaskQueue::createSystemTasks(PchTasks &&pchTa
auto convert = [this](auto &&pchTask) { auto convert = [this](auto &&pchTask) {
return [pchTask = std::move(pchTask), this](PchCreatorInterface &pchCreator) mutable { return [pchTask = std::move(pchTask), this](PchCreatorInterface &pchCreator) mutable {
const auto projectPartIds = pchTask.projectPartIds; const auto projectPartIds = pchTask.projectPartIds;
if (pchTask.includes.size()) {
pchTask.preIncludeSearchPath = m_environment.preIncludeSearchPath(); pchTask.preIncludeSearchPath = m_environment.preIncludeSearchPath();
pchCreator.generatePch(std::move(pchTask)); pchCreator.generatePch(std::move(pchTask));
const auto &projectPartPch = pchCreator.projectPartPch(); const auto &projectPartPch = pchCreator.projectPartPch();
@@ -189,9 +186,6 @@ std::vector<PchTaskQueue::Task> PchTaskQueue::createSystemTasks(PchTasks &&pchTa
m_precompiledHeaderStorage.insertSystemPrecompiledHeaders( m_precompiledHeaderStorage.insertSystemPrecompiledHeaders(
projectPartIds, projectPartPch.pchPath, projectPartPch.lastModified); projectPartIds, projectPartPch.pchPath, projectPartPch.lastModified);
} }
} else {
m_precompiledHeaderStorage.deleteSystemPrecompiledHeaders(projectPartIds);
}
}; };
}; };

View File

@@ -44,34 +44,35 @@ ProjectPartIds toProjectPartIds(const ProjectPartContainers &projectsParts)
return ids; return ids;
} }
ProjectPartContainers ProjectPartsManager::update(ProjectPartContainers &&projectsParts) ProjectPartsManager::UpToDataProjectParts ProjectPartsManager::update(ProjectPartContainers &&projectsParts)
{ {
auto updatedProjectParts = filterNewProjectParts(std::move(projectsParts), m_projectParts); auto notUpToDateProjectParts = filterProjectParts(projectsParts, m_projectParts);
if (updatedProjectParts.empty()) if (notUpToDateProjectParts.empty())
return {}; return {std::move(projectsParts), {}};
auto persistentProjectParts = m_projectPartsStorage.fetchProjectParts( auto persistentProjectParts = m_projectPartsStorage.fetchProjectParts(
toProjectPartIds(updatedProjectParts)); toProjectPartIds(notUpToDateProjectParts));
if (persistentProjectParts.size() > 0) { if (persistentProjectParts.size() > 0) {
mergeProjectParts(persistentProjectParts); mergeProjectParts(persistentProjectParts);
updatedProjectParts = filterNewProjectParts(std::move(updatedProjectParts), notUpToDateProjectParts = filterProjectParts(notUpToDateProjectParts, persistentProjectParts);
persistentProjectParts);
if (updatedProjectParts.empty()) if (notUpToDateProjectParts.empty())
return {}; return {};
} }
m_projectPartsStorage.updateProjectParts(updatedProjectParts); m_projectPartsStorage.updateProjectParts(notUpToDateProjectParts);
m_projectPartsStorage.resetIndexingTimeStamps(updatedProjectParts); m_projectPartsStorage.resetIndexingTimeStamps(notUpToDateProjectParts);
m_precompiledHeaderStorage.deleteProjectPrecompiledHeaders( m_precompiledHeaderStorage.deleteProjectPrecompiledHeaders(
toProjectPartIds(updatedProjectParts)); toProjectPartIds(notUpToDateProjectParts));
mergeProjectParts(updatedProjectParts); mergeProjectParts(notUpToDateProjectParts);
return updatedProjectParts; auto upToDateProjectParts = filterProjectParts(projectsParts, notUpToDateProjectParts);
return {upToDateProjectParts, notUpToDateProjectParts};
} }
void ProjectPartsManager::remove(const ProjectPartIds &projectPartIds) void ProjectPartsManager::remove(const ProjectPartIds &projectPartIds)
@@ -176,8 +177,8 @@ ProjectPartContainers ProjectPartsManager::deferredUpdates()
return deferredProjectParts; return deferredProjectParts;
} }
ProjectPartContainers ProjectPartsManager::filterNewProjectParts( ProjectPartContainers ProjectPartsManager::filterProjectParts(
ProjectPartContainers &&projectsParts, const ProjectPartContainers &oldProjectParts) const ProjectPartContainers &projectsParts, const ProjectPartContainers &oldProjectParts)
{ {
ProjectPartContainers updatedProjectPartContainers; ProjectPartContainers updatedProjectPartContainers;
updatedProjectPartContainers.reserve(projectsParts.size()); updatedProjectPartContainers.reserve(projectsParts.size());

View File

@@ -36,6 +36,7 @@
namespace ClangBackEnd { namespace ClangBackEnd {
inline namespace Pch { inline namespace Pch {
class ProjectPartsManager final : public ProjectPartsManagerInterface class ProjectPartsManager final : public ProjectPartsManagerInterface
{ {
public: public:
@@ -45,14 +46,14 @@ public:
, m_precompiledHeaderStorage(precompiledHeaderStorage) , m_precompiledHeaderStorage(precompiledHeaderStorage)
{} {}
ProjectPartContainers update(ProjectPartContainers &&projectsParts) override; UpToDataProjectParts update(ProjectPartContainers &&projectsParts) override;
void remove(const ProjectPartIds &projectPartIds) override; void remove(const ProjectPartIds &projectPartIds) override;
ProjectPartContainers projects(const ProjectPartIds &projectPartIds) const override; ProjectPartContainers projects(const ProjectPartIds &projectPartIds) const override;
void updateDeferred(const ProjectPartContainers &projectsParts) override; void updateDeferred(const ProjectPartContainers &projectsParts) override;
ProjectPartContainers deferredUpdates() override; ProjectPartContainers deferredUpdates() override;
static ProjectPartContainers filterNewProjectParts(ProjectPartContainers &&newProjectsParts, static ProjectPartContainers filterProjectParts(const ProjectPartContainers &newProjectsParts,
const ProjectPartContainers &oldProjectParts); const ProjectPartContainers &oldProjectParts);
void mergeProjectParts(const ProjectPartContainers &projectsParts); void mergeProjectParts(const ProjectPartContainers &projectsParts);
const ProjectPartContainers &projectParts() const; const ProjectPartContainers &projectParts() const;

View File

@@ -32,11 +32,18 @@ namespace ClangBackEnd {
class ProjectPartsManagerInterface class ProjectPartsManagerInterface
{ {
public: public:
class UpToDataProjectParts
{
public:
ProjectPartContainers upToDate;
ProjectPartContainers notUpToDate;
};
ProjectPartsManagerInterface() = default; ProjectPartsManagerInterface() = default;
ProjectPartsManagerInterface(const ProjectPartsManagerInterface &) = delete; ProjectPartsManagerInterface(const ProjectPartsManagerInterface &) = delete;
ProjectPartsManagerInterface &operator=(const ProjectPartsManagerInterface &) = delete; ProjectPartsManagerInterface &operator=(const ProjectPartsManagerInterface &) = delete;
virtual ProjectPartContainers update(ProjectPartContainers &&projectsParts) = 0; virtual UpToDataProjectParts update(ProjectPartContainers &&projectsParts) = 0;
virtual void remove(const ProjectPartIds &projectPartIds) = 0; virtual void remove(const ProjectPartIds &projectPartIds) = 0;
virtual ProjectPartContainers projects(const ProjectPartIds &projectPartIds) const = 0; virtual ProjectPartContainers projects(const ProjectPartIds &projectPartIds) const = 0;
virtual void updateDeferred(const ProjectPartContainers &projectsParts) = 0; virtual void updateDeferred(const ProjectPartContainers &projectsParts) = 0;

View File

@@ -48,7 +48,6 @@ void UsedMacroAndSourcesCollector::collect()
auto action = std::make_unique<CollectUsedMacrosToolActionFactory>( auto action = std::make_unique<CollectUsedMacrosToolActionFactory>(
m_usedMacros, m_usedMacros,
m_filePathCache, m_filePathCache,
m_sourcesManager,
m_sourceDependencies, m_sourceDependencies,
m_sourceFiles, m_sourceFiles,
m_fileStatuses); m_fileStatuses);

View File

@@ -74,7 +74,6 @@ public:
private: private:
ClangTool m_clangTool; ClangTool m_clangTool;
SourcesManager m_sourcesManager;
UsedMacros m_usedMacros; UsedMacros m_usedMacros;
FilePathCachingInterface &m_filePathCache; FilePathCachingInterface &m_filePathCache;
FilePathIds m_sourceFiles; FilePathIds m_sourceFiles;

View File

@@ -6,7 +6,7 @@ add_qtc_library(clangrefactoringbackend_lib STATIC
clangHandleCXX clangIndex clangLex clangHandleCXX clangIndex clangLex
clangSerialization clangTooling clangQuery clangSerialization clangTooling clangQuery
ClangSupport ClangSupport
DEFINES CLANGSUPPORT_BUILD_LIB PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
PUBLIC_INCLUDES PUBLIC_INCLUDES
${CLANG_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}
"../../clangpchmanagerbackend/source" "../../clangpchmanagerbackend/source"
@@ -20,6 +20,7 @@ add_qtc_library(clangrefactoringbackend_lib STATIC
collectsymbolsaction.cpp collectsymbolsaction.h collectsymbolsaction.cpp collectsymbolsaction.h
filestatus.h filestatus.h
filestatuscache.cpp filestatuscache.h filestatuscache.cpp filestatuscache.h
filestatuspreprocessorcallbacks.cpp filestatuspreprocessorcallbacks.h
findcursorusr.h findcursorusr.h
findlocationsofusrs.h findlocationsofusrs.h
findusrforcursoraction.cpp findusrforcursoraction.h findusrforcursoraction.cpp findusrforcursoraction.h

View File

@@ -2,6 +2,7 @@ INCLUDEPATH += $$PWD
HEADERS += \ HEADERS += \
$$PWD/clangrefactoringbackend_global.h \ $$PWD/clangrefactoringbackend_global.h \
$$PWD/filestatuspreprocessorcallbacks.h \
$$PWD/sourcerangefilter.h \ $$PWD/sourcerangefilter.h \
$$PWD/symbolindexer.h \ $$PWD/symbolindexer.h \
$$PWD/symbolentry.h \ $$PWD/symbolentry.h \
@@ -64,6 +65,7 @@ HEADERS += \
} }
SOURCES += \ SOURCES += \
$$PWD/filestatuspreprocessorcallbacks.cpp \
$$PWD/sourcerangefilter.cpp \ $$PWD/sourcerangefilter.cpp \
$$PWD/symbolindexer.cpp \ $$PWD/symbolindexer.cpp \
$$PWD/filestatuscache.cpp $$PWD/filestatuscache.cpp

View File

@@ -56,18 +56,16 @@ public:
SourceDependencies &sourceDependencies, SourceDependencies &sourceDependencies,
FilePathCachingInterface &filePathCache, FilePathCachingInterface &filePathCache,
const clang::SourceManager &sourceManager, const clang::SourceManager &sourceManager,
std::shared_ptr<clang::Preprocessor> &&preprocessor, std::shared_ptr<clang::Preprocessor> &&preprocessor)
SourcesManager &sourcesManager)
: CollectUsedMacrosAndSourcesPreprocessorCallbacksBase(usedMacros, : CollectUsedMacrosAndSourcesPreprocessorCallbacksBase(usedMacros,
filePathCache, filePathCache,
sourceManager, sourceManager,
sourcesManager,
std::move(preprocessor), std::move(preprocessor),
sourceDependencies, sourceDependencies,
sourceFiles, sourceFiles,
fileStatuses), fileStatuses)
m_symbolEntries(symbolEntries), , m_symbolEntries(symbolEntries)
m_sourceLocationEntries(sourceLocationEntries) , m_sourceLocationEntries(sourceLocationEntries)
{ {
} }
@@ -88,17 +86,15 @@ public:
} }
void InclusionDirective(clang::SourceLocation hashLocation, void InclusionDirective(clang::SourceLocation hashLocation,
const clang::Token &/*includeToken*/, const clang::Token & /*includeToken*/,
llvm::StringRef /*fileName*/, llvm::StringRef /*fileName*/,
bool /*isAngled*/, bool /*isAngled*/,
clang::CharSourceRange /*fileNameRange*/, clang::CharSourceRange /*fileNameRange*/,
const clang::FileEntry *file, const clang::FileEntry *file,
llvm::StringRef /*searchPath*/, llvm::StringRef /*searchPath*/,
llvm::StringRef /*relativePath*/, llvm::StringRef /*relativePath*/,
const clang::Module * /*imported*/ const clang::Module * /*imported*/,
#if LLVM_VERSION_MAJOR >= 7 clang::SrcMgr::CharacteristicKind /*fileType*/
, clang::SrcMgr::CharacteristicKind /*fileType*/
#endif
) override ) override
{ {
if (!m_skipInclude && file) if (!m_skipInclude && file)
@@ -174,7 +170,6 @@ public:
{ {
filterOutHeaderGuards(); filterOutHeaderGuards();
mergeUsedMacros(); mergeUsedMacros();
m_sourcesManager.updateModifiedTimeStamps();
} }
static const clang::MacroInfo *firstMacroInfo(const clang::MacroDirective *macroDirective) static const clang::MacroInfo *firstMacroInfo(const clang::MacroDirective *macroDirective)

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