Merge remote-tracking branch 'origin/4.4'

Conflicts:
	qtcreator.pri

Change-Id: If5f4a9821a23ac0df81eb84b3980f9cf7ecd70ba
This commit is contained in:
Eike Ziller
2017-07-25 11:54:44 +02:00
139 changed files with 2523 additions and 1053 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -187,11 +187,35 @@
\endlist
In addition, you can run static checks on the QML and JavaScript code in
your project to find common problems.
When using the Clang code model, errors and warnings are additionally marked
with icons and annotated. If a \l{http://clang.llvm.org/diagnostics.html}
{Clang fix-it} is available, you can execute it by clicking the
\inlineimage refactormarker.png
icon and pressing \key Enter.
In the following figure, a semicolon is missing at the end of the
line.
\image qtcreator-syntaxerror-clang.png
In the following figure, the variable is not used.
\image qtcreator-semanticerror-clang.png
To specify the position where the annotations are displayed, select
\uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} >
\uicontrol Display > \uicontrol {Annotations next to lines}, and then
select whether to display the annotations directly next to the code,
aligned to the right of the code, or in the right margin.
If you hide the annotations by deselecting the check box, you can move the
mouse pointer over an icon to view them.
\section1 Checking JSON Data Structure
You can run static checks on the QML and JavaScript code in
your project to find common problems.
\QC validates instances of JSON entities against
\l{http://tools.ietf.org/html/draft-zyp-json-schema-03}
{A JSON Media Type for Describing the Structure and Meaning of JSON Documents}.
@@ -1956,6 +1980,9 @@
\section1 Renaming Symbols
You can rename symbols in all files in a project. When you rename a class,
you can also change filenames that match the class name.
To rename a specific symbol in a Qt project:
\list 1
@@ -1973,15 +2000,18 @@
\image qtcreator-refactoring-replace.png
\li To replace all selected instances, enter the name of the new symbol
in the \uicontrol {Replace with} text box and click
\uicontrol Replace.
in the \uicontrol {Replace with} text box.
To omit an instance, uncheck the check-box next to the instance.
\li If the symbol is a class, select the \uicontrol {Rename files} check
box to also change the filenames that match the class name.
\li Select \uicontrol Replace.
\note This action replaces all selected instances of the symbol in
all files listed in the \uicontrol {Search Results} pane. You cannot
undo this action.
\endlist
\note Renaming local symbols does not open the \uicontrol {Search Results}

View File

@@ -17,6 +17,8 @@ Module {
property string qtcreator_compat_version: ide_compat_version_major + '.'
+ ide_compat_version_minor + '.' + ide_compat_version_release
property string qtcreator_copyright_year: '2017'
property string libDirName: "lib"
property string ide_app_path: qbs.targetOS.contains("macos") ? "" : "bin"
property string ide_app_target: qbs.targetOS.contains("macos") ? "Qt Creator" : "qtcreator"

View File

@@ -5,6 +5,7 @@ QTCREATOR_VERSION = 4.4.82
QTCREATOR_COMPAT_VERSION = 4.4.82
VERSION = $$QTCREATOR_VERSION
QTCREATOR_DISPLAY_VERSION = 4.5.0-beta1
QTCREATOR_COPYRIGHT_YEAR = 2017
BINARY_ARTIFACTS_BRANCH = master
CONFIG += c++14

View File

@@ -94,7 +94,7 @@ runCodeCompletion()
if [ -n "${CINDEXTEST_EXEC}" ]; then
command="${CINDEXTEST_EXEC} -code-completion-at=${FILE}:${LINE}:${COLUMN} ${FILE}"
else
command="${CLANG_EXEC} -cc1 -code-completion-at ${FILE}:${LINE}:${COLUMN} ${FILE}"
command="${CLANG_EXEC} -fsyntax-only -Xclang -code-completion-at -Xclang ${FILE}:${LINE}:${COLUMN} ${FILE}"
fi
echo "Command: $command"
eval $command

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.",
"trDisplayName": "C++ Class",
"trDisplayCategory": "C++",
"iconText": "h/cpp",
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
"options":

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates new Python class file.",
"trDisplayName": "Python Class",
"trDisplayCategory": "Python",
"iconText": "py",
"enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}",
"options":

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a Qt Quick Designer UI form along with a matching QML file for implementation purposes. You can add the form and file to an existing Qt Quick Project.",
"trDisplayName": "QtQuick UI File",
"trDisplayCategory": "Qt",
"iconText": "ui.qml",
"featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.UiFiles" ],
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a C++ header file that you can add to a C++ project.",
"trDisplayName": "C++ Header File",
"trDisplayCategory": "C++",
"iconText": "h",
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
"options": { "key": "FileName", "value": "%{JS: Cpp.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" },

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a C++ source file that you can add to a C++ project.",
"trDisplayName": "C++ Source File",
"trDisplayCategory": "C++",
"iconText": "cpp",
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
"options": { "key": "FileName", "value": "%{JS: Cpp.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" },

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a Qt Designer form that you can add to a Qt Widget Project. This is useful if you already have an existing class for the UI business logic.",
"trDisplayName": "Qt Designer Form",
"trDisplayCategory": "Qt",
"iconText": "ui",
"enabled": "%{JS: [ %{Plugins} ].indexOf('Designer') >= 0}",
"options": [

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a fragment shader in the Desktop OpenGL Shading Language (GLSL). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL.",
"trDisplayName": "Fragment Shader (Desktop OpenGL)",
"trDisplayCategory": "GLSL",
"iconText": "frag",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a vertex shader in the Desktop OpenGL Shading Language (GLSL). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL.",
"trDisplayName": "Vertex Shader (Desktop OpenGL)",
"trDisplayCategory": "GLSL",
"iconText": "vert",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a fragment shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL.",
"trDisplayName": "Fragment Shader (OpenGL/ES 2.0)",
"trDisplayCategory": "GLSL",
"iconText": "fsh",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a vertex shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL.",
"trDisplayName": "Vertex Shader (OpenGL/ES 2.0)",
"trDisplayCategory": "GLSL",
"iconText": "vsh",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a Java file with boilerplate code.",
"trDisplayName": "Java File",
"trDisplayCategory": "Java",
"iconText": "java",
"enabled": "%{JS: [ %{Plugins} ].indexOf('Android') >= 0}",
"options": [ { "key": "ClassName", "value": "%{JS: '%{FileName}'.charAt(0).toUpperCase() + '%{FileName}'.substr(1)}" } ],

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a JavaScript file.",
"trDisplayName": "JS File",
"trDisplayCategory": "Qt",
"iconText": "js",
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
"pages" :

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a new empty model with an empty diagram.",
"trDisplayName": "Model",
"trDisplayCategory": "Modeling",
"iconText": "qmodel",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('ModelEditor') >= 0}",

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates an empty Python script file using UTF-8 charset.",
"trDisplayName": "Python File",
"trDisplayCategory": "Python",
"iconText": "py",
"enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}",
"pages" :

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a Qt Resource file (.qrc).",
"trDisplayName": "Qt Resource File",
"trDisplayCategory": "Qt",
"iconText": "qrc",
"enabled": "%{JS: [ %{Plugins} ].indexOf('ResourceEditor') >= 0}",
"pages" :

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a QML file with boilerplate code, starting with \"import QtQuick 2.0\".",
"trDisplayName": "QML File (Qt Quick 2)",
"trDisplayCategory": "Qt",
"iconText": "qml",
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
"pages" :

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates a new empty state chart.",
"trDisplayName": "State Chart",
"trDisplayCategory": "Modeling",
"iconText": "scxml",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('QtSupport') >= 0}",

View File

@@ -6,6 +6,7 @@
"trDescription": "Creates an empty file.",
"trDisplayName": "Empty File",
"trDisplayCategory": "General",
"iconText": "txt",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}",

View File

