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
* Removed `Experimental` flag
* Added option for starting server when needed
* Added option for starting one server per project
* 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 support for drag & drop in Projects tree (QTCREATORBUG-6446)
* 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)
* Added `Re-detect` and `Remove All` to compiler settings
* 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 forced `qmake` run on rebuild
* Fixed building sub-project in case of additional custom make steps (QTCREATORBUG-15794)
* Fixed missing items from `OBJECTIVE_HEADERS` (QTCREATORBUG-17569)
## CMake Projects
@@ -102,9 +104,12 @@ you can check out from the public Git repository. For example:
## QML Support
* Fixed various formatting issues
## Debugging
* Added pretty printer for `QMargin`
* Fixed issues with restoring layout (QTCREATORBUG-21669)
### CDB
@@ -120,7 +125,10 @@ you can check out from the public Git repository. For example:
* Added support for `ShapeGradient` (QDS-359)
* 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`
* Improved handling of errors in state editor (QDS-695)
## Version Control Systems
@@ -191,13 +199,16 @@ Denis Shienkov
Denis Vygovskiy
Eike Ziller
Friedemann Kleint
Giuseppe D'Angelo
Haxor Leet
Henning Gruendl
illiteratecoder
Ivan Donchevskii
Ivan Komissarov
Joel Smith
Jörg Bornemann
Kavindra Palaraja
Leena Miettinen
Luca Carlon
Marco Bubke
Martin Haase
@@ -213,5 +224,6 @@ Tim Henning
Tim Jenssen
Tobias Hunger
Tor Arne Vestbø
Uladzislau Paulovich
Ulf Hermann
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/
**
** This file is part of the Qt Creator documentation.
@@ -93,10 +93,10 @@
\li \l{Using Language Servers}
The experimental language client provides code completion,
highlighting of the symbol under cursor, and jumping to the symbol
definition for other programming languages besides C++. In addition,
it integrates diagnostics from the language server.
The language client provides code completion, highlighting of the
symbol under cursor, and jumping to the symbol definition for other
programming languages besides C++. In addition, it integrates
diagnostics from the language server.
\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/
**
** This file is part of the Qt Creator documentation.
@@ -99,7 +99,7 @@
\section1 Using Locator Filters
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
@@ -114,11 +114,11 @@
\li Locating bookmarks (\c {b}).
For more information, see \l{Using Bookmarks}.
\li Locating class (\c {c}), enum, and function (m) definitions in your
project or anywhere referenced from your project (\c {:})
\li Locating class (\c {c}), enum, and function (\c {m}) definitions in
your project or anywhere referenced from your project (\c {:})
\endif
\li Locating QML methods (m)
\li Locating QML methods (\c {m})
\li Locating symbols in the current document (\c {.})

View File

@@ -39,8 +39,9 @@
\list
\li \l{Completing Code}{Code completion}
\li Highlighting the symbol under cursor
\li \l{Moving to Symbol Definition or Declaration}
{Moving to the symbol definition}
\li Navigating in the code by using the \l{Searching with the Locator}
{locator} or \l{Moving to Symbol Definition or Declaration}
{moving to the symbol definition}
\li Inspecting code by viewing the document
\l{Viewing Defined Types and Symbols}{outline}
\li \l{Finding Symbols}{Finding references to symbols}
@@ -50,8 +51,10 @@
By providing a client for the language server protocol, \QC can support
the above features for several other programming languages besides C++.
However, the experimental client does not support language servers that
require special handling.
However, the client does not support language servers that require special
handling.
\section1 Adding MIME Types for Language Servers
\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
@@ -62,21 +65,11 @@
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}.
The experimental language service client has been mostly tested with Python.
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.
\section1 Specifying Settings for Language Clients
To use a language server:
\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 >
\uicontrol {Language Client} (or \uicontrol {Qt Creator} >
\uicontrol Preferences > \uicontrol {Language Client} > on
@@ -86,15 +79,48 @@
language server.
\li Select \uicontrol Add to add language servers.
\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
\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
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
server executable.
\li In the \uicontrol Arguments field, enter any required command line
arguments. Select \uicontrol Variables to use variables as
arguments.
\endlist
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/
**
** 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
\page creator-help.html
@@ -62,7 +56,6 @@
\li To select and configure how the documentation is displayed in the
\uicontrol Help mode, select \uicontrol Tools > \uicontrol Options > \uicontrol Help.
\endlist
The following image displays the context sensitive help in the \uicontrol Edit
@@ -70,6 +63,19 @@
\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
To hide function tooltips by default, select \uicontrol {Tools > Options >
@@ -127,17 +133,19 @@
\endlist
To import and export bookmarks, select \uicontrol {Tools > Options > Help >
General Settings > Import} or \uicontrol Export.
To import and export bookmarks, select \uicontrol Tools > \uicontrol Options
> \uicontrol Help > \uicontrol General > \uicontrol {Import Bookmarks} or
\uicontrol {Export Bookmarks}.
\section2 Full-text Search
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}
field, enter the term you are looking for, and select the \uicontrol Search
button. All documents that contain the specified term are listed. The list
is sorted by the number of search hits that the documents contain. Select a
document in the list to open it.
particular word in all the installed documents. Enter the term you are
looking for, and select the \uicontrol Search button. All documents that
contain the specified term are listed. The list is sorted by document
version (if you have installed several Qt versions, for example) and
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"
@@ -159,12 +167,6 @@
\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
time when you open the \uicontrol Search pane. If you add or remove documents,
\QC recreates the index.

View File

@@ -110,6 +110,46 @@
documentation, see \l{Tips and Tricks}.
\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
This section describes the cases where the behavior of \QC depends on the
@@ -296,7 +336,7 @@
\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:
@@ -334,6 +374,9 @@
up in the pane. In these panes, you can also use the zoom buttons to increase and
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
\if defined(qtcreator)
\l{Using Version Control Systems}{Version Control}
@@ -404,7 +447,7 @@
\uicontrol {Filter Tree}
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
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
\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
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
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
code editor.
@@ -563,42 +611,4 @@
\l{Showing Task List Files in Issues Pane}.
\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/
**
** 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
provide you with useful features, such as semantic highlighting,
checking code syntax, code completion, and refactoring actions.
In addition, the experimental language server plugin provides
some of these services for other programming languages, such as
Python, for which a \e {language server} is available that
provides information about the code to IDEs.
\QC supports some of these services also for other programming
languages, such as Python, for which a \e {language server} is
available that provides information about the code to IDEs.
For more information, see \l{Coding}.
\row
\li \inlineimage creator_buildingrunning.png

View File

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

View File

@@ -33,6 +33,15 @@ add_qtc_library(KSyntaxHighlighting STATIC
)
install(
DIRECTORY data/
DIRECTORY data/syntax
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
ipcclientprovider.h
ipcinterface.h
ipcserverinterface.cpp ipcserverinterface.h
ipcserverinterface.h
lineprefixer.cpp lineprefixer.h
messageenvelop.cpp messageenvelop.h
modifiedtimechecker.h
@@ -93,7 +93,6 @@ add_qtc_library(ClangSupport
projectpartcontainer.cpp projectpartcontainer.h
projectpartid.h
projectpartpch.cpp projectpartpch.h
projectpartpchproviderinterface.h
projectpartsstorage.h
projectpartsstorageinterface.h
readmessageblock.cpp readmessageblock.h

View File

@@ -204,7 +204,6 @@ HEADERS += \
$$PWD/nativefilepath.h \
$$PWD/filepathview.h \
$$PWD/compilermacro.h \
$$PWD/projectpartpchproviderinterface.h \
$$PWD/updategeneratedfilesmessage.h \
$$PWD/removegeneratedfilesmessage.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
#include "projectpartpch.h"
#include "clangsupport_global.h"
#include "projectpartid.h"
#include <utils/smallstringio.h>
namespace ClangBackEnd {
@@ -33,29 +36,26 @@ class PrecompiledHeadersUpdatedMessage
{
public:
PrecompiledHeadersUpdatedMessage() = default;
PrecompiledHeadersUpdatedMessage(ProjectPartPch projectPartPch)
PrecompiledHeadersUpdatedMessage(ProjectPartId projectPartId)
{
projectPartPchs.push_back(projectPartPch);
projectPartIds.push_back(projectPartId);
}
PrecompiledHeadersUpdatedMessage(ProjectPartPchs &&projectPartPchs)
: projectPartPchs(std::move(projectPartPchs))
PrecompiledHeadersUpdatedMessage(ProjectPartIds &&projectPartIds)
: projectPartIds(std::move(projectPartIds))
{}
ProjectPartPchs takeProjectPartPchs() const
{
return std::move(projectPartPchs);
}
ProjectPartIds takeProjectPartIds() const { return std::move(projectPartIds); }
friend QDataStream &operator<<(QDataStream &out, const PrecompiledHeadersUpdatedMessage &message)
{
out << message.projectPartPchs;
out << message.projectPartIds;
return out;
}
friend QDataStream &operator>>(QDataStream &in, PrecompiledHeadersUpdatedMessage &message)
{
in >> message.projectPartPchs;
in >> message.projectPartIds;
return in;
}
@@ -63,16 +63,13 @@ public:
friend bool operator==(const PrecompiledHeadersUpdatedMessage &first,
const PrecompiledHeadersUpdatedMessage &second)
{
return first.projectPartPchs == second.projectPartPchs;
return first.projectPartIds == second.projectPartIds;
}
PrecompiledHeadersUpdatedMessage clone() const
{
return PrecompiledHeadersUpdatedMessage(Utils::clone(projectPartPchs));
}
PrecompiledHeadersUpdatedMessage clone() const { return *this; }
public:
ProjectPartPchs projectPartPchs;
ProjectPartIds projectPartIds;
};
CLANGSUPPORT_EXPORT QDebug operator<<(QDebug debug, const PrecompiledHeadersUpdatedMessage &message);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -17,12 +17,9 @@ SOURCES += \
sqliteworkerthread.cpp \
sqlitewritestatement.cpp \
sqlstatementbuilder.cpp \
sqlstatementbuilderexception.cpp \
utf8string.cpp \
utf8stringvector.cpp \
sqlitedatabase.cpp \
sqlitetable.cpp \
sqlitecolumn.cpp \
tablewriteworker.cpp \
tablewriteworkerproxy.cpp
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
#include "sqlitedatabasebackend.h"
#include "sqlitedatabaseinterface.h"
#include "sqliteglobal.h"
#include "sqlitetable.h"
#include "sqlitetransaction.h"
@@ -43,7 +44,7 @@ using namespace std::chrono_literals;
class ReadStatement;
class WriteStatement;
class SQLITE_EXPORT Database final : public TransactionInterface
class SQLITE_EXPORT Database final : public TransactionInterface, public DatabaseInterface
{
template <typename Database>
friend class Statement;
@@ -105,19 +106,18 @@ public:
return m_databaseBackend.changesCount();
}
int totalChangesCount()
{
return m_databaseBackend.totalChangesCount();
}
int totalChangesCount() { return m_databaseBackend.totalChangesCount(); }
void walCheckpointFull() override { m_databaseBackend.walCheckpointFull(); }
private:
void deferredBegin();
void immediateBegin();
void exclusiveBegin();
void commit();
void rollback();
void lock();
void unlock();
void deferredBegin() override;
void immediateBegin() override;
void exclusiveBegin() override;
void commit() override;
void rollback() override;
void lock() override;
void unlock() override;
void initializeTables();
void registerTransactionStatements();

View File

@@ -406,6 +406,27 @@ void DatabaseBackend::setBusyTimeout(std::chrono::milliseconds timeout)
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)
{
throw Exception(whatHasHappens);

View File

@@ -85,6 +85,8 @@ public:
void setBusyTimeout(std::chrono::milliseconds timeout);
void walCheckpointFull();
protected:
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/
**
** This file is part of Qt Creator.
@@ -23,12 +23,15 @@
**
****************************************************************************/
#include "sqlstatementbuilderexception.h"
#pragma once
namespace Sqlite {
class DatabaseInterface
{
public:
virtual void walCheckpointFull() = 0;
protected:
~DatabaseInterface() = default;
};
} // 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::Arguments pargs = QtcProcess::prepareArgs(d->m_commandLine.arguments(),
&perr, HostOsInfo::hostOs(),
&d->m_environment, &d->m_workingDir);
&perr,
HostOsInfo::hostOs(),
&d->m_environment,
&d->m_workingDir,
d->m_commandLine.metaCharMode()
== CommandLine::MetaCharMode::Abort);
QString pcmd;
if (perr == QtcProcess::SplitOk) {
pcmd = d->m_commandLine.executable().toString();

View File

@@ -78,8 +78,9 @@ CommandLine::CommandLine(const FilePath &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_metaCharMode(metaCharMode)
{
addArgs(args);
}

View File

@@ -132,10 +132,13 @@ class QTCREATOR_UTILS_EXPORT CommandLine
{
public:
enum RawType { Raw };
enum class MetaCharMode { Abort, Ignore };
CommandLine() {}
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);
void addArg(const QString &arg, OsType osType = HostOsInfo::hostOs());
@@ -147,11 +150,13 @@ public:
FilePath executable() const { return m_executable; }
QString arguments() const { return m_arguments; }
MetaCharMode metaCharMode() const { return m_metaCharMode; }
QStringList splitArguments(OsType osType = HostOsInfo::hostOs()) const;
private:
FilePath m_executable;
QString m_arguments;
MetaCharMode m_metaCharMode;
};
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,
const Environment *env, const QString *pwd)
const Environment *env, const QString *pwd, bool abortOnMeta)
{
if (osType == OsTypeWindows)
return prepareArgsWin(cmd, err, env, pwd);
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
static Arguments prepareArgs(const QString &cmd, SplitError *err,
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
static bool prepareCommand(const QString &command, const QString &arguments,
QString *outCmd, Arguments *outArgs, OsType osType = HostOsInfo::hostOs(),

View File

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

View File

@@ -43,11 +43,8 @@ void PchManagerClient::alive()
void PchManagerClient::precompiledHeadersUpdated(ClangBackEnd::PrecompiledHeadersUpdatedMessage &&message)
{
for (ClangBackEnd::ProjectPartPch &projectPartPch : message.takeProjectPartPchs()) {
const QString pchPath{projectPartPch.pchPath};
addProjectPartPch(std::move(projectPartPch));
precompiledHeaderUpdated(projectPartPch.projectPartId, pchPath, projectPartPch.lastModified);
}
for (ClangBackEnd::ProjectPartId &projectPartId : message.takeProjectPartIds())
precompiledHeaderUpdated(projectPartId);
}
void PchManagerClient::progress(ClangBackEnd::ProgressMessage &&message)
@@ -66,33 +63,15 @@ void PchManagerClient::progress(ClangBackEnd::ProgressMessage &&message)
void PchManagerClient::precompiledHeaderRemoved(ClangBackEnd::ProjectPartId projectPartId)
{
for (auto notifier : m_notifiers) {
removeProjectPartPch(projectPartId);
for (auto notifier : m_notifiers)
notifier->precompiledHeaderRemoved(projectPartId);
}
}
void PchManagerClient::setConnectionClient(PchManagerConnectionClient *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)
{
m_notifiers.push_back(notifier);
@@ -109,47 +88,15 @@ void PchManagerClient::detach(PchManagerNotifierInterface *notifierToBeDeleted)
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
{
return m_notifiers;
}
void PchManagerClient::precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId,
const QString &pchFilePath,
long long lastModified)
void PchManagerClient::precompiledHeaderUpdated(ClangBackEnd::ProjectPartId projectPartId)
{
for (auto notifier : m_notifiers)
notifier->precompiledHeaderUpdated(projectPartId, pchFilePath, lastModified);
notifier->precompiledHeaderUpdated(projectPartId);
}
} // namespace ClangPchManager

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -295,8 +295,10 @@ void EditorToolBar::setToolbarCreationFlags(ToolbarCreationFlags flags)
{
d->m_isStandalone = flags & FlagsStandalone;
if (d->m_isStandalone) {
connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
this, &EditorToolBar::updateEditorListSelection);
connect(EditorManager::instance(),
&EditorManager::currentEditorChanged,
this,
&EditorToolBar::setCurrentEditor);
disconnect(d->m_editorList, QOverload<int>::of(&QComboBox::activated),
this, &EditorToolBar::listSelectionActivated);
@@ -327,15 +329,6 @@ void EditorToolBar::setCurrentEditor(IEditor *editor)
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)
{
EditorManager::activateEditorForEntry(DocumentModel::entryAtRow(row));

View File

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

View File

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

View File

@@ -293,7 +293,7 @@ HelpPluginPrivate::HelpPluginPrivate()
cmd = ActionManager::registerAction(action, "Help.ReportBug");
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT);
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);

View File

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

View File

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

View File

@@ -153,6 +153,7 @@ public:
QList<Utils::Icon> deviceIcons;
QList<IDevice::DeviceAction> deviceActions;
QVariantMap extraData;
IDevice::OpenTerminal openTerminal;
};
} // 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)
{
d->origin = origin;
@@ -169,6 +175,17 @@ void IDevice::setupId(Origin origin, Core::Id id)
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;
/*!

View File

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

View File

@@ -201,7 +201,9 @@ void SshDeviceProcess::handleConnected()
this, &SshDeviceProcess::handleProcessStarted);
connect(&d->consoleProcess, &ConsoleProcess::stubStopped,
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();
} else {
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();
}
static Utils::optional<Utils::Environment> runEnv(const Project *project)
static bool canOpenTerminalWithRunEnv(const Project *project)
{
if (!project || !project->activeTarget() || !project->activeTarget()->activeRunConfiguration())
return {};
return project->activeTarget()->activeRunConfiguration()->runnable().environment;
if (!project)
return false;
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()
@@ -382,6 +391,7 @@ public:
void updateUnloadProjectMenu();
using EnvironmentGetter = std::function<Utils::optional<Utils::Environment>(const Project *project)>;
void openTerminalHere(const EnvironmentGetter &env);
void openTerminalHereWithRunEnv();
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_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, []() {
const Node *currentNode = ProjectTree::currentNode();
@@ -3244,7 +3254,7 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
Project *project = ProjectTree::currentProject();
m_openTerminalHereBuildEnv->setVisible(bool(buildEnv(project)));
m_openTerminalHereRunEnv->setVisible(bool(runEnv(project)));
m_openTerminalHereRunEnv->setVisible(canOpenTerminalWithRunEnv(project));
if (pn && project) {
if (pn == project->rootProjectNode()) {
@@ -3583,6 +3593,28 @@ void ProjectExplorerPluginPrivate::openTerminalHere(const EnvironmentGetter &env
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()
{
const Node *currentNode = ProjectTree::currentNode();

View File

@@ -389,9 +389,15 @@ void ProjectTree::applyTreeManager(FolderNode *folder)
bool ProjectTree::hasNode(const Node *node)
{
return Utils::contains(SessionManager::projects(), [node](const Project *p) {
return p && p->rootProjectNode() && (
p->containerNode() == node
|| p->rootProjectNode()->findNode([node](const Node *n) { return n == node; }));
if (!p)
return false;
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
{
// if (role == Android::Constants::AndroidExtraLibs)
// return value("ANDROID_EXTRA_LIBS");
if (role == Android::Constants::AndroidDeploySettingsFile) {
for (const auto &artifact : m_qbsProductData.generatedArtifacts()) {
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()) {
if (artifact.fileTags().contains("dynamiclibrary")) {
ret << QFileInfo(artifact.filePath()).path();
qDebug() << artifact.properties().toString();
}
}
ret.removeDuplicates();
qDebug() << ret;
return ret;
}
@@ -442,16 +437,8 @@ QVariant QbsProductNode::data(Core::Id role) const
return {};
}
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();
// }
if (role == Android::Constants::AndroidApk)
return m_qbsProductData.targetExecutable();
}
return {};
}

View File

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

View File

@@ -524,6 +524,21 @@ void QmakeProject::asyncUpdate()
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) {
rootProFile()->asyncUpdate();
} else {

View File

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

View File

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

View File

@@ -192,6 +192,19 @@ QString NodeHints::indexPropertyForStackedContainer() const
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
{
if (!isValid())
@@ -213,6 +226,16 @@ bool NodeHints::visibleInLibrary() const
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
{
return m_hints;

View File

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

View File

@@ -52,7 +52,7 @@ static Abis detectTargetAbis(const FilePath &sdpPath)
if (!sdpPath.fileName().isEmpty()) {
Utils::EnvironmentItems environment = QnxUtils::qnxEnvironment(sdpPath.toString());
foreach (const Utils::EnvironmentItem &item, environment) {
if (item.name == QLatin1Literal("QNX_TARGET"))
if (item.name == QLatin1String("QNX_TARGET"))
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()) {
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();
}
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 {
// Factory

View File

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

View File

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

View File

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

View File

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

View File

@@ -60,7 +60,7 @@ private:
TodoItemsModel *m_itemsModel;
// 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
QList<TodoItem> m_itemsList;

View File

@@ -2,3 +2,12 @@ install(
DIRECTORY fonts
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
DEPENDS libclang Sqlite ClangSupport
DEFINES CLANGSUPPORT_BUILD_LIB
PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
PUBLIC_INCLUDES
${CLANG_INCLUDE_DIRS}
SOURCES

View File

@@ -1,7 +1,7 @@
add_qtc_library(clangpchmanagerbackend_lib STATIC
DEPENDS clangrefactoringbackend_lib ClangSupport
PUBLIC_DEPENDS libclang
DEFINES CLANGSUPPORT_BUILD_LIB
PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
PUBLIC_INCLUDES
${CLANG_INCLUDE_DIRS}
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
{
WriteStatement &statement = insertOrUpdateFileStatusesStatement;
@@ -246,6 +252,8 @@ public:
"CONFLICT(sourceId, projectPartId) DO UPDATE SET sourceType = ?003, "
"hasMissingIncludes = ?004",
database};
mutable ReadStatement fetchProjectPartsFilesStatement{
"SELECT sourceId FROM projectPartsFiles WHERE projectPartId = ? ORDER BY sourceId", database};
mutable ReadStatement fetchSourceDependenciesStatement{
"WITH RECURSIVE collectedDependencies(sourceId) AS (VALUES(?) UNION "
"SELECT dependencySourceId FROM sourceDependencies, "

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -113,8 +113,11 @@ Utils::SmallStringVector PchCreator::generateClangCompilerArguments(const PchTas
void PchCreator::generatePch(PchTask &&pchTask)
{
m_projectPartPch.projectPartId = pchTask.projectPartId();
m_projectPartPch.lastModified = QDateTime::currentSecsSinceEpoch();
if (pchTask.includes.empty())
return;
auto content = generatePchIncludeFileContent(pchTask.includes);
auto pchOutputPath = generatePchFilePath();
@@ -180,7 +183,7 @@ void PchCreator::doInMainThreadAfterFinished()
m_buildDependenciesStorage.updatePchCreationTimeStamp(m_projectPartPch.lastModified,
m_projectPartPch.projectPartId);
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 <updateprojectpartsmessage.h>
#include <utils/algorithm.h>
#include <utils/smallstring.h>
#include <QApplication>
@@ -57,18 +58,29 @@ void PchManagerServer::end()
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)
{
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()) {
m_pchTaskGenerator.addProjectParts(std::move(newProjectParts),
m_pchTaskGenerator.addProjectParts(std::move(upToDateProjectParts.notUpToDate),
std::move(message.toolChainArguments));
} else {
m_projectPartsManager.updateDeferred(newProjectParts);
m_projectPartsManager.updateDeferred(upToDateProjectParts.notUpToDate);
}
client()->precompiledHeadersUpdated(toProjectPartIds(upToDateProjectParts.upToDate));
}
void PchManagerServer::removeProjectParts(RemoveProjectPartsMessage &&message)

View File

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

View File

@@ -44,34 +44,35 @@ ProjectPartIds toProjectPartIds(const ProjectPartContainers &projectsParts)
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())
return {};
if (notUpToDateProjectParts.empty())
return {std::move(projectsParts), {}};
auto persistentProjectParts = m_projectPartsStorage.fetchProjectParts(
toProjectPartIds(updatedProjectParts));
toProjectPartIds(notUpToDateProjectParts));
if (persistentProjectParts.size() > 0) {
mergeProjectParts(persistentProjectParts);
updatedProjectParts = filterNewProjectParts(std::move(updatedProjectParts),
persistentProjectParts);
notUpToDateProjectParts = filterProjectParts(notUpToDateProjectParts, persistentProjectParts);
if (updatedProjectParts.empty())
if (notUpToDateProjectParts.empty())
return {};
}
m_projectPartsStorage.updateProjectParts(updatedProjectParts);
m_projectPartsStorage.resetIndexingTimeStamps(updatedProjectParts);
m_projectPartsStorage.updateProjectParts(notUpToDateProjectParts);
m_projectPartsStorage.resetIndexingTimeStamps(notUpToDateProjectParts);
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)
@@ -176,8 +177,8 @@ ProjectPartContainers ProjectPartsManager::deferredUpdates()
return deferredProjectParts;
}
ProjectPartContainers ProjectPartsManager::filterNewProjectParts(
ProjectPartContainers &&projectsParts, const ProjectPartContainers &oldProjectParts)
ProjectPartContainers ProjectPartsManager::filterProjectParts(
const ProjectPartContainers &projectsParts, const ProjectPartContainers &oldProjectParts)
{
ProjectPartContainers updatedProjectPartContainers;
updatedProjectPartContainers.reserve(projectsParts.size());

View File

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

View File

@@ -32,11 +32,18 @@ namespace ClangBackEnd {
class ProjectPartsManagerInterface
{
public:
class UpToDataProjectParts
{
public:
ProjectPartContainers upToDate;
ProjectPartContainers notUpToDate;
};
ProjectPartsManagerInterface() = default;
ProjectPartsManagerInterface(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 ProjectPartContainers projects(const ProjectPartIds &projectPartIds) const = 0;
virtual void updateDeferred(const ProjectPartContainers &projectsParts) = 0;

View File

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

View File

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

View File

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

View File

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

View File

@@ -56,18 +56,16 @@ public:
SourceDependencies &sourceDependencies,
FilePathCachingInterface &filePathCache,
const clang::SourceManager &sourceManager,
std::shared_ptr<clang::Preprocessor> &&preprocessor,
SourcesManager &sourcesManager)
std::shared_ptr<clang::Preprocessor> &&preprocessor)
: CollectUsedMacrosAndSourcesPreprocessorCallbacksBase(usedMacros,
filePathCache,
sourceManager,
sourcesManager,
std::move(preprocessor),
sourceDependencies,
sourceFiles,
fileStatuses),
m_symbolEntries(symbolEntries),
m_sourceLocationEntries(sourceLocationEntries)
fileStatuses)
, m_symbolEntries(symbolEntries)
, m_sourceLocationEntries(sourceLocationEntries)
{
}
@@ -95,10 +93,8 @@ public:
const clang::FileEntry *file,
llvm::StringRef /*searchPath*/,
llvm::StringRef /*relativePath*/,
const clang::Module * /*imported*/
#if LLVM_VERSION_MAJOR >= 7
, clang::SrcMgr::CharacteristicKind /*fileType*/
#endif
const clang::Module * /*imported*/,
clang::SrcMgr::CharacteristicKind /*fileType*/
) override
{
if (!m_skipInclude && file)
@@ -174,7 +170,6 @@ public:
{
filterOutHeaderGuards();
mergeUsedMacros();
m_sourcesManager.updateModifiedTimeStamps();
}
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