@@ -20,6 +20,12 @@ QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
include($$QT_BREAKPAD_ROOT_PATH/qtbreakpad.pri)
}
win32 {
# We need the version in two separate formats for the .rc file
# RC_VERSION=4,3,82,0 (quadruple)
# RC_VERSION_STRING="4.4.0-beta1" (free text)
DEFINES += RC_VERSION=$$replace(QTCREATOR_VERSION, "\\.", ","),0 \
RC_VERSION_STRING=\\\"$${QTCREATOR_DISPLAY_VERSION}\\\" \
RC_COPYRIGHT='"\\\"2008-$${QTCREATOR_COPYRIGHT_YEAR} The Qt Company Ltd\\\""'
RC_FILE = qtcreator.rc
} else:macx {
LIBS += -framework CoreFoundation

View File

@@ -41,7 +41,6 @@ QtcProduct {
"Info.plist",
"main.cpp",
"qtcreator.xcassets",
"qtcreator.rc",
"../shared/qtsingleapplication/qtsingleapplication.h",
"../shared/qtsingleapplication/qtsingleapplication.cpp",
"../shared/qtsingleapplication/qtlocalpeer.h",
@@ -51,6 +50,16 @@ QtcProduct {
"../tools/qtcreatorcrashhandler/crashhandlersetup.h"
]
Group {
// We need the version in two separate formats for the .rc file
// RC_VERSION=4,3,82,0 (quadruple)
// RC_VERSION_STRING="4.4.0-beta1" (free text)
cpp.defines: outer.concat(["RC_VERSION=" + qtc.qtcreator_version.replace(/\./g, ",") + ",0",
"RC_VERSION_STRING=\"" + qtc.qtcreator_display_version + "\"",
"RC_COPYRIGHT=\"2008-" + qtc.qtcreator_copyright_year + " The Qt Company Ltd\""])
files: "qtcreator.rc"
}
Group {
name: "qtcreator.sh"
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")

View File

@@ -42,7 +42,7 @@ namespace Constants {
const char * const IDE_VERSION_LONG = IDE_VERSION_STR;
const char * const IDE_VERSION_DISPLAY = STRINGIFY(IDE_VERSION_DISPLAY_DEF);
const char * const IDE_AUTHOR = \"The Qt Company Ltd\";
const char * const IDE_YEAR = \"2017\";
const char * const IDE_YEAR = \"$${QTCREATOR_COPYRIGHT_YEAR}\";
#ifdef IDE_REVISION
const char * const IDE_REVISION_STR = STRINGIFY(IDE_REVISION);

View File

@@ -42,6 +42,8 @@ Product {
+ product.moduleProperty("qtc", "ide_version_minor") + "\n");
content = content.replace(/(\n#define IDE_VERSION_RELEASE) .+\n/, "$1 "
+ product.moduleProperty("qtc", "ide_version_release") + "\n");
content = content.replace(/(\n#define IDE_COPYRIGHT_YEAR) .+\n/, "$1 "
+ product.moduleProperty("qtc", "qtcreator_copyright_year") + "\n");
file = new TextFile(output.filePath, TextFile.WriteOnly);
file.truncate();
file.write(content);

View File

@@ -1,3 +1,5 @@
#include <windows.h>
IDI_ICON1 ICON DISCARDABLE "qtcreator.ico"
IDI_ICON2 ICON DISCARDABLE "winicons/c.ico"
IDI_ICON3 ICON DISCARDABLE "winicons/cpp.ico"
@@ -6,3 +8,25 @@ IDI_ICON5 ICON DISCARDABLE "winicons/ui.ico"
IDI_ICON6 ICON DISCARDABLE "winicons/pro.ico"
IDI_ICON7 ICON DISCARDABLE "winicons/pri.ico"
IDI_ICON8 ICON DISCARDABLE "winicons/qml.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION RC_VERSION
PRODUCTVERSION RC_VERSION
{
BLOCK "StringFileInfo"
{
// U.S. English - Windows, Multilingual
BLOCK "040904E4"
{
VALUE "FileDescription", "Qt Creator"
VALUE "FileVersion", RC_VERSION_STRING
VALUE "ProductName", "Qt Creator"
VALUE "ProductVersion", RC_VERSION_STRING
VALUE "LegalCopyright", RC_COPYRIGHT
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1252 // 1252 = 0x04E4
}
}

View File

@@ -8,163 +8,164 @@ QT += network
INCLUDEPATH += $$PWD
SOURCES += $$PWD/clangcodemodelserverinterface.cpp \
$$PWD/clangcodemodelserverproxy.cpp \
$$PWD/clangcodemodelclientinterface.cpp \
$$PWD/cmbendmessage.cpp \
$$PWD/cmbalivemessage.cpp \
$$PWD/clangcodemodelclientproxy.cpp \
$$PWD/writemessageblock.cpp \
$$PWD/readmessageblock.cpp \
$$PWD/ipcinterface.cpp \
$$PWD/connectionserver.cpp \
$$PWD/connectionclient.cpp \
$$PWD/cmbechomessage.cpp \
$$PWD/cmbregistertranslationunitsforeditormessage.cpp \
$$PWD/filecontainer.cpp \
$$PWD/cmbunregistertranslationunitsforeditormessage.cpp \
$$PWD/cmbcompletecodemessage.cpp \
$$PWD/cmbcodecompletedmessage.cpp \
$$PWD/codecompletion.cpp \
$$PWD/cmbregisterprojectsforeditormessage.cpp \
$$PWD/cmbunregisterprojectsforeditormessage.cpp \
$$PWD/translationunitdoesnotexistmessage.cpp \
$$PWD/codecompletionchunk.cpp \
$$PWD/projectpartcontainer.cpp \
$$PWD/projectpartsdonotexistmessage.cpp \
$$PWD/lineprefixer.cpp \
SOURCES += \
$$PWD/cancelmessage.cpp \
$$PWD/clangbackendipcdebugutils.cpp \
$$PWD/diagnosticcontainer.cpp \
$$PWD/sourcerangecontainer.cpp \
$$PWD/sourcelocationcontainer.cpp \
$$PWD/fixitcontainer.cpp \
$$PWD/requestdocumentannotations.cpp \
$$PWD/requestreferencesmessage.cpp \
$$PWD/registerunsavedfilesforeditormessage.cpp \
$$PWD/unregisterunsavedfilesforeditormessage.cpp \
$$PWD/updatetranslationunitsforeditormessage.cpp \
$$PWD/updatevisibletranslationunitsmessage.cpp \
$$PWD/highlightingmarkcontainer.cpp \
$$PWD/refactoringclientinterface.cpp \
$$PWD/messageenvelop.cpp \
$$PWD/refactoringserverinterface.cpp \
$$PWD/refactoringserverproxy.cpp \
$$PWD/ipcclientinterface.cpp \
$$PWD/ipcserverinterface.cpp \
$$PWD/clangcodemodelclientinterface.cpp \
$$PWD/clangcodemodelclientproxy.cpp \
$$PWD/clangcodemodelconnectionclient.cpp \
$$PWD/clangcodemodelserverinterface.cpp \
$$PWD/clangcodemodelserverproxy.cpp \
$$PWD/cmbalivemessage.cpp \
$$PWD/cmbcodecompletedmessage.cpp \
$$PWD/cmbcompletecodemessage.cpp \
$$PWD/cmbechomessage.cpp \
$$PWD/cmbendmessage.cpp \
$$PWD/cmbregisterprojectsforeditormessage.cpp \
$$PWD/cmbregistertranslationunitsforeditormessage.cpp \
$$PWD/cmbunregisterprojectsforeditormessage.cpp \
$$PWD/cmbunregistertranslationunitsforeditormessage.cpp \
$$PWD/codecompletionchunk.cpp \
$$PWD/codecompletion.cpp \
$$PWD/connectionclient.cpp \
$$PWD/connectionserver.cpp \
$$PWD/diagnosticcontainer.cpp \
$$PWD/documentannotationschangedmessage.cpp \
$$PWD/referencesmessage.cpp \
$$PWD/refactoringclientproxy.cpp \
$$PWD/sourcelocationscontainer.cpp \
$$PWD/sourcelocationcontainerv2.cpp \
$$PWD/sourcelocationsforrenamingmessage.cpp \
$$PWD/requestsourcelocationforrenamingmessage.cpp \
$$PWD/filepath.cpp \
$$PWD/sourcerangescontainer.cpp \
$$PWD/sourcefilepathcontainerbase.cpp \
$$PWD/sourcerangecontainerv2.cpp \
$$PWD/dynamicastmatcherdiagnosticcontainer.cpp \
$$PWD/dynamicastmatcherdiagnosticcontextcontainer.cpp \
$$PWD/dynamicastmatcherdiagnosticmessagecontainer.cpp \
$$PWD/requestsourcerangesanddiagnosticsforquerymessage.cpp \
$$PWD/sourcerangesanddiagnosticsforquerymessage.cpp \
$$PWD/sourcerangewithtextcontainer.cpp \
$$PWD/filecontainer.cpp \
$$PWD/filecontainerv2.cpp \
$$PWD/cancelmessage.cpp \
$$PWD/filepath.cpp \
$$PWD/fixitcontainer.cpp \
$$PWD/highlightingmarkcontainer.cpp \
$$PWD/ipcclientinterface.cpp \
$$PWD/ipcinterface.cpp \
$$PWD/ipcserverinterface.cpp \
$$PWD/lineprefixer.cpp \
$$PWD/messageenvelop.cpp \
$$PWD/pchmanagerclientinterface.cpp \
$$PWD/pchmanagerserverinterface.cpp \
$$PWD/projectpartcontainerv2.cpp \
$$PWD/updatepchprojectpartsmessage.cpp \
$$PWD/pchmanagerserverproxy.cpp \
$$PWD/pchmanagerclientproxy.cpp \
$$PWD/projectpartpch.cpp \
$$PWD/pchmanagerserverinterface.cpp \
$$PWD/pchmanagerserverproxy.cpp \
$$PWD/precompiledheadersupdatedmessage.cpp \
$$PWD/projectpartcontainer.cpp \
$$PWD/projectpartcontainerv2.cpp \
$$PWD/projectpartpch.cpp \
$$PWD/projectpartsdonotexistmessage.cpp \
$$PWD/readmessageblock.cpp \
$$PWD/refactoringclientinterface.cpp \
$$PWD/refactoringclientproxy.cpp \
$$PWD/refactoringserverinterface.cpp \
$$PWD/refactoringserverproxy.cpp \
$$PWD/referencesmessage.cpp \
$$PWD/registerunsavedfilesforeditormessage.cpp \
$$PWD/removepchprojectpartsmessage.cpp \
$$PWD/requestdocumentannotations.cpp \
$$PWD/requestreferencesmessage.cpp \
$$PWD/requestsourcelocationforrenamingmessage.cpp \
$$PWD/requestsourcerangesanddiagnosticsforquerymessage.cpp \
$$PWD/requestsourcerangesforquerymessage.cpp \
$$PWD/sourcefilepathcontainerbase.cpp \
$$PWD/sourcelocationcontainer.cpp \
$$PWD/sourcelocationcontainerv2.cpp \
$$PWD/sourcelocationscontainer.cpp \
$$PWD/sourcelocationsforrenamingmessage.cpp \
$$PWD/sourcerangecontainer.cpp \
$$PWD/sourcerangecontainerv2.cpp \
$$PWD/sourcerangesanddiagnosticsforquerymessage.cpp \
$$PWD/sourcerangescontainer.cpp \
$$PWD/sourcerangesforquerymessage.cpp \
$$PWD/requestsourcerangesforquerymessage.cpp
$$PWD/sourcerangewithtextcontainer.cpp \
$$PWD/translationunitdoesnotexistmessage.cpp \
$$PWD/unregisterunsavedfilesforeditormessage.cpp \
$$PWD/updatepchprojectpartsmessage.cpp \
$$PWD/updatetranslationunitsforeditormessage.cpp \
$$PWD/updatevisibletranslationunitsmessage.cpp \
$$PWD/writemessageblock.cpp \
HEADERS += \
$$PWD/clangcodemodelserverinterface.h \
$$PWD/clangcodemodelserverproxy.h \
$$PWD/clangcodemodelclientinterface.h \
$$PWD/cmbendmessage.h \
$$PWD/cmbalivemessage.h \
$$PWD/clangcodemodelclientproxy.h \
$$PWD/writemessageblock.h \
$$PWD/readmessageblock.h \
$$PWD/ipcinterface.h \
$$PWD/connectionserver.h \
$$PWD/connectionclient.h \
$$PWD/cmbechomessage.h \
$$PWD/cmbregistertranslationunitsforeditormessage.h \
$$PWD/filecontainer.h \
$$PWD/cmbunregistertranslationunitsforeditormessage.h \
$$PWD/cmbcompletecodemessage.h \
$$PWD/cmbcodecompletedmessage.h \
$$PWD/codecompletion.h \
$$PWD/cmbregisterprojectsforeditormessage.h \
$$PWD/cmbunregisterprojectsforeditormessage.h \
$$PWD/translationunitdoesnotexistmessage.h \
$$PWD/codecompletionchunk.h \
$$PWD/projectpartcontainer.h \
$$PWD/projectpartsdonotexistmessage.h \
$$PWD/clangbackendipc_global.h \
$$PWD/lineprefixer.h \
$$PWD/cancelmessage.h \
$$PWD/clangbackendipcdebugutils.h \
$$PWD/diagnosticcontainer.h \
$$PWD/sourcerangecontainer.h \
$$PWD/sourcelocationcontainer.h \
$$PWD/fixitcontainer.h \
$$PWD/requestdocumentannotations.h \
$$PWD/referencesmessage.h \
$$PWD/requestreferencesmessage.h \
$$PWD/registerunsavedfilesforeditormessage.h \
$$PWD/unregisterunsavedfilesforeditormessage.h \
$$PWD/updatetranslationunitsforeditormessage.h \
$$PWD/updatevisibletranslationunitsmessage.h \
$$PWD/highlightingmarkcontainer.h \
$$PWD/messageenvelop.h \
$$PWD/ipcclientinterface.h \
$$PWD/ipcserverinterface.h \
$$PWD/clangbackendipc_global.h \
$$PWD/clangcodemodelclientinterface.h \
$$PWD/clangcodemodelclientmessages.h \
$$PWD/clangcodemodelclientproxy.h \
$$PWD/clangcodemodelconnectionclient.h \
$$PWD/clangcodemodelserverinterface.h \
$$PWD/clangcodemodelservermessages.h \
$$PWD/clangcodemodelserverproxy.h \
$$PWD/clangrefactoringclientmessages.h \
$$PWD/clangrefactoringmessages.h \
$$PWD/clangrefactoringservermessages.h \
$$PWD/cmbalivemessage.h \
$$PWD/cmbcodecompletedmessage.h \
$$PWD/cmbcompletecodemessage.h \
$$PWD/cmbechomessage.h \
$$PWD/cmbendmessage.h \
$$PWD/cmbregisterprojectsforeditormessage.h \
$$PWD/cmbregistertranslationunitsforeditormessage.h \
$$PWD/cmbunregisterprojectsforeditormessage.h \
$$PWD/cmbunregistertranslationunitsforeditormessage.h \
$$PWD/codecompletionchunk.h \
$$PWD/codecompletion.h \
$$PWD/connectionclient.h \
$$PWD/connectionserver.h \
$$PWD/diagnosticcontainer.h \
$$PWD/documentannotationschangedmessage.h \
$$PWD/refactoringclientinterface.h \
$$PWD/refactoringserverinterface.h \
$$PWD/refactoringserverproxy.h \
$$PWD/refactoringclientproxy.h \
$$PWD/sourcelocationscontainer.h \
$$PWD/sourcelocationcontainerv2.h \
$$PWD/sourcelocationsforrenamingmessage.h \
$$PWD/requestsourcelocationforrenamingmessage.h \
$$PWD/filepath.h \
$$PWD/sourcerangescontainer.h \
$$PWD/sourcefilepathcontainerbase.h \
$$PWD/sourcerangecontainerv2.h \
$$PWD/dynamicmatcherdiagnostics.h \
$$PWD/dynamicastmatcherdiagnosticcontainer.h \
$$PWD/dynamicastmatcherdiagnosticcontextcontainer.h \
$$PWD/dynamicastmatcherdiagnosticmessagecontainer.h \
$$PWD/requestsourcerangesanddiagnosticsforquerymessage.h \
$$PWD/sourcerangesanddiagnosticsforquerymessage.h \
$$PWD/sourcerangewithtextcontainer.h \
$$PWD/dynamicmatcherdiagnostics.h \
$$PWD/filecontainer.h \
$$PWD/filecontainerv2.h \
$$PWD/cancelmessage.h \
$$PWD/filepath.h \
$$PWD/fixitcontainer.h \
$$PWD/highlightingmarkcontainer.h \
$$PWD/ipcclientinterface.h \
$$PWD/ipcinterface.h \
$$PWD/ipcserverinterface.h \
$$PWD/lineprefixer.h \
$$PWD/messageenvelop.h \
$$PWD/pchmanagerclientinterface.h \
$$PWD/pchmanagerserverinterface.h \
$$PWD/projectpartcontainerv2.h \
$$PWD/updatepchprojectpartsmessage.h \
$$PWD/pchmanagerserverproxy.h \
$$PWD/pchmanagerclientproxy.h \
$$PWD/projectpartpch.h \
$$PWD/pchmanagerserverinterface.h \
$$PWD/pchmanagerserverproxy.h \
$$PWD/precompiledheadersupdatedmessage.h \
$$PWD/stringcache.h \
$$PWD/projectpartcontainer.h \
$$PWD/projectpartcontainerv2.h \
$$PWD/projectpartpch.h \
$$PWD/projectpartsdonotexistmessage.h \
$$PWD/readmessageblock.h \
$$PWD/refactoringclientinterface.h \
$$PWD/refactoringclientproxy.h \
$$PWD/refactoringserverinterface.h \
$$PWD/refactoringserverproxy.h \
$$PWD/referencesmessage.h \
$$PWD/registerunsavedfilesforeditormessage.h \
$$PWD/removepchprojectpartsmessage.h \
$$PWD/clangcodemodelclientmessages.h \
$$PWD/clangcodemodelservermessages.h \
$$PWD/requestdocumentannotations.h \
$$PWD/requestreferencesmessage.h \
$$PWD/requestsourcelocationforrenamingmessage.h \
$$PWD/requestsourcerangesanddiagnosticsforquerymessage.h \
$$PWD/requestsourcerangesforquerymessage.h \
$$PWD/sourcefilepathcontainerbase.h \
$$PWD/sourcelocationcontainer.h \
$$PWD/sourcelocationcontainerv2.h \
$$PWD/sourcelocationscontainer.h \
$$PWD/sourcelocationsforrenamingmessage.h \
$$PWD/sourcerangecontainer.h \
$$PWD/sourcerangecontainerv2.h \
$$PWD/sourcerangesanddiagnosticsforquerymessage.h \
$$PWD/sourcerangescontainer.h \
$$PWD/sourcerangesforquerymessage.h \
$$PWD/clangrefactoringmessages.h \
$$PWD/clangrefactoringclientmessages.h \
$$PWD/clangrefactoringservermessages.h \
$$PWD/requestsourcerangesforquerymessage.h
$$PWD/sourcerangewithtextcontainer.h \
$$PWD/stringcache.h \
$$PWD/translationunitdoesnotexistmessage.h \
$$PWD/unregisterunsavedfilesforeditormessage.h \
$$PWD/updatepchprojectpartsmessage.h \
$$PWD/updatetranslationunitsforeditormessage.h \
$$PWD/updatevisibletranslationunitsmessage.h \
$$PWD/writemessageblock.h \
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols

View File

@@ -55,7 +55,7 @@ public:
return m_contextType;
}
Utils::SmallString contextTypeText() const;
CMBIPC_EXPORT Utils::SmallString contextTypeText() const;
const Utils::SmallStringVector &arguments() const
{

View File

@@ -33,8 +33,8 @@ namespace ClangBackEnd {
QDebug operator<<(QDebug debug, const DynamicASTMatcherDiagnosticMessageContainer &container)
{
debug.nospace() << "DynamicASTMatcherDiagnosticMessageContainer("
<< container.sourceRange() << ", "
<< container.errorTypeText() << ", "
<< container.sourceRange() << ", "
<< container.arguments()
<< ")";

View File

@@ -55,7 +55,7 @@ public:
return m_errorType;
}
Utils::SmallString errorTypeText() const;
CMBIPC_EXPORT Utils::SmallString errorTypeText() const;
const Utils::SmallStringVector &arguments() const
{

View File

@@ -34,6 +34,8 @@
#include <QChar>
#include <QDebug>
#include <utils/algorithm.h>
using namespace CPlusPlus;
enum { MAX_NUM_LINES = 20 };
@@ -135,16 +137,215 @@ static const Token tokenAtPosition(const Tokens &tokens, const unsigned pos)
return Token();
}
static int tokenIndexBeforePosition(const Tokens &tokens, unsigned pos)
{
for (int i = tokens.size() - 1; i >= 0; --i) {
if (tokens[i].utf16charsBegin() < pos)
return i;
}
return -1;
}
static bool isCursorAtEndOfLineButMaybeBeforeComment(const Tokens &tokens, int pos)
{
int index = tokenIndexBeforePosition(tokens, uint(pos));
if (index == -1 || index >= tokens.size())
return false;
do {
++index;
} while (index < tokens.size() && tokens[index].isComment());
return index >= tokens.size();
}
// 10.6.1 Attribute syntax and semantics
// This does not handle alignas() since it is not needed for the namespace case.
static int skipAttributeSpecifierSequence(const Tokens &tokens, int index)
{
// [[ attribute-using-prefixopt attribute-list ]]
if (index >= 1 && tokens[index].is(T_RBRACKET) && tokens[index - 1].is(T_RBRACKET)) {
// Skip everything within [[ ]]
for (int i = index - 2; i >= 0; --i) {
if (i >= 1 && tokens[i].is(T_LBRACKET) && tokens[i - 1].is(T_LBRACKET))
return i - 2;
}
return -1;
}
return index;
}
static int skipNamespaceName(const Tokens &tokens, int index)
{
if (index >= tokens.size())
return -1;
if (!tokens[index].is(T_IDENTIFIER))
return index;
// Accept
// SomeName
// Some::Nested::Name
bool expectIdentifier = false;
for (int i = index - 1; i >= 0; --i) {
if (expectIdentifier) {
if (tokens[i].is(T_IDENTIFIER))
expectIdentifier = false;
else
return -1;
} else if (tokens[i].is(T_COLON_COLON)) {
expectIdentifier = true;
} else {
return i;
}
}
return index;
}
// 10.3.1 Namespace definition
static bool isAfterNamespaceDefinition(const Tokens &tokens, int position)
{
int index = tokenIndexBeforePosition(tokens, uint(position));
if (index == -1)
return false;
// Handle optional name
index = skipNamespaceName(tokens, index);
if (index == -1)
return false;
// Handle optional attribute specifier sequence
index = skipAttributeSpecifierSequence(tokens, index);
if (index == -1)
return false;
return index >= 0 && tokens[index].is(T_NAMESPACE);
}
static int isEmptyOrWhitespace(const QString &text)
{
return Utils::allOf(text, [](const QChar &c) {return c.isSpace(); });
}
static QTextBlock previousNonEmptyBlock(const QTextBlock &currentBlock)
{
QTextBlock block = currentBlock.previous();
forever {
if (!block.isValid() || !isEmptyOrWhitespace(block.text()))
return block;
block = block.previous();
}
}
static QTextBlock nextNonEmptyBlock(const QTextBlock &currentBlock)
{
QTextBlock block = currentBlock.next();
forever {
if (!block.isValid() || !isEmptyOrWhitespace(block.text()))
return block;
block = block.next();
}
}
static bool allowAutoClosingBraceAtEmptyLine(
const QTextBlock &block,
MatchingText::IsNextBlockDeeperIndented isNextDeeperIndented)
{
QTextBlock previousBlock = previousNonEmptyBlock(block);
if (!previousBlock.isValid())
return false; // Nothing before
QTextBlock nextBlock = nextNonEmptyBlock(block);
if (!nextBlock.isValid())
return true; // Nothing behind
if (isNextDeeperIndented && isNextDeeperIndented(previousBlock))
return false; // Before indented
const QString trimmedText = previousBlock.text().trimmed();
return !trimmedText.endsWith(';')
&& !trimmedText.endsWith('{')
&& !trimmedText.endsWith('}');
}
static Tokens getTokens(const QTextCursor &cursor, int &prevState)
{
LanguageFeatures features;
features.qtEnabled = false;
features.qtKeywordsEnabled = false;
features.qtMocRunEnabled = false;
features.cxx11Enabled = true;
features.cxxEnabled = true;
features.c99Enabled = true;
features.objCEnabled = true;
SimpleLexer tokenize;
tokenize.setLanguageFeatures(features);
prevState = BackwardsScanner::previousBlockState(cursor.block()) & 0xFF;
return tokenize(cursor.block().text(), prevState);
}
static QChar firstNonSpace(const QTextCursor &cursor)
{
int position = cursor.position();
QChar ch = cursor.document()->characterAt(position);
while (ch.isSpace())
ch = cursor.document()->characterAt(++position);
return ch;
}
static bool allowAutoClosingBraceByLookahead(const QTextCursor &cursor)
{
const QChar lookAhead = firstNonSpace(cursor);
if (lookAhead.isNull())
return true;
switch (lookAhead.unicode()) {
case ';': case ',':
case ')': case '}': case ']':
return true;
}
return false;
}
static bool allowAutoClosingBrace(const QTextCursor &cursor,
MatchingText::IsNextBlockDeeperIndented isNextIndented)
{
if (MatchingText::isInCommentHelper(cursor))
return false;
const QTextBlock block = cursor.block();
if (isEmptyOrWhitespace(block.text()))
return allowAutoClosingBraceAtEmptyLine(cursor.block(), isNextIndented);
int prevState;
const Tokens tokens = getTokens(cursor, prevState);
if (isAfterNamespaceDefinition(tokens, cursor.positionInBlock()))
return false;
if (isCursorAtEndOfLineButMaybeBeforeComment(tokens, cursor.positionInBlock()))
return !(isNextIndented && isNextIndented(block));
return allowAutoClosingBraceByLookahead(cursor);
}
bool MatchingText::contextAllowsAutoParentheses(const QTextCursor &cursor,
const QString &textToInsert)
const QString &textToInsert,
IsNextBlockDeeperIndented isNextIndented)
{
QChar ch;
if (!textToInsert.isEmpty())
ch = textToInsert.at(0);
if (ch == QLatin1Char('{') && cursor.block().text().trimmed().isEmpty())
return false; // User just might want to wrap up some lines.
if (ch == QLatin1Char('{'))
return allowAutoClosingBrace(cursor, isNextIndented);
if (!shouldInsertMatchingText(cursor) && ch != QLatin1Char('\'') && ch != QLatin1Char('"'))
return false;
@@ -198,24 +399,6 @@ bool MatchingText::shouldInsertMatchingText(QChar lookAhead)
} // switch
}
static Tokens getTokens(const QTextCursor &cursor, int &prevState)
{
LanguageFeatures features;
features.qtEnabled = false;
features.qtKeywordsEnabled = false;
features.qtMocRunEnabled = false;
features.cxx11Enabled = true;
features.cxxEnabled = true;
features.c99Enabled = true;
features.objCEnabled = true;
SimpleLexer tokenize;
tokenize.setLanguageFeatures(features);
prevState = BackwardsScanner::previousBlockState(cursor.block()) & 0xFF;
return tokenize(cursor.block().text(), prevState);
}
bool MatchingText::isInCommentHelper(const QTextCursor &cursor, Token *retToken)
{
int prevState = 0;

View File

@@ -30,7 +30,10 @@
#include <cplusplus/Token.h>
#include <cplusplus/CPlusPlusForwardDeclarations.h>
#include <functional>
QT_FORWARD_DECLARE_CLASS(QTextCursor)
QT_FORWARD_DECLARE_CLASS(QTextBlock)
QT_FORWARD_DECLARE_CLASS(QChar)
namespace CPlusPlus {
@@ -38,8 +41,11 @@ namespace CPlusPlus {
class CPLUSPLUS_EXPORT MatchingText
{
public:
using IsNextBlockDeeperIndented = std::function<bool(const QTextBlock &textBlock)>;
static bool contextAllowsAutoParentheses(const QTextCursor &cursor,
const QString &textToInsert);
const QString &textToInsert,
IsNextBlockDeeperIndented isNextIndented
= IsNextBlockDeeperIndented());
static bool contextAllowsAutoQuotes(const QTextCursor &cursor,
const QString &textToInsert);
static bool contextAllowsElectricCharacters(const QTextCursor &cursor);

View File

@@ -31,6 +31,7 @@
#include "pluginmanager.h"
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
#include <QCoreApplication>
#include <QDebug>
@@ -630,12 +631,9 @@ static inline QString msgInvalidFormat(const char *key, const QString &content)
.arg(QLatin1String(key), content);
}
static inline bool readMultiLineString(const QJsonValue &value, QString *out)
bool PluginSpec::readMultiLineString(const QJsonValue &value, QString *out)
{
if (!out) {
qCWarning(pluginLog) << Q_FUNC_INFO << "missing output parameter";
return false;
}
QTC_ASSERT(out, return false);
if (value.isString()) {
*out = value.toString();
} else if (value.isArray()) {
@@ -737,7 +735,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
copyright = value.toString();
value = metaData.value(QLatin1String(DESCRIPTION));
if (!value.isUndefined() && !readMultiLineString(value, &description))
if (!value.isUndefined() && !PluginSpec::readMultiLineString(value, &description))
return reportError(msgValueIsNotAString(DESCRIPTION));
value = metaData.value(QLatin1String(URL));
@@ -751,7 +749,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
category = value.toString();
value = metaData.value(QLatin1String(LICENSE));
if (!value.isUndefined() && !readMultiLineString(value, &license))
if (!value.isUndefined() && !PluginSpec::readMultiLineString(value, &license))
return reportError(msgValueIsNotAMultilineString(LICENSE));
value = metaData.value(QLatin1String(PLATFORM));

View File

@@ -131,6 +131,8 @@ public:
bool hasError() const;
QString errorString() const;
static bool readMultiLineString(const QJsonValue &value, QString *out);
private:
PluginSpec();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 258 B

View File

@@ -17,14 +17,14 @@
\"Url\" : \"http://necessitas.kde.org\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'application/vnd.google.android.android_manifest\'>
<comment>Android manifest file</comment>
<sub-class-of type=\'application/xml\'/>
<glob pattern=\'AndroidManifest.xml\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'application/vnd.google.android.android_manifest\'>\",
\" <comment>Android manifest file</comment>\",
\" <sub-class-of type=\'application/xml\'/>\",
\" <glob pattern=\'AndroidManifest.xml\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -347,7 +347,9 @@ void AndroidConfig::updateAvailableSdkPlatforms() const
m_availableSdkPlatforms.clear();
AndroidSdkManager sdkManager(*this);
m_availableSdkPlatforms = sdkManager.availableSdkPlatforms();
bool success = false;
m_availableSdkPlatforms = sdkManager.availableSdkPlatforms(&success);
if (success)
m_availableSdkPlatformsUpToDate = true;
}
@@ -358,7 +360,7 @@ QStringList AndroidConfig::apiLevelNamesFor(const QList<SdkPlatform> &platforms)
QString AndroidConfig::apiLevelNameFor(const SdkPlatform &platform)
{
return QLatin1String("android-") + QString::number(platform.apiLevel);
return platform.apiLevel > 0 ? QString("android-%1").arg(platform.apiLevel) : "";
}
QList<SdkPlatform> AndroidConfig::sdkTargets(int minApiLevel) const

View File

@@ -50,6 +50,8 @@ const char installLocationKey[] = "Installed Location:";
const char apiLevelPropertyKey[] = "AndroidVersion.ApiLevel";
const char abiPropertyKey[] = "SystemImage.Abi";
const int sdkManagerCmdTimeoutS = 60;
using namespace Utils;
/*!
@@ -72,11 +74,14 @@ static bool valueForKey(QString key, const QString &line, QString *value = nullp
\c true if the command is successfully executed. Output is copied into \a output. The function
blocks the calling thread.
*/
static bool sdkManagerCommand(const AndroidConfig config, const QStringList &args, QString *output)
static bool sdkManagerCommand(const AndroidConfig config, const QStringList &args, QString *output,
int timeout = sdkManagerCmdTimeoutS)
{
QString sdkManagerToolPath = config.sdkManagerToolPath().toString();
SynchronousProcess proc;
SynchronousProcessResponse response = proc.runBlocking(sdkManagerToolPath, args);
proc.setTimeoutS(timeout);
proc.setTimeOutMessageBoxEnabled(true);
SynchronousProcessResponse response = proc.run(sdkManagerToolPath, args);
if (response.result == SynchronousProcessResponse::Finished) {
if (output)
*output = response.allOutput();
@@ -132,10 +137,6 @@ AndroidSdkManager::AndroidSdkManager(const AndroidConfig &config):
m_config(config),
m_parser(new SdkManagerOutputParser)
{
QString packageListing;
if (sdkManagerCommand(config, QStringList({"--list", "--verbose"}), &packageListing)) {
m_parser->parsePackageListing(packageListing);
}
}
AndroidSdkManager::~AndroidSdkManager()
@@ -143,13 +144,20 @@ AndroidSdkManager::~AndroidSdkManager()
}
SdkPlatformList AndroidSdkManager::availableSdkPlatforms()
SdkPlatformList AndroidSdkManager::availableSdkPlatforms(bool *ok)
{
bool success = false;
if (m_config.sdkToolsVersion() < sdkManagerIntroVersion) {
AndroidToolManager toolManager(m_config);
return toolManager.availableSdkPlatforms();
return toolManager.availableSdkPlatforms(ok);
}
QString packageListing;
if (sdkManagerCommand(m_config, QStringList({"--list", "--verbose"}), &packageListing))
m_parser->parsePackageListing(packageListing);
if (ok)
*ok = success;
return m_parser->m_installedPlatforms;
}

View File

@@ -40,7 +40,7 @@ public:
AndroidSdkManager(const AndroidConfig &config);
~AndroidSdkManager();
SdkPlatformList availableSdkPlatforms();
SdkPlatformList availableSdkPlatforms(bool *ok = nullptr);
private:
const AndroidConfig &m_config;

View File

@@ -97,16 +97,22 @@ AndroidToolManager::~AndroidToolManager()
}
SdkPlatformList AndroidToolManager::availableSdkPlatforms() const
SdkPlatformList AndroidToolManager::availableSdkPlatforms(bool *ok) const
{
bool success = false;
SdkPlatformList list;
QString targetListing;
if (androidToolCommand(m_config.androidToolPath(), QStringList({"list", "target"}),
androidToolEnvironment(), &targetListing)) {
m_parser->parseTargetListing(targetListing, m_config.sdkLocation(), &list);
success = true;
} else {
qCDebug(androidToolLog) << "Android tool target listing failed";
}
if (ok)
*ok = success;
return list;
}

View File

@@ -48,7 +48,7 @@ public:
AndroidToolManager(const AndroidConfig &config);
~AndroidToolManager();
SdkPlatformList availableSdkPlatforms() const;
SdkPlatformList availableSdkPlatforms(bool *ok = nullptr) const;
void launchAvdManager() const;
QFuture<AndroidConfig::CreateAvdInfo> createAvd(AndroidConfig::CreateAvdInfo info) const;

View File

@@ -68,6 +68,14 @@ const Utils::Icon RESULT_MESSAGEDEBUG({
const Utils::Icon RESULT_MESSAGEWARN({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestWarnTextColor}},
Utils::Icon::Tint);
const Utils::Icon RESULT_MESSAGEPASSWARN({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestPassTextColor},
{":/utils/images/iconoverlay_warning.png", Utils::Theme::OutputPanes_TestWarnTextColor}},
Utils::Icon::Tint | Utils::Icon::PunchEdges);
const Utils::Icon RESULT_MESSAGEFAILWARN({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestFailTextColor},
{":/utils/images/iconoverlay_warning.png", Utils::Theme::OutputPanes_TestWarnTextColor}},
Utils::Icon::Tint | Utils::Icon::PunchEdges);
const Utils::Icon RESULT_MESSAGEFATAL({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestFatalTextColor}},
Utils::Icon::Tint);

View File

@@ -41,6 +41,7 @@ static QString constructSourceFilePath(const QString &path, const QString &fileP
GTestOutputReader::GTestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface,
QProcess *testApplication, const QString &buildDirectory)
: TestOutputReader(futureInterface, testApplication, buildDirectory)
, m_executable(testApplication ? testApplication->program() : QString())
{
}
@@ -75,7 +76,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine)
m_futureInterface.reportResult(testResult);
m_description.clear();
} else if (disabledTests.exactMatch(line)) {
TestResultPtr testResult = TestResultPtr(new GTestResult());
TestResultPtr testResult = TestResultPtr(new GTestResult);
testResult->setResult(Result::MessageDisabledTests);
int disabled = disabledTests.cap(1).toInt();
testResult->setDescription(tr("You have %n disabled test(s).", 0, disabled));
@@ -106,7 +107,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine)
m_futureInterface.reportResult(testResult);
} else if (newTestSetStarts.exactMatch(line)) {
m_currentTestSet = newTestSetStarts.cap(1);
TestResultPtr testResult = TestResultPtr(new GTestResult());
TestResultPtr testResult = TestResultPtr(new GTestResult);
testResult->setResult(Result::MessageCurrentTest);
testResult->setDescription(tr("Entering test set %1").arg(m_currentTestSet));
m_futureInterface.reportResult(testResult);
@@ -156,7 +157,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine)
GTestResult *GTestOutputReader::createDefaultResult() const
{
GTestResult *result = new GTestResult(m_currentTestName);
GTestResult *result = new GTestResult(m_executable, m_currentTestName);
result->setTestSetName(m_currentTestSet);
result->setIteration(m_iteration);
return result;

View File

@@ -47,6 +47,7 @@ protected:
private:
GTestResult *createDefaultResult() const;
QString m_executable;
QString m_currentTestName;
QString m_currentTestSet;
QString m_description;

View File

@@ -33,6 +33,11 @@ GTestResult::GTestResult(const QString &name)
{
}
GTestResult::GTestResult(const QString &executable, const QString &name)
: TestResult(executable, name)
{
}
const QString GTestResult::outputString(bool selected) const
{
const QString &desc = description();

View File

@@ -34,6 +34,7 @@ class GTestResult : public TestResult
{
public:
explicit GTestResult(const QString &name = QString());
GTestResult(const QString &executable, const QString &name);
const QString outputString(bool selected) const override;
void setTestSetName(const QString &testSetName) { m_testSetName = testSetName; }

View File

@@ -132,6 +132,7 @@ QtTestOutputReader::QtTestOutputReader(const QFutureInterface<TestResultPtr> &fu
QProcess *testApplication, const QString &buildDirectory,
OutputMode mode)
: TestOutputReader(futureInterface, testApplication, buildDirectory)
, m_executable(testApplication ? testApplication->program() : QString())
, m_mode(mode)
{
}
@@ -419,7 +420,7 @@ void QtTestOutputReader::processSummaryFinishOutput()
QtTestResult *QtTestOutputReader::createDefaultResult() const
{
QtTestResult *result = new QtTestResult(m_className);
QtTestResult *result = new QtTestResult(m_executable, m_className);
result->setFunctionName(m_testCase);
result->setDataTag(m_dataTag);
return result;

View File

@@ -78,6 +78,7 @@ private:
};
CDATAMode m_cdataMode = None;
QString m_executable;
QString m_className;
QString m_testCase;
QString m_formerTestCase;

View File

@@ -35,6 +35,11 @@ QtTestResult::QtTestResult(const QString &className)
{
}
QtTestResult::QtTestResult(const QString &executable, const QString &className)
: TestResult(executable, className)
{
}
const QString QtTestResult::outputString(bool selected) const
{
const QString &desc = description();
@@ -101,14 +106,14 @@ bool QtTestResult::isIntermediateFor(const TestResult *other) const
QTC_ASSERT(other, return false);
const QtTestResult *qtOther = static_cast<const QtTestResult *>(other);
return m_dataTag == qtOther->m_dataTag && m_function == qtOther->m_function
&& name() == qtOther->name();
&& name() == qtOther->name() && executable() == qtOther->executable();
}
TestResult *QtTestResult::createIntermediateResultFor(const TestResult *other)
{
QTC_ASSERT(other, return nullptr);
const QtTestResult *qtOther = static_cast<const QtTestResult *>(other);
QtTestResult *intermediate = new QtTestResult(qtOther->name());
QtTestResult *intermediate = new QtTestResult(qtOther->executable(), qtOther->name());
intermediate->m_function = qtOther->m_function;
intermediate->m_dataTag = qtOther->m_dataTag;
// intermediates will be needed only for data tags

View File

@@ -34,6 +34,7 @@ class QtTestResult : public TestResult
{
public:
explicit QtTestResult(const QString &className = QString());
QtTestResult(const QString &executable, const QString &className);
const QString outputString(bool selected) const override;
void setFunctionName(const QString &functionName) { m_function = functionName; }

View File

@@ -47,6 +47,12 @@ TestResult::TestResult(const QString &name)
{
}
TestResult::TestResult(const QString &executable, const QString &name)
: m_executable(executable)
, m_name(name)
{
}
const QString TestResult::outputString(bool selected) const
{
return selected ? m_description : m_description.split('\n').first();
@@ -97,9 +103,11 @@ QString TestResult::resultToString(const Result::Type type)
switch (type) {
case Result::Pass:
case Result::MessageTestCaseSuccess:
case Result::MessageTestCaseSuccessWarn:
return QString("PASS");
case Result::Fail:
case Result::MessageTestCaseFail:
case Result::MessageTestCaseFailWarn:
return QString("FAIL");
case Result::ExpectedFail:
return QString("XFAIL");
@@ -114,7 +122,6 @@ QString TestResult::resultToString(const Result::Type type)
case Result::MessageInfo:
return QString("INFO");
case Result::MessageWarn:
case Result::MessageTestCaseWarn:
return QString("WARN");
case Result::MessageFatal:
return QString("FATAL");
@@ -166,26 +173,28 @@ QColor TestResult::colorForType(const Result::Type type)
bool TestResult::isMessageCaseStart(const Result::Type type)
{
return type == Result::MessageTestCaseStart || type == Result::MessageTestCaseSuccess
|| type == Result::MessageTestCaseFail || type == Result::MessageTestCaseWarn
|| type == Result::MessageIntermediate;
|| type == Result::MessageTestCaseFail || type == Result::MessageTestCaseSuccessWarn
|| type == Result::MessageTestCaseFailWarn || type == Result::MessageIntermediate;
}
bool TestResult::isDirectParentOf(const TestResult *other, bool * /*needsIntermediate*/) const
{
QTC_ASSERT(other, return false);
return m_name == other->m_name;
return !m_executable.isEmpty() && m_executable == other->m_executable
&& m_name == other->m_name;
}
bool TestResult::isIntermediateFor(const TestResult *other) const
{
QTC_ASSERT(other, return false);
return m_name == other->m_name;
return !m_executable.isEmpty() && m_executable == other->m_executable
&& m_name == other->m_name;
}
TestResult *TestResult::createIntermediateResultFor(const TestResult *other)
{
QTC_ASSERT(other, return nullptr);
TestResult *intermediate = new TestResult(other->m_name);
TestResult *intermediate = new TestResult(other->m_executable, other->m_name);
return intermediate;
}

View File

@@ -55,8 +55,9 @@ enum Type {
MessageDisabledTests,
MessageTestCaseStart,
MessageTestCaseSuccess,
MessageTestCaseWarn,
MessageTestCaseSuccessWarn,
MessageTestCaseFail,
MessageTestCaseFailWarn,
MessageTestCaseEnd,
MessageIntermediate,
MessageCurrentTest, INTERNAL_MESSAGES_END = MessageCurrentTest,
@@ -69,12 +70,14 @@ enum Type {
class TestResult
{
public:
explicit TestResult();
TestResult();
explicit TestResult(const QString &name);
TestResult(const QString &executable, const QString &name);
virtual ~TestResult() {}
virtual const QString outputString(bool selected) const;
QString executable() const { return m_executable; }
QString name() const { return m_name; }
Result::Type result() const { return m_result; }
QString description() const { return m_description; }
@@ -97,6 +100,7 @@ public:
virtual TestResult *createIntermediateResultFor(const TestResult *other);
private:
QString m_executable;
QString m_name;
Result::Type m_result = Result::Invalid;
QString m_description;

View File

@@ -41,8 +41,8 @@ const static int outputLimit = 100000;
static bool isSummaryItem(Result::Type type)
{
return type == Result::MessageTestCaseSuccess || type == Result::MessageTestCaseFail
|| type == Result::MessageTestCaseWarn;
return type == Result::MessageTestCaseSuccess || type == Result::MessageTestCaseSuccessWarn
|| type == Result::MessageTestCaseFail || type == Result::MessageTestCaseFailWarn;
}
TestResultDelegate::TestResultDelegate(QObject *parent)

View File

@@ -61,6 +61,8 @@ static QIcon testResultIcon(Result::Type result) {
Icons::RESULT_MESSAGEWARN.icon(),
Icons::RESULT_MESSAGEFATAL.icon(),
Icons::RESULT_MESSAGEFATAL.icon(), // System gets same handling as Fatal for now
Icons::RESULT_MESSAGEPASSWARN.icon(),
Icons::RESULT_MESSAGEFAILWARN.icon(),
}; // provide an icon for unknown??
if (result < 0 || result >= Result::MessageInternal) {
@@ -69,8 +71,10 @@ static QIcon testResultIcon(Result::Type result) {
return icons[Result::Pass];
case Result::MessageTestCaseFail:
return icons[Result::Fail];
case Result::MessageTestCaseWarn:
return icons[Result::MessageWarn];
case Result::MessageTestCaseSuccessWarn:
return icons[13];
case Result::MessageTestCaseFailWarn:
return icons[14];
default:
return QIcon();
}
@@ -103,6 +107,7 @@ void TestResultItem::updateResult()
return;
Result::Type newResult = Result::MessageTestCaseSuccess;
bool withWarning = false;
for (Utils::TreeItem *child : *this) {
const TestResult *current = static_cast<TestResultItem *>(child)->testResult();
if (current) {
@@ -111,22 +116,29 @@ void TestResultItem::updateResult()
case Result::MessageFatal:
case Result::UnexpectedPass:
case Result::MessageTestCaseFail:
m_testResult->setResult(Result::MessageTestCaseFail);
return;
newResult = Result::MessageTestCaseFail;
break;
case Result::ExpectedFail:
case Result::MessageWarn:
case Result::Skip:
case Result::BlacklistedFail:
case Result::BlacklistedPass:
case Result::MessageTestCaseWarn:
newResult = Result::MessageTestCaseWarn;
case Result::MessageTestCaseSuccessWarn:
case Result::MessageTestCaseFailWarn:
withWarning = true;
break;
default: {}
}
}
}
if (withWarning) {
m_testResult->setResult(newResult == Result::MessageTestCaseSuccess
? Result::MessageTestCaseSuccessWarn
: Result::MessageTestCaseFailWarn);
} else {
m_testResult->setResult(newResult);
}
}
void TestResultItem::updateIntermediateChildren()
{
@@ -295,11 +307,13 @@ TestResultItem *TestResultModel::findParentItemFor(const TestResultItem *item,
TestResultItem *root = startItem ? const_cast<TestResultItem *>(startItem) : nullptr;
const TestResult *result = item->testResult();
const QString &name = result->name();
const QString &executable = result->executable();
if (root == nullptr && !name.isEmpty()) {
for (int row = rootItem()->childCount() - 1; row >= 0; --row) {
TestResultItem *tmp = static_cast<TestResultItem *>(rootItem()->childAt(row));
if (tmp->testResult()->name() == name) {
auto tmpTestResult = tmp->testResult();
if (tmpTestResult->executable() == executable && tmpTestResult->name() == name) {
root = tmp;
break;
}
@@ -344,8 +358,9 @@ void TestResultFilterModel::enableAllResultTypes()
<< Result::MessageFatal << Result::Invalid << Result::BlacklistedPass
<< Result::BlacklistedFail << Result::Benchmark << Result::MessageIntermediate
<< Result::MessageCurrentTest << Result::MessageTestCaseStart
<< Result::MessageTestCaseSuccess << Result::MessageTestCaseWarn
<< Result::MessageTestCaseFail << Result::MessageTestCaseEnd
<< Result::MessageTestCaseSuccess << Result::MessageTestCaseSuccessWarn
<< Result::MessageTestCaseFail << Result::MessageTestCaseFailWarn
<< Result::MessageTestCaseEnd
<< Result::MessageInfo << Result::MessageSystem;
invalidateFilter();
}
@@ -393,7 +408,8 @@ bool TestResultFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
case Result::MessageTestCaseSuccess:
return m_enabled.contains(Result::Pass);
case Result::MessageTestCaseFail:
case Result::MessageTestCaseWarn:
case Result::MessageTestCaseSuccessWarn:
case Result::MessageTestCaseFailWarn:
return acceptTestCaseResult(index);
default:
return m_enabled.contains(resultType);
@@ -407,7 +423,8 @@ bool TestResultFilterModel::acceptTestCaseResult(const QModelIndex &srcIndex) co
Result::Type type = m_sourceModel->testResult(child)->result();
if (type == Result::MessageTestCaseSuccess)
type = Result::Pass;
if (type == Result::MessageTestCaseFail || type == Result::MessageTestCaseWarn) {
if (type == Result::MessageTestCaseFail || type == Result::MessageTestCaseFailWarn
|| type == Result::MessageTestCaseSuccessWarn) {
if (acceptTestCaseResult(child))
return true;
} else if (m_enabled.contains(type)) {

View File

@@ -43,9 +43,9 @@ QtcPlugin {
"clangassistproposalmodel.h",
"clangbackendipcintegration.cpp",
"clangbackendipcintegration.h",
"clangcodemodel.qrc",
"clangcodemodelplugin.cpp",
"clangcodemodelplugin.h",
"clangcodemodel.qrc",
"clangcompletionassistinterface.cpp",
"clangcompletionassistinterface.h",
"clangcompletionassistprocessor.cpp",

View File

@@ -72,6 +72,18 @@ bool ClangQueryHighlighter::hasDiagnostics() const
return m_marker.hasMessagesOrContexts();
}
ClangBackEnd::DynamicASTMatcherDiagnosticMessageContainers
ClangQueryHighlighter::messagesForLineAndColumn(uint line, uint column) const
{
return m_marker.messagesForLineAndColumn(line, column);
}
ClangBackEnd::DynamicASTMatcherDiagnosticContextContainers
ClangQueryHighlighter::contextsForLineAndColumn(uint line, uint column) const
{
return m_marker.contextsForLineAndColumn(line, column);
}
void ClangQueryHighlighter::highlightBlock(const QString &text)
{
int currentLineNumber = currentBlock().blockNumber() + 1;

View File

@@ -44,6 +44,12 @@ public:
bool hasDiagnostics() const;
ClangBackEnd::DynamicASTMatcherDiagnosticMessageContainers
messagesForLineAndColumn(uint line, uint column) const;
ClangBackEnd::DynamicASTMatcherDiagnosticContextContainers
contextsForLineAndColumn(uint line, uint column) const;
protected:
void highlightBlock(const QString &text) override;

View File

@@ -250,6 +250,85 @@ public:
return !m_messages.empty() || !m_contexts.empty();
}
static
bool isAfterStartColumn(const SourceRange &sourceRange, uint line, uint column)
{
return sourceRange.start().line() == line && sourceRange.start().column() <= column;
}
static
bool isBeforeEndColumn(const SourceRange &sourceRange, uint line, uint column)
{
return sourceRange.end().line() == line && sourceRange.end().column() >= column;
}
static
bool isInBetweenLine(const SourceRange &sourceRange, uint line)
{
return sourceRange.start().line() < line && sourceRange.end().line() > line;
}
static
bool isSingleLine(const SourceRange &sourceRange)
{
return sourceRange.start().line() == sourceRange.end().line();
}
static
bool isInsideMultiLine(const SourceRange &sourceRange, uint line, uint column)
{
return !isSingleLine(sourceRange)
&& (isAfterStartColumn(sourceRange, line, column)
|| isInBetweenLine(sourceRange, line)
|| isBeforeEndColumn(sourceRange, line, column));
}
static
bool isInsideSingleLine(const SourceRange &sourceRange, uint line, uint column)
{
return isSingleLine(sourceRange)
&& isAfterStartColumn(sourceRange, line, column)
&& isBeforeEndColumn(sourceRange, line, column);
}
static
bool isInsideRange(const SourceRange &sourceRange, uint line, uint column)
{
return isInsideSingleLine(sourceRange, line, column)
|| isInsideMultiLine(sourceRange, line, column);
}
Messages messagesForLineAndColumn(uint line, uint column) const
{
Messages messages;
auto underPosition = [=] (const Message &message) {
return ClangQueryHighlightMarker::isInsideRange(message.sourceRange(), line, column);
};
std::copy_if(m_messages.begin(),
m_messages.end(),
std::back_inserter(messages),
underPosition);
return messages;
}
Contexts contextsForLineAndColumn(uint line, uint column) const
{
Contexts contexts;
auto underPosition = [=] (const Context &context) {
return ClangQueryHighlightMarker::isInsideRange(context.sourceRange(), line, column);
};
std::copy_if(m_contexts.begin(),
m_contexts.end(),
std::back_inserter(contexts),
underPosition);
return contexts;
}
private:
Contexts m_contexts;

View File

@@ -0,0 +1,60 @@
/****************************************************************************
**
** Copyright (C) 2017 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 "clangqueryhoverhandler.h"
#include "clangqueryhighlighter.h"
#include <dynamicastmatcherdiagnosticmessagecontainer.h>
#include <texteditor/texteditor.h>
namespace ClangRefactoring {
ClangQueryHoverHandler::ClangQueryHoverHandler(ClangQueryHighlighter *highligher)
: m_highligher(highligher)
{
}
void ClangQueryHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, int position)
{
using Messages = ClangBackEnd::DynamicASTMatcherDiagnosticMessageContainers;
using Contexts = ClangBackEnd::DynamicASTMatcherDiagnosticContextContainers;
QTextCursor textCursor = editorWidget->textCursor();
textCursor.setPosition(position);
int line = textCursor.blockNumber() + 1;
int column = textCursor.columnNumber() + 1;
Messages messages = m_highligher->messagesForLineAndColumn(uint(line), uint(column));
Contexts contexts = m_highligher->contextsForLineAndColumn(uint(line), uint(column));
if (!messages.empty())
setToolTip(QString("%1: %2").arg(messages[0].errorTypeText()).arg(messages[0].arguments().join(", ")));
else if (!contexts.empty())
setToolTip(QString("%1: %2").arg(contexts[0].contextTypeText()).arg(contexts[0].arguments().join(", ")));
}
} // namespace ClangRefactoring

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2017 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.
**
****************************************************************************/
#pragma once
#include <texteditor/basehoverhandler.h>
namespace ClangRefactoring {
class ClangQueryHighlighter;
class ClangQueryHoverHandler : public TextEditor::BaseHoverHandler
{
public:
ClangQueryHoverHandler(ClangQueryHighlighter *highligher);
protected:
void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int position) override;
private:
ClangQueryHighlighter *m_highligher;
};
} // namespace ClangRefactoring

View File

@@ -85,7 +85,7 @@ void ClangQueryProjectsFindFilter::requestSourceRangesAndDiagnostics(const QStri
ClangBackEnd::RequestSourceRangesAndDiagnosticsForQueryMessage message(queryText,
{ClangBackEnd::FilePath(filePath),
exampleContent,
{"cc", toNative(filePath)}});
{"cc", "-std=c++1z", toNative(filePath)}});
m_server.requestSourceRangesAndDiagnosticsForQueryMessage(std::move(message));
}

View File

@@ -26,19 +26,24 @@
#include "clangquerytexteditorwidget.h"
#include "clangqueryhighlighter.h"
#include "clangqueryhoverhandler.h"
#include <texteditor/textdocument.h>
namespace ClangRefactoring {
ClangQueryTextEditorWidget::ClangQueryTextEditorWidget(QWidget *parent)
: BaseClangQueryTextEditorWidget(parent)
: BaseClangQueryTextEditorWidget(parent),
m_syntaxHighlighter(new ClangQueryHighlighter),
m_hoverHandler(std::make_unique<ClangQueryHoverHandler>(m_syntaxHighlighter))
{
m_syntaxHighlighter = new ClangQueryHighlighter;
textDocument()->setSyntaxHighlighter(m_syntaxHighlighter);
addHoverHandler(m_hoverHandler.get());
}
ClangQueryTextEditorWidget::~ClangQueryTextEditorWidget() = default;
ClangQueryHighlighter *ClangQueryTextEditorWidget::syntaxHighlighter() const
{
return m_syntaxHighlighter;

View File

@@ -27,9 +27,12 @@
#include "baseclangquerytexteditorwidget.h"
#include <memory>
namespace ClangRefactoring {
class ClangQueryHighlighter;
class ClangQueryHoverHandler;
class ClangQueryTextEditorWidget : public BaseClangQueryTextEditorWidget
{
@@ -37,11 +40,13 @@ class ClangQueryTextEditorWidget : public BaseClangQueryTextEditorWidget
public:
ClangQueryTextEditorWidget(QWidget *parent);
~ClangQueryTextEditorWidget();
ClangQueryHighlighter *syntaxHighlighter() const;
private:
ClangQueryHighlighter *m_syntaxHighlighter;
std::unique_ptr<ClangQueryHoverHandler> m_hoverHandler;
};
} // namespace ClangRefactoring

View File

@@ -14,7 +14,8 @@ HEADERS += \
clangqueryprojectsfindfilterwidget.h \
clangqueryexampletexteditorwidget.h \
clangquerytexteditorwidget.h \
baseclangquerytexteditorwidget.h
baseclangquerytexteditorwidget.h \
clangqueryhoverhandler.h
SOURCES += \
clangrefactoringplugin.cpp \
@@ -24,7 +25,8 @@ SOURCES += \
clangqueryprojectsfindfilterwidget.cpp \
clangqueryexampletexteditorwidget.cpp \
clangquerytexteditorwidget.cpp \
baseclangquerytexteditorwidget.cpp
baseclangquerytexteditorwidget.cpp \
clangqueryhoverhandler.cpp
FORMS += \
clangqueryprojectsfindfilter.ui

View File

@@ -19,13 +19,13 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'application/vnd.audc.text.clearcase.submit\'>
<comment>ClearCase submit template</comment>
<sub-class-of type=\'text/plain\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'application/vnd.audc.text.clearcase.submit\'>\",
\" <comment>ClearCase submit template</comment>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -17,19 +17,19 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/x-cmake\'>
<sub-class-of type=\'text/plain\'/>
<comment>CMake Project file</comment>
<glob pattern=\'*.cmake\'/>
</mime-type>
<mime-type type=\'text/x-cmake-project\'>
<sub-class-of type=\'text/x-cmake\'/>
<comment>CMake Project file</comment>
<glob pattern=\'CMakeLists.txt\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/x-cmake\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>CMake Project file</comment>\",
\" <glob pattern=\'*.cmake\'/>\",
\" </mime-type>\",
\" <mime-type type=\'text/x-cmake-project\'>\",
\" <sub-class-of type=\'text/x-cmake\'/>\",
\" <comment>CMake Project file</comment>\",
\" <glob pattern=\'CMakeLists.txt\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -61,6 +61,9 @@ private slots:
void testCMakeProjectImporterToolChain_data();
void testCMakeProjectImporterToolChain();
void testServerModeReaderProgress_data();
void testServerModeReaderProgress();
#endif
private:

View File

@@ -417,8 +417,7 @@ void ServerModeReader::handleProgress(int min, int cur, int max, const QString &
if (!m_future)
return;
int progress = m_progressStepMinimum
+ (((max - min) / (cur - min)) * (m_progressStepMaximum - m_progressStepMinimum));
const int progress = calculateProgress(m_progressStepMinimum, min, cur, max, m_progressStepMaximum);
m_future->setProgressValue(progress);
}
@@ -430,6 +429,14 @@ void ServerModeReader::handleSignal(const QString &signal, const QVariantMap &da
emit dirty();
}
int ServerModeReader::calculateProgress(const int minRange, const int min, const int cur, const int max, const int maxRange)
{
if (minRange == maxRange || min == max)
return minRange;
const int clampedCur = std::min(std::max(cur, min), max);
return minRange + ((clampedCur - min) / (max - min)) * (maxRange - minRange);
}
void ServerModeReader::extractCodeModelData(const QVariantMap &data)
{
const QVariantList configs = data.value("configurations").toList();
@@ -880,3 +887,59 @@ void ServerModeReader::addHeaderNodes(ProjectNode *root, const QList<FileNode *>
} // namespace Internal
} // namespace CMakeProjectManager
#if defined(WITH_TESTS)
#include "cmakeprojectplugin.h"
#include <QTest>
namespace CMakeProjectManager {
namespace Internal {
void CMakeProjectPlugin::testServerModeReaderProgress_data()
{
QTest::addColumn<int>("minRange");
QTest::addColumn<int>("min");
QTest::addColumn<int>("cur");
QTest::addColumn<int>("max");
QTest::addColumn<int>("maxRange");
QTest::addColumn<int>("expected");
QTest::newRow("empty range") << 100 << 10 << 11 << 20 << 100 << 100;
QTest::newRow("one range (low)") << 0 << 10 << 11 << 20 << 1 << 0;
QTest::newRow("one range (high)") << 20 << 10 << 19 << 20 << 20 << 20;
QTest::newRow("large range") << 30 << 10 << 11 << 20 << 100000 << 30;
QTest::newRow("empty progress") << -5 << 10 << 10 << 10 << 99995 << -5;
QTest::newRow("one progress (low)") << 42 << 10 << 10 << 11 << 100042 << 42;
QTest::newRow("one progress (high)") << 0 << 10 << 11 << 11 << 100000 << 100000;
QTest::newRow("large progress") << 0 << 10 << 10 << 11 << 100000 << 0;
QTest::newRow("cur too low") << 0 << 10 << 9 << 100 << 100000 << 0;
QTest::newRow("cur too high") << 0 << 10 << 101 << 100 << 100000 << 100000;
QTest::newRow("cur much too low") << 0 << 10 << -1000 << 100 << 100000 << 0;
QTest::newRow("cur much too high") << 0 << 10 << 1110000 << 100 << 100000 << 100000;
}
void CMakeProjectPlugin::testServerModeReaderProgress()
{
QFETCH(int, minRange);
QFETCH(int, min);
QFETCH(int, cur);
QFETCH(int, max);
QFETCH(int, maxRange);
QFETCH(int, expected);
ServerModeReader reader;
const int r = reader.calculateProgress(minRange, min, cur, max, maxRange);
QCOMPARE(r, expected);
QVERIFY(r <= maxRange);
QVERIFY(r >= minRange);
}
} // namespace Internal
} // namespace CMakeProjectManager
#endif

View File

@@ -69,6 +69,10 @@ private:
void handleProgress(int min, int cur, int max, const QString &inReplyTo);
void handleSignal(const QString &signal, const QVariantMap &data);
int calculateProgress(const int minRange, const int min,
const int cur,
const int max, const int maxRange);
struct Target;
struct Project;
@@ -175,6 +179,10 @@ private:
QList<FileGroup *> m_fileGroups;
CMakeParser m_parser;
#if defined(WITH_TESTS)
friend class CMakeProjectPlugin;
#endif
};
} // namespace Internal

View File

@@ -131,8 +131,9 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
continue;
const QJsonObject metaData = plugin->metaData();
const QJsonValue mimetypes = metaData.value("Mimetypes");
if (mimetypes.isString())
Utils::addMimeTypes(plugin->name() + ".mimetypes", mimetypes.toString().trimmed().toUtf8());
QString mimetypeString;
if (ExtensionSystem::PluginSpec::readMultiLineString(mimetypes, &mimetypeString))
Utils::addMimeTypes(plugin->name() + ".mimetypes", mimetypeString.trimmed().toUtf8());
}
if (ThemeEntry::availableThemes().isEmpty()) {

View File

@@ -369,6 +369,28 @@ IWizardFactory *NewDialog::currentWizardFactory() const
return factoryOfItem(m_model->itemFromIndex(index));
}
static QIcon iconWithText(const QIcon &icon, const QString &text)
{
if (text.isEmpty())
return icon;
QIcon iconWithText;
for (const QSize &pixmapSize : icon.availableSizes()) {
QPixmap pixmap = icon.pixmap(pixmapSize);
const int fontSize = pixmap.height() / 4;
const int margin = pixmap.height() / 8;
QFont font;
font.setPixelSize(fontSize);
font.setStretch(85);
QPainter p(&pixmap);
p.setFont(font);
QTextOption textOption(Qt::AlignHCenter | Qt::AlignBottom);
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
p.drawText(pixmap.rect().adjusted(margin, margin, -margin, -margin), text, textOption);
iconWithText.addPixmap(pixmap);
}
return iconWithText;
}
void NewDialog::addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *factory)
{
const QString categoryName = factory->category();
@@ -394,7 +416,7 @@ void NewDialog::addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *fac
wizardIcon = m_dummyIcon;
else
wizardIcon = factory->icon();
wizardItem->setIcon(wizardIcon);
wizardItem->setIcon(iconWithText(wizardIcon, factory->iconText()));
wizardItem->setData(QVariant::fromValue(WizardFactoryContainer(factory, 0)), Qt::UserRole);
wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
categoryItem->appendRow(wizardItem);

View File

@@ -264,12 +264,12 @@ void FindToolWindow::setCurrentFilter(int index)
void FindToolWindow::acceptAndGetParameters(QString *term, IFindFilter **filter)
{
if (filter)
QTC_ASSERT(filter, return);
*filter = 0;
Find::updateFindCompletion(m_ui.searchTerm->text());
int index = m_ui.filterList->currentIndex();
QString searchTerm = m_ui.searchTerm->text();
if (filter && index >= 0)
if (index >= 0)
*filter = m_filters.at(index);
if (term)
*term = searchTerm;

View File

@@ -60,6 +60,7 @@ public:
Id id() const { return m_id; }
WizardKind kind() const { return m_supportedProjectTypes.isEmpty() ? FileWizard : ProjectWizard; }
QIcon icon() const { return m_icon; }
QString iconText() const { return m_iconText; }
QString description() const { return m_description; }
QString displayName() const { return m_displayName; }
QString category() const { return m_category; }
@@ -72,6 +73,7 @@ public:
void setId(const Id id) { m_id = id; }
void setSupportedProjectTypes(const QSet<Id> &projectTypes) { m_supportedProjectTypes = projectTypes; }
void setIcon(const QIcon &icon) { m_icon = icon; }
void setIconText(const QString &iconText) { m_iconText = iconText; }
void setDescription(const QString &description) { m_description = description; }
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
void setCategory(const QString &category) { m_category = category; }
@@ -123,6 +125,7 @@ private:
QAction *m_action = 0;
QIcon m_icon;
QString m_iconText;
QString m_description;
QString m_displayName;
QString m_category;

View File

@@ -27,6 +27,9 @@
#include <cplusplus/MatchingText.h>
#include <texteditor/tabsettings.h>
#include <QTextBlock>
#include <QTextCursor>
using namespace CppEditor;
@@ -35,7 +38,9 @@ using namespace Internal;
bool CppAutoCompleter::contextAllowsAutoBrackets(const QTextCursor &cursor,
const QString &textToInsert) const
{
return CPlusPlus::MatchingText::contextAllowsAutoParentheses(cursor, textToInsert);
const CPlusPlus::MatchingText::IsNextBlockDeeperIndented isIndented
= [this](const QTextBlock &b) { return isNextBlockIndented(b); };
return CPlusPlus::MatchingText::contextAllowsAutoParentheses(cursor, textToInsert, isIndented);
}
bool CppAutoCompleter::contextAllowsAutoQuotes(const QTextCursor &cursor,

View File

@@ -70,7 +70,9 @@ CppLocalRenaming::CppLocalRenaming(TextEditor::TextEditorWidget *editorWidget)
void CppLocalRenaming::updateSelectionsForVariableUnderCursor(
const QList<QTextEdit::ExtraSelection> &selections)
{
QTC_ASSERT(!isActive(), return);
if (isActive())
return;
m_selections = selections;
}

View File

@@ -94,6 +94,7 @@ void CppUseSelectionsUpdater::update(CallType callType)
m_runnerWatcher->setFuture(cppEditorDocument->cursorInfo(params));
} else { // synchronous case
const int startRevision = cppEditorDocument->document()->revision();
QFuture<CursorInfo> future = cppEditorDocument->cursorInfo(params);
// QFuture::waitForFinished seems to block completely, not even
@@ -102,6 +103,7 @@ void CppUseSelectionsUpdater::update(CallType callType)
if (future.isCanceled())
return;
QTC_ASSERT(startRevision == cppEditorDocument->document()->revision(), return);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
}

View File

@@ -18,101 +18,101 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/x-csrc\'>
<comment>C source code</comment>
<sub-class-of type=\'text/plain\'/>
<alias type=\'text/x-c\'/>
<glob pattern=\'*.c\' case-sensitive=\'true\' weight=\'70\'/>
</mime-type>
\"Mimetypes\" : [
\"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/x-csrc\'>\",
\" <comment>C source code</comment>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <alias type=\'text/x-c\'/>\",
\" <glob pattern=\'*.c\' case-sensitive=\'true\' weight=\'70\'/>\",
\" </mime-type>\",
<mime-type type=\'text/vnd.nvidia.cuda.csrc\'>
<sub-class-of type=\'text/x-csrc\'/>
<comment>NVIDIA CUDA C source code</comment>
<glob pattern=\'*.cu\'/>
</mime-type>
\" <mime-type type=\'text/vnd.nvidia.cuda.csrc\'>\",
\" <sub-class-of type=\'text/x-csrc\'/>\",
\" <comment>NVIDIA CUDA C source code</comment>\",
\" <glob pattern=\'*.cu\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-chdr\'>
<comment>C header</comment>
<sub-class-of type=\'text/x-csrc\'/>
<!-- reduce weight from freedesktop to avoid conflict with text/x-c++hdr -->
<glob pattern=\'*.h\' weight=\'30\'/>
</mime-type>
\" <mime-type type=\'text/x-chdr\'>\",
\" <comment>C header</comment>\",
\" <sub-class-of type=\'text/x-csrc\'/>\",
\" <!-- reduce weight from freedesktop to avoid conflict with text/x-c++hdr -->\",
\" <glob pattern=\'*.h\' weight=\'30\'/>\",
\" </mime-type>\",
<!-- Those are used to find matching headers by the CppTools plugin,
so, they should match -->
<mime-type type=\'text/x-c++hdr\'>
<sub-class-of type=\'text/x-chdr\'/>
<comment>C++ header</comment>
<glob pattern=\'*.hh\' weight=\'70\'/>
<glob pattern=\'*.hxx\' weight=\'70\'/>
<glob pattern=\'*.h++\' weight=\'70\'/>
<glob pattern=\'*.hpp\' weight=\'70\'/>
<glob pattern=\'*.hp\' weight=\'70\'/>
<!-- Additions to freedesktop: -->
<glob pattern=\'*.h\' weight=\'70\'/>
<glob pattern=\'*.H\' weight=\'70\'/>
<!-- Find include guards of header files without extension, for
example, STL ones like <string>. Those can have a big initial
comment exceeding 1000 chars, though. -->
<magic priority=\'50\'>
<match value=\'#ifndef \' type=\'string\' offset=\'0:2000\'/>
<match value=\'#if \' type=\'string\' offset=\'0:2000\'/>
<match value=\'#include \' type=\'string\' offset=\'0:2000\'/>
</magic>
</mime-type>
\" <!-- Those are used to find matching headers by the CppTools plugin,\",
\" so, they should match -->\",
\" <mime-type type=\'text/x-c++hdr\'>\",
\" <sub-class-of type=\'text/x-chdr\'/>\",
\" <comment>C++ header</comment>\",
\" <glob pattern=\'*.hh\' weight=\'70\'/>\",
\" <glob pattern=\'*.hxx\' weight=\'70\'/>\",
\" <glob pattern=\'*.h++\' weight=\'70\'/>\",
\" <glob pattern=\'*.hpp\' weight=\'70\'/>\",
\" <glob pattern=\'*.hp\' weight=\'70\'/>\",
\" <!-- Additions to freedesktop: -->\",
\" <glob pattern=\'*.h\' weight=\'70\'/>\",
\" <glob pattern=\'*.H\' weight=\'70\'/>\",
\" <!-- Find include guards of header files without extension, for\",
\" example, STL ones like <string>. Those can have a big initial\",
\" comment exceeding 1000 chars, though. -->\",
\" <magic priority=\'50\'>\",
\" <match value=\'#ifndef \' type=\'string\' offset=\'0:2000\'/>\",
\" <match value=\'#if \' type=\'string\' offset=\'0:2000\'/>\",
\" <match value=\'#include \' type=\'string\' offset=\'0:2000\'/>\",
\" </magic>\",
\" </mime-type>\",
<mime-type type=\'text/x-c++src\'>
<comment>C++ source code</comment>
<sub-class-of type=\'text/x-csrc\'/>
<glob pattern=\'*.cpp\' weight=\'70\'/>
<glob pattern=\'*.cxx\' weight=\'70\'/>
<glob pattern=\'*.cc\' weight=\'70\'/>
<glob pattern=\'*.C\' case-sensitive=\'true\' weight=\'70\'/>
<glob pattern=\'*.c++\' weight=\'70\'/>
<!-- Additions to freedesktop: -->
<glob pattern=\'*.cp\' weight=\'70\'/>
<glob pattern=\'*.inl\' weight=\'70\'/>
<glob pattern=\'*.tcc\' weight=\'70\'/>
<glob pattern=\'*.tpp\' weight=\'70\'/>
<glob pattern=\'*.t++\' weight=\'70\'/>
<glob pattern=\'*.txx\' weight=\'70\'/>
<magic priority=\'30\'>
<match value=\'-*- C++ -*-\' type=\'string\' offset=\'0:30\'/>
</magic>
</mime-type>
\" <mime-type type=\'text/x-c++src\'>\",
\" <comment>C++ source code</comment>\",
\" <sub-class-of type=\'text/x-csrc\'/>\",
\" <glob pattern=\'*.cpp\' weight=\'70\'/>\",
\" <glob pattern=\'*.cxx\' weight=\'70\'/>\",
\" <glob pattern=\'*.cc\' weight=\'70\'/>\",
\" <glob pattern=\'*.C\' case-sensitive=\'true\' weight=\'70\'/>\",
\" <glob pattern=\'*.c++\' weight=\'70\'/>\",
\" <!-- Additions to freedesktop: -->\",
\" <glob pattern=\'*.cp\' weight=\'70\'/>\",
\" <glob pattern=\'*.inl\' weight=\'70\'/>\",
\" <glob pattern=\'*.tcc\' weight=\'70\'/>\",
\" <glob pattern=\'*.tpp\' weight=\'70\'/>\",
\" <glob pattern=\'*.t++\' weight=\'70\'/>\",
\" <glob pattern=\'*.txx\' weight=\'70\'/>\",
\" <magic priority=\'30\'>\",
\" <match value=\'-*- C++ -*-\' type=\'string\' offset=\'0:30\'/>\",
\" </magic>\",
\" </mime-type>\",
<mime-type type=\'text/x-qdoc\'>
<comment>Qt documentation file</comment>
<sub-class-of type=\'text/plain\'/>
<glob pattern=\'*.qdoc\' weight=\'70\'/>
</mime-type>
\" <mime-type type=\'text/x-qdoc\'>\",
\" <comment>Qt documentation file</comment>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <glob pattern=\'*.qdoc\' weight=\'70\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-moc\'>
<comment>Qt MOC file</comment>
<!-- Fix to freedesktop: moc is C++ source -->
<sub-class-of type=\'text/x-c++src\'/>
<glob pattern=\'*.moc\' weight=\'70\'/>
</mime-type>
\" <mime-type type=\'text/x-moc\'>\",
\" <comment>Qt MOC file</comment>\",
\" <!-- Fix to freedesktop: moc is C++ source -->\",
\" <sub-class-of type=\'text/x-c++src\'/>\",
\" <glob pattern=\'*.moc\' weight=\'70\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-objc++src\'>
<comment>Objective-C++ source code</comment>
<sub-class-of type=\'text/x-c++src\'/>
<sub-class-of type=\'text/x-objcsrc\'/>
<glob pattern=\'*.mm\' weight=\'70\'/>
</mime-type>
\" <mime-type type=\'text/x-objc++src\'>\",
\" <comment>Objective-C++ source code</comment>\",
\" <sub-class-of type=\'text/x-c++src\'/>\",
\" <sub-class-of type=\'text/x-objcsrc\'/>\",
\" <glob pattern=\'*.mm\' weight=\'70\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-objcsrc\'>
<comment>Objective-C source code</comment>
<sub-class-of type=\'text/x-csrc\'/>
<glob pattern=\'*.m\' weight=\'70\'/>
<magic priority=\'30\'>
<match value=\'#import\' type=\'string\' offset=\'0\'/>
</magic>
</mime-type>
\" <mime-type type=\'text/x-objcsrc\'>\",
\" <comment>Objective-C source code</comment>\",
\" <sub-class-of type=\'text/x-csrc\'/>\",
\" <glob pattern=\'*.m\' weight=\'70\'/>\",
\" <magic priority=\'30\'>\",
\" <match value=\'#import\' type=\'string\' offset=\'0\'/>\",
\" </magic>\",
\" </mime-type>\",
</mime-info>
\"
\"</mime-info>\"
]
}

View File

@@ -83,6 +83,7 @@ static void addConfigForAlmostEveryWarning(ClangDiagnosticConfigsModel &model)
QStringLiteral("-Wno-gnu-zero-variadic-macro-arguments"),
QStringLiteral("-Wno-documentation"),
QStringLiteral("-Wno-shadow"),
QStringLiteral("-Wno-switch-enum"),
QStringLiteral("-Wno-missing-prototypes"), // Not optimal for C projects.
QStringLiteral("-Wno-used-but-marked-unused"), // e.g. QTest::qWait
} + commonWarnings());

View File

@@ -17,13 +17,13 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/vnd.qtcreator.cvs.submit\'>
<comment>CVS submit template</comment>
<sub-class-of type=\'text/plain\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/vnd.qtcreator.cvs.submit\'>\",
\" <comment>CVS submit template</comment>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -41,20 +41,20 @@
],
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/x-asm\'>
<sub-class-of type=\'text/plain\'/>
<comment>Assembler</comment>
<glob pattern=\'*.asm\'/>
</mime-type>
<!-- Catch-all for assemblers -->
<mime-type type=\'text/x-qtcreator-generic-asm\'>
<sub-class-of type=\'text/x-asm\'/>
<comment>Qt Creator Generic Assembler</comment>
<glob pattern=\'*.asm\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/x-asm\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Assembler</comment>\",
\" <glob pattern=\'*.asm\'/>\",
\" </mime-type>\",
\" <!-- Catch-all for assemblers -->\",
\" <mime-type type=\'text/x-qtcreator-generic-asm\'>\",
\" <sub-class-of type=\'text/x-asm\'/>\",
\" <comment>Qt Creator Generic Assembler</comment>\",
\" <glob pattern=\'*.asm\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -87,6 +87,7 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
wizard->setDisplayName(tr("Qt Designer Form Class"));
wizard->setIconText("ui/h");
wizard->setId("C.FormClass");
wizard->setDescription(tr("Creates a Qt Designer form along with a matching class (C++ header and source file) "
"for implementation purposes. You can add the form and class to an existing Qt Widget Project."));

View File

@@ -17,34 +17,34 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/x-generic-project\'>
<sub-class-of type=\'text/plain\'/>
<comment>Generic Qt Creator Project file</comment>
<glob pattern=\'*.creator\'/>
</mime-type>
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/x-generic-project\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Generic Qt Creator Project file</comment>\",
\" <glob pattern=\'*.creator\'/>\",
\" </mime-type>\",
<mime-type type=\'application/vnd.qtcreator.generic.files\'>
<sub-class-of type=\'text/plain\'/>
<comment>Generic Project Files</comment>
<glob pattern=\'*.files\'/>
</mime-type>
\" <mime-type type=\'application/vnd.qtcreator.generic.files\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Generic Project Files</comment>\",
\" <glob pattern=\'*.files\'/>\",
\" </mime-type>\",
<mime-type type=\'application/vnd.qtcreator.generic.includes\'>
<sub-class-of type=\'text/plain\'/>
<comment>Generic Project Include Paths</comment>
<glob pattern=\'*.includes\'/>
</mime-type>
\" <mime-type type=\'application/vnd.qtcreator.generic.includes\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Generic Project Include Paths</comment>\",
\" <glob pattern=\'*.includes\'/>\",
\" </mime-type>\",
<mime-type type=\'application/vnd.qtcreator.generic.config\'>
<sub-class-of type=\'text/plain\'/>
<comment>Generic Project Configuration File</comment>
<glob pattern=\'*.config\'/>
</mime-type>
\" <mime-type type=\'application/vnd.qtcreator.generic.config\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Generic Project Configuration File</comment>\",
\" <glob pattern=\'*.config\'/>\",
\" </mime-type>\",
</mime-info>
\"
\"</mime-info>\"
]
}

View File

@@ -17,20 +17,20 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/vnd.qtcreator.git.commit\'>
<sub-class-of type=\'text/plain\'/>
<comment>Git Commit File</comment>
<glob pattern=\'COMMIT_MSG\'/>
<glob pattern=\'COMMIT_EDITMSG\'/>
</mime-type>
<mime-type type=\'text/vnd.qtcreator.git.rebase\'>
<sub-class-of type=\'text/plain\'/>
<comment>Git Commit File</comment>
<glob pattern=\'git-rebase-todo\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/vnd.qtcreator.git.commit\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Git Commit File</comment>\",
\" <glob pattern=\'COMMIT_MSG\'/>\",
\" <glob pattern=\'COMMIT_EDITMSG\'/>\",
\" </mime-type>\",
\" <mime-type type=\'text/vnd.qtcreator.git.rebase\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Git Commit File</comment>\",
\" <glob pattern=\'git-rebase-todo\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -141,11 +141,12 @@ public:
void exec()
{
QStringList arguments;
arguments << "-c" << "color.grep.match=bold red"
<< "grep" << "-zn"
<< "--no-full-name"
<< "--color=always";
GitClient *client = GitPlugin::client();
QStringList arguments = {
"-c", "color.grep.match=bold red",
"-c", "color.grep=always",
"grep", "-zn", "--no-full-name"
};
if (!(m_parameters.flags & FindCaseSensitively))
arguments << "-i";
if (m_parameters.flags & FindWholeWords)
@@ -154,6 +155,8 @@ public:
arguments << "-P";
else
arguments << "-F";
if (client->gitVersion() >= 0x021300)
arguments << "--recurse-submodules";
arguments << "-e" << m_parameters.text;
GitGrepParameters params = m_parameters.searchEngineParameters.value<GitGrepParameters>();
if (!params.ref.isEmpty()) {
@@ -168,7 +171,7 @@ public:
return QString(":!" + filter);
});
arguments << "--" << filterArgs << exclusionArgs;
QScopedPointer<VcsCommand> command(GitPlugin::client()->createCommand(m_directory));
QScopedPointer<VcsCommand> command(client->createCommand(m_directory));
command->addFlags(VcsCommand::SilentOutput | VcsCommand::SuppressFailMessage);
command->setProgressiveOutput(true);
QFutureWatcher<FileSearchResultList> watcher;
@@ -176,7 +179,7 @@ public:
connect(&watcher, &QFutureWatcher<FileSearchResultList>::canceled,
command.data(), &VcsCommand::cancel);
connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read);
SynchronousProcessResponse resp = command->runCommand(GitPlugin::client()->vcsBinary(), arguments, 0);
SynchronousProcessResponse resp = command->runCommand(client->vcsBinary(), arguments, 0);
switch (resp.result) {
case SynchronousProcessResponse::TerminatedAbnormally:
case SynchronousProcessResponse::StartFailed:

View File

@@ -17,48 +17,48 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
<mime-type type=\'application/x-glsl\'>
<alias type=\'text/x-glsl\'/>
<sub-class-of type=\'text/plain\'/>
<comment>GLSL Shader file</comment>
<glob pattern=\'*.glsl\'/>
<glob pattern=\'*.shader\'/>
</mime-type>
\" <mime-type type=\'application/x-glsl\'>\",
\" <alias type=\'text/x-glsl\'/>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>GLSL Shader file</comment>\",
\" <glob pattern=\'*.glsl\'/>\",
\" <glob pattern=\'*.shader\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-glsl-frag\'>
<sub-class-of type=\'text/x-glsl\'/>
<comment>GLSL Fragment Shader file</comment>
<glob pattern=\'*.frag\'/>
</mime-type>
\" <mime-type type=\'text/x-glsl-frag\'>\",
\" <sub-class-of type=\'text/x-glsl\'/>\",
\" <comment>GLSL Fragment Shader file</comment>\",
\" <glob pattern=\'*.frag\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-glsl-es-frag\'>
<sub-class-of type=\'text/x-glsl\'/>
<comment>GLSL/ES Fragment Shader file</comment>
<glob pattern=\'*.fsh\'/>
</mime-type>
\" <mime-type type=\'text/x-glsl-es-frag\'>\",
\" <sub-class-of type=\'text/x-glsl\'/>\",
\" <comment>GLSL/ES Fragment Shader file</comment>\",
\" <glob pattern=\'*.fsh\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-glsl-vert\'>
<sub-class-of type=\'text/x-glsl\'/>
<comment>GLSL Vertex Shader file</comment>
<glob pattern=\'*.vert\'/>
</mime-type>
\" <mime-type type=\'text/x-glsl-vert\'>\",
\" <sub-class-of type=\'text/x-glsl\'/>\",
\" <comment>GLSL Vertex Shader file</comment>\",
\" <glob pattern=\'*.vert\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-glsl-es-vert\'>
<sub-class-of type=\'text/x-glsl\'/>
<comment>GLSL/ES Vertex Shader file</comment>
<glob pattern=\'*.vsh\'/>
</mime-type>
\" <mime-type type=\'text/x-glsl-es-vert\'>\",
\" <sub-class-of type=\'text/x-glsl\'/>\",
\" <comment>GLSL/ES Vertex Shader file</comment>\",
\" <glob pattern=\'*.vsh\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-glsl-es-geometry\'>
<sub-class-of type=\'text/x-glsl\'/>
<comment>GLSL/ES Geometry Shader file</comment>
<glob pattern=\'*.gsh\'/>
</mime-type>
\" <mime-type type=\'text/x-glsl-es-geometry\'>\",
\" <sub-class-of type=\'text/x-glsl\'/>\",
\" <comment>GLSL/ES Geometry Shader file</comment>\",
\" <glob pattern=\'*.gsh\'/>\",
\" </mime-type>\",
</mime-info>
\"
\"</mime-info>\"
]
}

View File

@@ -17,15 +17,15 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
<mime-type type=\'image/webp\'>
<comment>WebP Image file</comment>
<glob pattern=\'*.webp\'/>
</mime-type>
\" <mime-type type=\'image/webp\'>\",
\" <comment>WebP Image file</comment>\",
\" <glob pattern=\'*.webp\'/>\",
\" </mime-type>\",
</mime-info>
\"
\"</mime-info>\"
]
}

View File

@@ -18,14 +18,14 @@
\"Experimental\" : true,
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/vnd.qtcreator.model\'>
<sub-class-of type=\'text/xml\'/>
<comment>Qt Creator Model File</comment>
<glob pattern=\'*.qmodel\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/vnd.qtcreator.model\'>\",
\" <sub-class-of type=\'text/xml\'/>\",
\" <comment>Qt Creator Model File</comment>\",
\" <glob pattern=\'*.qmodel\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -18,27 +18,27 @@
\"Experimental\" : true,
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
<mime-type type=\'text/x-nim-project\'>
<sub-class-of type=\'text/plain\'/>
<comment>Nim project file</comment>
<glob pattern=\'*.nimproject\'/>
</mime-type>
\" <mime-type type=\'text/x-nim-project\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Nim project file</comment>\",
\" <glob pattern=\'*.nimproject\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-nim\'>
<sub-class-of type=\'text/plain\'/>
<comment>Nim source file </comment>
<glob pattern=\'*.nim\'/>
</mime-type>
\" <mime-type type=\'text/x-nim\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Nim source file </comment>\",
\" <glob pattern=\'*.nim\'/>\",
\" </mime-type>\",
<mime-type type=\'text/x-nim-script\'>
<sub-class-of type=\'text/plain\'/>
<comment>Nim script file </comment>
<glob pattern=\'*.nims\'/>
</mime-type>
</mime-info>
\"
\" <mime-type type=\'text/x-nim-script\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Nim script file </comment>\",
\" <glob pattern=\'*.nims\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -17,16 +17,16 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/vnd.qtcreator.p4.submit\'>
<comment>Perforce submit template</comment>
<sub-class-of type=\'text/plain\'/>
<magic priority=\'50\'>
<match value=\'# A Perforce Change Specification.\' type=\'string\' offset=\'0\'/>
</magic>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/vnd.qtcreator.p4.submit\'>\",
\" <comment>Perforce submit template</comment>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <magic priority=\'50\'>\",
\" <match value=\'# A Perforce Change Specification.\' type=\'string\' offset=\'0\'/>\",
\" </magic>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -434,7 +434,7 @@ static Utils::FileName findLocalCompiler(const Utils::FileName &compilerPath,
&& !pathEntry.contains("distcc");
});
QTC_ASSERT(path != FileName(), return compilerPath);
QTC_ASSERT(!path.isEmpty(), return compilerPath);
return path;
}

View File

@@ -70,6 +70,7 @@ static const char CATEGORY_KEY[] = "category";
static const char CATEGORY_NAME_KEY[] = "trDisplayCategory";
static const char DISPLAY_NAME_KEY[] = "trDisplayName";
static const char ICON_KEY[] = "icon";
static const char ICON_TEXT_KEY[] = "iconText";
static const char IMAGE_KEY[] = "image";
static const char DESCRIPTION_KEY[] = "trDescription";
static const char REQUIRED_FEATURES_KEY[] = "featuresRequired";
@@ -559,6 +560,10 @@ bool JsonWizardFactory::initialize(const QVariantMap &data, const QDir &baseDir,
setIcon(QIcon(strVal));
}
strVal = data.value(QLatin1String(ICON_TEXT_KEY)).toString();
if (!strVal.isEmpty())
setIconText(strVal);
strVal = data.value(QLatin1String(IMAGE_KEY)).toString();
if (!strVal.isEmpty()) {
strVal = baseDir.absoluteFilePath(strVal);

View File

@@ -17,19 +17,19 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'text/x-python-gui\'>
<sub-class-of type=\'text/x-python\'/>
<comment>Python source file without console</comment>
<glob pattern=\'*.pyw\'/>
</mime-type>
<mime-type type=\'text/x-python-project\'>
<sub-class-of type=\'text/x-python\'/>
<comment>Qt Creator Python project file</comment>
<glob pattern=\'*.pyqtc\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/x-python-gui\'>\",
\" <sub-class-of type=\'text/x-python\'/>\",
\" <comment>Python source file without console</comment>\",
\" <glob pattern=\'*.pyw\'/>\",
\" </mime-type>\",
\" <mime-type type=\'text/x-python-project\'>\",
\" <sub-class-of type=\'text/x-python\'/>\",
\" <comment>Qt Creator Python project file</comment>\",
\" <glob pattern=\'*.pyqtc\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -158,6 +158,13 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
return true;
}
QString buildTargetSdk = AndroidManager::buildTargetSDK(target());
if (buildTargetSdk.isEmpty()) {
emit addOutput(tr("Android build SDK not defined. Check Android settings."),
OutputFormat::Stderr);
return false;
}
QStringList arguments;
arguments << QLatin1String("--input")
<< inputFile

View File

@@ -17,39 +17,39 @@
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : \"
<?xml version=\'1.0\'?>
<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>
<mime-type type=\'application/vnd.qt.qmakeprofile\'>
<sub-class-of type=\'text/plain\'/>
<comment>Qt Project file</comment>
<glob pattern=\'*.pro\'/>
</mime-type>
<mime-type type=\'application/vnd.qt.qmakeproincludefile\'>
<sub-class-of type=\'text/plain\'/>
<comment>Qt Project include file</comment>
<glob pattern=\'*.pri\'/>
</mime-type>
<mime-type type=\'application/vnd.qt.qmakeprofeaturefile\'>
<sub-class-of type=\'text/plain\'/>
<comment>Qt Project feature file</comment>
<glob pattern=\'*.prf\'/>
</mime-type>
<mime-type type=\'application/vnd.qt.qmakeproconfigurationfile\'>
<sub-class-of type=\'text/plain\'/>
<comment>Qt Project configuration file</comment>
<glob pattern=\'.qmake.conf\'/>
</mime-type>
<mime-type type=\'application/vnd.qt.qmakeprocachefile\'>
<sub-class-of type=\'text/plain\'/>
<comment>Qt Project cache file</comment>
<glob pattern=\'.qmake.cache\'/>
</mime-type>
<mime-type type=\'application/vnd.qt.qmakeprostashfile\'>
<sub-class-of type=\'text/plain\'/>
<comment>Qt Project stash file</comment>
<glob pattern=\'.qmake.stash\'/>
</mime-type>
</mime-info>
\"
\"Mimetypes\" : [
\"<?xml version=\'1.0\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'application/vnd.qt.qmakeprofile\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Qt Project file</comment>\",
\" <glob pattern=\'*.pro\'/>\",
\" </mime-type>\",
\" <mime-type type=\'application/vnd.qt.qmakeproincludefile\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Qt Project include file</comment>\",
\" <glob pattern=\'*.pri\'/>\",
\" </mime-type>\",
\" <mime-type type=\'application/vnd.qt.qmakeprofeaturefile\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Qt Project feature file</comment>\",
\" <glob pattern=\'*.prf\'/>\",
\" </mime-type>\",
\" <mime-type type=\'application/vnd.qt.qmakeproconfigurationfile\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Qt Project configuration file</comment>\",
\" <glob pattern=\'.qmake.conf\'/>\",
\" </mime-type>\",
\" <mime-type type=\'application/vnd.qt.qmakeprocachefile\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Qt Project cache file</comment>\",
\" <glob pattern=\'.qmake.cache\'/>\",
\" </mime-type>\",
\" <mime-type type=\'application/vnd.qt.qmakeprostashfile\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Qt Project stash file</comment>\",
\" <glob pattern=\'.qmake.stash\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -124,23 +124,26 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
void MoveTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneMouseEvent * event)
{
if (itemList.isEmpty()) {
view()->changeToSelectionTool();
return;
}
ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first());
if (resizeHandle) {
view()->changeToResizeTool();
return;
}
if (view()->hasSingleSelectedModelNode() && selectedItemCursorInMovableArea(event->scenePos()))
return;
if (itemList.isEmpty()) {
view()->changeToSelectionTool();
return;
}
if (!topSelectedItemIsMovable(itemList)) {
view()->changeToSelectionTool();
return;
}
if (view()->hasSingleSelectedModelNode() && !selectedItemCursorInMovableArea(event->scenePos())) {
if (view()->hasSingleSelectedModelNode()) {
view()->changeToSelectionTool();
return;
}

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